Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FOS User Bundle recipe #345

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Read the documentation: https://symfony.com/doc/master/bundles/FOSUserBundle/index.html
fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: main
user_class: AppBundle\Entity\User
service:
mailer: 'fos_user.mailer.noop'
from_email:
address: "%env(MAILER_SENDER_ADDRESS)%"
sender_name: "%env(MAILER_SENDER_NAME)%"
12 changes: 12 additions & 0 deletions friendsofsymfony/user-bundle/2.1/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"bundles": {
"FOS\\UserBundle\\FOSUserBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"env": {
"MAILER_SENDER_ADDRESS": "[email protected]",
"MAILER_SENDER_NAME": "John Doe"
}
}
34 changes: 34 additions & 0 deletions friendsofsymfony/user-bundle/2.1/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> What\'s next? </>
<bg=blue;fg=white> </>

Make sure the twig is installed and the twig engine is turned on
in framework.yaml

* If not, install twig, then add the following to
config/packages/framework.yaml:

framework:
# ...
templating:
engines: [\'twig\']

<fg=yellow>For sending e mails:</>
1. Set MAILER_SENDER_ADDRESS and MAILER_SENDER_NAME in your .env file
2. Configure the mailer service in config/packages/fos_user.yaml

<bg=blue;fg=white> </>
<bg=blue;fg=white> Follow this steps in the Documentation </>
<bg=blue;fg=white> </>

See https://symfony.com/doc/master/bundles/FOSUserBundle/index.html

1. Step 3: Create your User class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add this in the recipe

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This very use case specific. i think, the developer should create the user class on his own

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but we could help the user. We could create a class named User that implements the interface.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can do that

2. Step 4: Configure your application\'s security.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also do this in the recipe?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I don't see any way to modify the application's security.yaml through the recipe. Do you've any idea to solve that?

(config/packages/security.yaml)

3. Step 6: Import FOSUserBundle routing files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done in in the recipe

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Before I get back to work i'll wait for the merge of my pull request from above

(config/routes.yaml)

4. Step 7: Update your database schema