ZF-8888: Missing requires in Zend_Application_Resource_*
Description
In the classes Zend_Application_Resource_Db Zend_Application_Resource_Dojo Zend_Application_Resource_Frontcontroller Zend_Application_Resource_Layout Zend_Application_Resource_Locale Zend_Application_Resource_Log Zend_Application_Resource_Modules Zend_Application_Resource_Navigation Zend_Application_Resource_Router Zend_Application_Resource_Session Zend_Application_Resource_Translate Zend_Application_Resource_View
which extend Zend_Application_Resource_ResourceAbstract is the require of the dependent class at the beginning of the class missing.
It should be: require_once 'Zend/Application/Resource/ResourceAbstract.php';
In the classes Zend_Application_Resource_Cachemanager Zend_Application_Resource_Mail Zend_Application_Resource_Multidb the require is set correctly.
Normally it works without the requires, but an error occurs, if you use "Zend_Loader_PluginLoader". I tried to add them, then the error was gone.
Comments
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-01-30T17:40:51.000+0000
Can you please provide a usecase in which you use the resource plugins outside of Zend_App? These Resource Plugins are meant to be used in conjunction with Zend_App, and then it all works fine.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-02-01T12:14:54.000+0000
Added for consistency. Please note that they may be removed when Zend_App turns 100% dependent on autoloading (that will only occur with a major release).
Posted by Master Surfer (mastersurfer84) on 2010-02-02T10:42:07.000+0000
I didn't use the resource plugins outside Zend_App. I added the following part to the application.ini:
resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.stream = APPLICATION_PATH "/../data/logs/application.log" resources.log.stream.writerParams.mode = "a+" resources.log.stream.filterName = "Priority" resources.log.stream.filterParams.priority = 5
and in the index.php the loader-cache:
require_once 'Zend/Loader/PluginLoader.php'; $classFileIncCache = realpath(APPLICATION_PATH . '/../data/cache') . DIRECTORY_SEPARATOR . 'LoaderCache.php'; if (file_exists($classFileIncCache)) { include_once $classFileIncCache; } Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
in this constellation the described problem occurs.
thanks for adding the requires.