-
-
Notifications
You must be signed in to change notification settings - Fork 654
Add recipe for FOSUserBundle #270
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
db02850
Add recipe for FOSUserBundle
tattali 7e5d3ec
Rename friendsofsymfony/user-bundle/@dev/post-install.txt to friendso…
tattali e123d02
rename to 2.1.x-dev version
tattali f5c0597
rename to 2.1 version
tattali f1f2b70
Update post-install.txt
tattali dfb8b22
Update fos_user.yaml
tattali 53c9524
Update post-install.txt
tattali 176e34b
Update fos_user.yaml
tattali 9bd9382
use no_driver parameter and modify post-install.txt
tattali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fos_user: | ||
db_driver: no_driver # valid values are 'orm', 'mongodb' and 'couchdb' | ||
user_class: App\Entity\User | ||
firewall_name: main | ||
service: | ||
mailer: fos_user.mailer.noop | ||
from_email: | ||
address: "%env(MAILER_SENDER_ADDRESS)%" | ||
sender_name: "%env(MAILER_SENDER_NAME)%" | ||
|
18 changes: 18 additions & 0 deletions
18
friendsofsymfony/user-bundle/2.1/config/routes/fos_user.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
fos_user_security: | ||
resource: "@FOSUserBundle/Resources/config/routing/security.xml" | ||
|
||
fos_user_profile: | ||
resource: "@FOSUserBundle/Resources/config/routing/profile.xml" | ||
prefix: /profile | ||
|
||
fos_user_register: | ||
resource: "@FOSUserBundle/Resources/config/routing/registration.xml" | ||
prefix: /register | ||
|
||
fos_user_resetting: | ||
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" | ||
prefix: /resetting | ||
|
||
fos_user_change_password: | ||
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" | ||
prefix: /profile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"bundles": { | ||
"FOS\\UserBundle\\FOSUserBundle": ["all"] | ||
}, | ||
"copy-from-recipe": { | ||
"config/": "%CONFIG_DIR%/", | ||
"src/": "%SRC_DIR%/" | ||
}, | ||
"env": { | ||
"MAILER_SENDER_ADDRESS": "[email protected]", | ||
"MAILER_SENDER_NAME": "John Doe" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<bg=blue;fg=white> </> | ||
<bg=blue;fg=white> What's next? </> | ||
<bg=blue;fg=white> </> | ||
|
||
- If not, install a driver storage and change it in <fg=green>config/packages/fos_user.yaml</> | ||
|
||
- Modify your email address config in <fg=green>.env</> | ||
|
||
- Uncomment <fg=green>csrf_protection</> and make sure <fg=green>twig engine</> is turned on by adding in <fg=green>config/packages/framework.yaml</>: | ||
|
||
framework: | ||
# ... | ||
csrf_protection: true | ||
templating: | ||
engines: ['twig'] | ||
|
||
- Create your User class | ||
https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-3-create-your-user-class | ||
|
||
- Modify your security configuration in <fg=green>config/packages/security.yaml</> | ||
https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use FOS\UserBundle\Model\User as BaseUser; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ORM\Table(name="fos_user") | ||
*/ | ||
class User extends BaseUser | ||
{ | ||
/** | ||
* @ORM\Column(type="integer") | ||
* @ORM\Id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you switch order with line above please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entity is maybe going to disappear because it's a doctrine orm entity and not mongo or couchdb |
||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
protected $id; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
// your own logic | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you didn't load the routes like that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People may not need every routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it seems good to me 👍
I can not wait to see this merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me too I hope this PR FriendsOfSymfony/FOSUserBundle#2708 will be merged soon