Strip require_once from Zend Framework
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
