RbacUserDoctrineOrm offers a module that combines ZfcRbac & ZfcUser together with the Doctrine Orm module from ZF2 so that you can focus on getting started.
- PHP 5.3 or higher
- Zend Framework 2
- ZfcRbac
- ZfcUserDoctrineOrm
Installation of RbacUserDoctrineOrm uses composer. For composer documentation, please refer to getcomposer.org.
-
cd my/project/directory
-
create a
composer.json
file with following contents:{ "require": { "esserj/zfc-rbac-user-doctrine-orm": "dev-master" } }
-
install composer via
curl -s http://getcomposer.org/installer | php
(on windows, download http://getcomposer.org/installer and execute it with PHP) -
run
php composer.phar install
-
open
my/project/directory/configs/application.config.php
and add the following to yourmodules
key:'DoctrineModule', 'DoctrineORMModule', 'DoctrineDataFixtureModule', 'ZfcBase', 'ZfcRbac', 'ZfcUser', 'ZfcUserDoctrineORM', 'RbacUserDoctrineOrm',
-
setup doctrine database parameters by adding the following to your
my/project/config/autoload/local.php
:'doctrine' => array( 'connection' => array( // default connection name 'orm_default' => array( 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', 'params' => array( 'host' => 'localhost', 'port' => '3306', 'user' => '', //put your user here 'password' => '', //put your pass here 'dbname' => '', //put your database here ) ) ) )
```
- Install or Update database
To install database run this commande :
.\vendor\bin\doctrine-module orm:clear-cache:metadata
.\vendor\bin\doctrine-module orm:schema-tool:create
To update database run this commande : ```php .\vendor\bin\doctrine-module orm:schema-tool:update --force
8. Load data in your database with Doctrine fixtures
Run this commande line to load data
```php
.\vendor\bin\doctrine-module data-fixture:import
This commande add the guest role. You can create your own fixture to load data in your bdd.
- see the ZfcUser & ZfcRbac pages for controller/view plugins to get started