jmfiaschi / RbacUserDoctrineOrm

joins the zfc-rbac and zfc-user modules together in a doctrine orm module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ORM based RbacUser module for ZF 2

RbacUserDoctrineOrm offers a module that combines ZfcRbac & ZfcUser together with the Doctrine Orm module from ZF2 so that you can focus on getting started.

Requirements & their dependencies

Installation

Installation of RbacUserDoctrineOrm uses composer. For composer documentation, please refer to getcomposer.org.

Installation steps

  1. cd my/project/directory

  2. create a composer.json file with following contents:

    {
        "require": {
            "esserj/zfc-rbac-user-doctrine-orm": "dev-master"
        }
    }
  3. install composer via curl -s http://getcomposer.org/installer | php (on windows, download http://getcomposer.org/installer and execute it with PHP)

  4. run php composer.phar install

  5. open my/project/directory/configs/application.config.php and add the following to your modules key:

       'DoctrineModule',
       'DoctrineORMModule',
       'DoctrineDataFixtureModule',
       'ZfcBase',
       'ZfcRbac',
       'ZfcUser',
       'ZfcUserDoctrineORM',
       'RbacUserDoctrineOrm',
  6. 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
                   )
               )
           )
       )
```
  1. 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.

  1. see the ZfcUser & ZfcRbac pages for controller/view plugins to get started

About

joins the zfc-rbac and zfc-user modules together in a doctrine orm module


Languages

Language:PHP 71.8%Language:SQL 28.2%