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: Argument 2 passed to TableGateway::__construct() #46

Closed kander-zz closed 12 years ago

kander-zz commented 12 years ago

After following the installation instructions, I get an exception:

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 
<my document root>/zfskeleton/vendor/ZendFramework/library/Zend/Db/TableGateway/TableGateway.php on line 100

I probably don't understand correctly how this is supposed to work, but I'm wondering why the 'dbmaster' alias should point to the PDO class. I've tried making it point to the Zend\Db\Adapter\Adapter class instead, but that results in a circular reference.

How to reproduce:

 git clone --recursive git://github.com/zendframework/ZendSkeletonApplication.git zfskeleton
cd zfskeleton/vendor
git clone https://github.com/ZF-Commons/ZfcBase.git
git clone https://github.com/ZF-Commons/ZfcUser.git
Add "ZfcBase" and "ZfcUser" to the modules array in configs/application.config.php
cd ..
cp ./vendor/ZfcUser/config/module.zfcuser.config.php.dist ./config/autoload/module.zfcuser.config.php
Copy the database config block to ./config/autoload/database.config.php , replace the CHANGEME blocks with real settings.
Remove comment in front of line 15 of module.zfcuser.config.php, change alias to 'dbmaster'.
mtudor commented 12 years ago

Hi Kander,

See my comment on #42. I'm not sure if it's the correct solution, but it works ;) Incorrect installation instructions I think.

Mark.

kander-zz commented 12 years ago

Mark - your solution does indeed work for me. Thanks!

mtudor commented 12 years ago

Hi Kander,

Can you let me know if you hit the issues in #43 and #44?

If you do, that's three people who've hit it now. I might have a poke and see what I can find about what's causing it if we've confirmed it that many times!

Mark.

adamlundrigan commented 12 years ago

Duplicate of #42

EvanDotPro commented 12 years ago

This should be resolved now. See the updated readme instructions.