ZF-Commons / ZfcUser

A generic user registration and authentication module for ZF2. Supports Zend\Db and Doctrine2. (Formerly EdpUser)
BSD 3-Clause "New" or "Revised" License
495 stars 343 forks source link

Installation fails #42

Closed markushausammann closed 12 years ago

markushausammann commented 12 years ago

I do the following:

I get this error:

Catchable fatal error: Argument 2 passed to Zend\Db\TableGateway\TableGateway::__construct() must be an instance of Zend\Db\Adapter\Adapter, instance of PDO given in C:\htdocs\zf2-skeleton\vendor\ZendFramework\library\Zend\Db\TableGateway\TableGateway.php on line 100
mtudor commented 12 years ago

Hi Markus,

I think the installation instructions are incorrect - I had the same issue as you but it seems that leaving out this step:

and instead leaving that line as:

  'zend_db_adapter' => 'Zend\Db\Adapter\Adapter',

does the trick.

Perhaps one of the devs might confirm if this is the correct way to proceed, as I'm actually experiencing other problems with ZfcUser refusing to authenticate I'll open a separate issue for that one though.

gurpreetbhatoa commented 12 years ago

I was getting an exception in the DI layer for wrong parameter name

Uncaught exception 'Zend\Di\Exception\MissingPropertyException' with message 'Missing instance/object for parameter tableName for Zend\Db\TableGateway\TableGateway::__construct' in /mnt/git/ZendSkeletonApplication/vendor/ZendFramework/library/Zend/Di/Di.php:617

To fix this I corrected the parameter name in module.config.php for ZfcUser. Corrected from

'zfcuser_user_tg' => array( 'parameters' => array( 'table' => 'user', 'adapter' => 'zfcuser_zend_db_adapter', ), ), 'zfcuser_usermeta_tg' => array( 'parameters' => array( 'table' => 'user_meta', 'adapter' => 'zfcuser_zend_db_adapter', ), ),

to

'zfcuser_user_tg' => array( 'parameters' => array( 'tableName' => 'user', 'adapter' => 'zfcuser_zend_db_adapter', ), ), 'zfcuser_usermeta_tg' => array( 'parameters' => array( 'tableName' => 'user_meta', 'adapter' => 'zfcuser_zend_db_adapter', ), ),

table => corrected to tableName

adamlundrigan commented 12 years ago

@gurpreetbhatoa you are encountering issue #51. This has been fixed in the latest ZendSkeletonApplication.

EvanDotPro commented 12 years ago

I believe this is now resolved. Please re-open this issue if this is not the case.