Symfony Plugin – sfGuardDoctrine
For the most part, the README file associated to this plugin is fairly straight forward, and should be followed. This post is here to demonstrate an install method you can do manually and not have to re-load all of your data and loading fixtures.
–Update 4.9.10 –
I removed some sections from this post b/c they were deprecated. Also, check out http://trac.symfony-project.org/wiki/sfGuardPluginExtraDocumentation as it has a lot of useful information beyond the README.txt file.
This step will use your config/doctrine/schema.yml file and create a sql file you can use for creating the schema in your database.
php symfony doctrine:build-sql
Now we are at the step that caused us to do everything the hard way (manual). If you follow the README file associated /w a plugin it will tell you to run ‘symfony doctrine:insert-sql’. If you do this you are basically wiping out any data you have in your database b/c the tables will be re-created.
Instead of wiping out existing data we are going to copy everything we want out of the data/sql/schema.sql file and put them into a data/sql/sfGuardDoctrine.sql file. This way when you import the schema to your database you will not wipe out your existing data.
touch data/sql/sfGuardDoctrine.sql vi data/sql/schema.sql
Copy all sf_guard_* table references.
Paste all copied data and save file. Now you are going to import the sfGuardDoctrine schema into your database:
mysql -h <db_host> -u <db_user> -p <db_name> < data/sql/sfGuardDoctrine.sql
If the command ran successfully then you should be able to connect to your database and see the new sf_guard_* tables in place.
Add User via CLI
./symfony guard:create-user <username> <password>
You should be able to finish up the setup of this plugin by referring to the plugins/sfDoctrineGuardPlugin/README file or the link posted earlier.
- Symfony – Share Template Across Multiple Apps
- PHP – Symfony – Speed up CLI Commands – Do Not Load Web Plugins
- PHP – Symfony – Build Model – No yml schema found
- Symfony – Propel – Determine Propel Version
- Symfony – Doctrine – Call to a member function evictAll on a non-object
- Symfony – Standard API for Logging Using __callStatic
- Symfony – Symfony 2 Security Audit Results
- Symfony – Serve External Apis from External Hosts – jQuery – Yui
- Symfony – sfGuardPlugin – Use Email Instead of Username
- Symfony – PHP – Possibly Forking 1.x so Invested Companies don’t Lose Millions