Version 1 by Andrew Stephanoff
on Nov 19, 2010 12:29.

compared with
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (27)

View Page History

Zend_Magic Zend_Application_Bootstrap_BootstrapAbstract

[My Name|]
[Andrew Stephanoff|]

Zend_Magic is a simple component that reads my mind and generates code dynamically to do what I want.
Patch for Bootstrap which allow to provide plugins cache before bootstrap starting.

* [Harry Houdini Wikipedia Entry|]
* [|]
* [Getting Better Performance for Plugins|]

Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

* This component *will* correctly reads a developers mind for intent and generate the right configuration file.
* The generated config file *will not* support XML, but will provide an extension point in the API.
* This component *will* use no more memory than twice the size of all data it contains.
* This component *will* include a factory method.
* This component *will not* allow subclassing. (i.e. when reviewed, we expect to see "final" keyword in code)
* This component *will* only generate data exports strictly complying with RFC 12345.
* This component *will* validate input data against formats supported by ZF component Foo.
* This component *will not* save any data using Zend_Cache or the filesystem. All transient data *will be* saved using Zend_Session.
No requirements

* Zend_Exception Zend_Loader_PluginLoader

The component is instantiated with a mind-link that ...
This patch is allow to setup cache filename for plugins in configuration file.

Describe some intermediate state of this component in terms of design notes, additional material added to this page, and / code. Note any significant dependencies here, such as, "Milestone #3 can not be completed until feature Foo has been added to ZF component XYZ." Milestones will be required for acceptance of future proposals. They are not hard, and many times you will only need to think of the first three below.
* Milestone 1: [design notes will be published here|]
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
* Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.

If a milestone is already done, begin the description with "\[DONE\]", like this:
* Milestone #: \[DONE\] Unit tests ...
Not defined

* Zend_Magic_Exception Zend_Application_Bootstrap_BootstrapAbstract
* Zend_Magic (factory class)
* Zend_Magic_MindProbe
* Zend_Magic_MindProbe_Intent
* Zend_Magic_Action
* Zend_Magic_CodeGen


... (see good use cases book)
pluginCache = "path/to/pluginCache/filename.php"


Patch for Zend_Application_Bootstrap_BootstrapAbstract
class Zend_Magic_Exception extends Zend_Exception {}
Index: library/Zend/Application/Bootstrap/BootstrapAbstract.php
class Zend_Magic {
--- library/Zend/Application/Bootstrap/BootstrapAbstract.php (revision 23390)
+++ library/Zend/Application/Bootstrap/BootstrapAbstract.php (working copy)
@@ -122,6 +122,18 @@
$methods[$key] = strtolower($method);
+ if (array_key_exists('plugincache', $options)) {
+ $filename = $options['plugincache'];
+ if (is_readable($filename)) {
+ include $filename;
+ }
+ if (is_writable($filename)
+ || (!file_exists($filename) && is_writable(dirname($filename))))
+ {
+ Zend_Loader_PluginLoader::setIncludeFileCache($filename);
+ }
+ }
if (array_key_exists('pluginpaths', $options)) {
$pluginLoader = $this->getPluginLoader();