You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
i have tried to use piwik in a zend framework project so i have copy the example on the [Calling the API From within PHP](http://dev.piwik.org/trac/wiki/API/CallingTechniques) page and paste it in a zf controller
after hacking the include_path to avoid ‘cannot redeclare class exception’ (see #631)
then i got the following error :
```
Fatal error: Call to undefined method Zend_Db_Adapter_Pdo_Mysql::resetConfigArray() in D:\WORK\SITESWEB\JC2\SRC\lib\piwik\core\Piwik.php on line 1184
Matthieu said on the forum that’s because resetConfigArray() is a custom method from piwik, but now the classes are added from the standart library used for the whole project.
i suggest any custom method like this one to be moove in new classes extending the original classes (eg Zenwik_Db_Adpater)
while looking at this i also noticed that piwik is using Zend_Registry to store data throw the process.
Any user using already zf will surely use Zend_Registry too so every entry in it should be prefixed to avoid scope issue
Adding resetConfigArray() to Zend_Db_Adapter_Abstract is much cleaner/simpler than subclassing all the adapters and changing the factory to use our subclassed adapters. I'll add a method_exists() check.
In [1465], fixes #632 - move local mods to subclassed ZF classes; the duplication in Db/Mysqli.php and Db/Pdo/Mysql.php is unavoidable because PHP doesn't support multiple inheritance
i have tried to use piwik in a zend framework project so i have copy the example on the [Calling the API From within PHP](http://dev.piwik.org/trac/wiki/API/CallingTechniques) page and paste it in a zf controller
after hacking the include_path to avoid ‘cannot redeclare class exception’ (see #631)
then i got the following error :
```
Fatal error: Call to undefined method Zend_Db_Adapter_Pdo_Mysql::resetConfigArray() in D:\WORK\SITES WEB\JC2\SRC\lib\piwik\core\Piwik.php on line 1184
—> Piwik::createDatabaseObject( ) ..\FrontController.php:234
```
Matthieu said on the forum that’s because resetConfigArray() is a custom method from piwik, but now the classes are added from the standart library used for the whole project.
i suggest any custom method like this one to be moove in new classes extending the original classes (eg Zenwik_Db_Adpater)
while looking at this i also noticed that piwik is using Zend_Registry to store data throw the process.
Any user using already zf will surely use Zend_Registry too so every entry in it should be prefixed to avoid scope issue
```
Zend_Registry::set(‘piwik_config’,$config)
```
maybe something similar should be done for zend_session and zend_auth
PS : maybe same pb can happen with other third party librarys (smarty is used a lot too …)
The text was updated successfully, but these errors were encountered: