Will creates nice web-things, builds awesome ideas, and collaborates with other creative types.

Home > Blog > Strip require_once from Zend Framework

Strip require_once from Zend Framework

by Will on Oct 24th 2010, 20:57

Zend Framework has require_once statements throughout the library.

These are not needed if using the auto loader that most Zend Framework applications use and have a significant negative performance effect. To strip these statements out of all the files except the/Loader/Autoloader.php file a command line statement is required. The instructions given in the Zend Framework Documentation assume GNU versions of find and sed and so do not work in terminal on OSX. Use the following code to comment out the statements and remove the resulting backups.

Show Plain Text
% cd path/to/ZendFramework/library % find . -name '*.php' | grep -v './Loader/Autoloader.php' | \ xargs sed -E -i~ 's/(require_once)/\/\/ \1/g' % find . -name '*.php~' | xargs rm -f

Strip require_once from Zend Framework zend framework zf php

blog comments powered by Disqus