Details
-
Type:
Patch
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.9.6
-
Fix Version/s: None
-
Component/s: Zend_Application
-
Labels:None
-
Tags:
Description
I have created a patch that allows to configure classResources same as plugins.
Options can be set via the resources configuration, where classResource also can be disabled.
Like:
Bootstrap.php
Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initCache() { $file = $this->getOption('defaultcachedir'). 'pluginLoaderCache.php'; if (file_exists($file)) { include_once $file; } if ($this->getOption('plugin')) { Zend_Loader_PluginLoader::setIncludeFileCache($file); } } protected function _initSession() { $session = new Zend_Session_Namespace( $this->getOption('name') ); Zend_Registry::set( 'session', $session ); if (!isset($session->initialized)) { Zend_Session::regenerateId(); $session->initialized = true; } } }
With this config:
<?xml version="1.0"?> <config xmlns:zf="http://framework.zend.com/xml/zend-config-xml/1.0/"> <production> <bootstrap> <path><zf:const zf:name="APPLICATION_PATH"/>/bootstrap.php</path> <class>Bootstrap</class> </bootstrap> <phpSettings> <display_startup_errors>0</display_startup_errors> <display_errors>0</display_errors> </phpSettings> <resources> <frontController> <controllerDirectory><zf:const zf:name="APPLICATION_PATH"/>/default/controllers</controllerDirectory> <base_url>http://zf.dev</base_url> </frontController> <db> <adapter>PDO_MYSQL</adapter> <params> <host >localhost</host> <username >root</username> <password >passw</password> <dbname >zf</dbname> </params> <isDefaultTableAdapter>true</isDefaultTableAdapter> </db> <cache> <defaultcachedir><zf:const zf:name="APPLICATION_PATH"/>/../data/cache/</defaultcachedir> <plugin>1</plugin><!-- sets plugin loading --> <disabled/><!-- disables whole resource from loading --> </cache> <session> <name>Naam</name> </session> </resources> </production> </config>
Where _initCache will not be called.
Attachments
Issue Links
| This issue is related to: | ||||
| ZF-7742 | getOption not working with uppercase $key |
|
|
|
I like it
Only thing i dont get: Cache and Session are available Resource Plugins, why not only use this?
But the Disable feature is nice, would like to see this for Res-Plug-Ins too.