Search code examples
phpauthenticationdoctrine-ormzend-framework2zfcuser

Zend Framework 2 - ZFCUser module installation


I need an authentication module for my ZF2 project.

ZFCUser seems to be good and I installed it sucessfully. But now I'm a bit lost due to the lack of any further documentation (or I just don't know where to look for it).

1) I want to include ZFCUser-DoctrineORM but the readme says basically the name of the module and that's it. What do I have to do to get this working?

After trying for some time I found the login page under the URL /user/ and a code snippet which shows how to include the form on another page.

2) But how do I eg make login required for all my other pages or modules?


Solution

  • Question 1

    Alright, figured it out now... it's actually pretty easy!

    composer.json

    "zf-commons/zfc-user-doctrine-orm": "dev-master"
    

    Run

    php composer.phar update
    

    Add app under application.config

    'ZfcUserDoctrineORM'
    

    Run Doctrine CLI

    doctrine-module orm:schema-tool:update --force
    

    Question 2

    Here are the options for checking the login state.