Skip Navigation LinksHome > Categories > Code from a Category

Accelerate Zend_View!

User Name: serfcompany
Name: Serf
Contact Me:
Home Page:
php,mysql,javascript,html,css. Preferable working with Zend Framework. Good know javascript. I worked with various, javascript frameworks such as(jquery, YUI3, extjs, sencha touch). [More]
Viewed Times: 2079
Add Date: 06/20/2012
This is a small tip on accelerating Zend_View. Information taken from a manual Zend Framework - it decided to replicate and explain in more detail, because few people pay attention to this information.

To speed up your application form, built on Zend Framework should be in your bootstrap to create a function that will use the cache files being PluginLoader'a.

Zend_View is structured so that the connection of his assistants, and other software components - a very resource-intensive task. Each time it processes a directory assistants, examines the way for them based on the name of the requested class (remember the ZF directory structure and how a class name). Still, it checks whether the class is one file that defined the engine, if not, an error message is added to the stack of PHP.

Such a "jog" in each prefix, the prefix in each folder, find the file that matches caused by the class and also check for the existence in it of the expected class - leads to the fact that performs multiple monotone operations which, in fact, should be performed only once after the update the list of helpers. All this is very, very long time ...

But the developers found a way out. They did a cache plug-helpers, added check for required class load. If the class is already connected - excellent, yuzaem. If the class is not loaded - then it should connect and the file that is defined by the most demanding methods - adding to the file cache and the next time we will avoid the pitfalls procedure file.

As a result, the task is much simpler. When you load the form, assistants are connected from the file cache and do not have to mean more to deal with failures and test directories.

You will laugh, but the inclusion of such a good functional takes only a few lines. I suggest you look at the function code, which you will need to call in your bootstrap:

Once you have your little popolzuetes resource by calling this function, your file cache is full paths to files, which will connect in advance to avoid unnecessary mistakes and passes through the folders.

You should get something like this cache file:

Thank you for your attention. As always, I hope that was helpful with his material.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.