Skip to content

Instantly share code, notes, and snippets.

@padraic
Created February 25, 2010 14:43
Show Gist options
  • Save padraic/314585 to your computer and use it in GitHub Desktop.
Save padraic/314585 to your computer and use it in GitHub Desktop.
<?php
$preloads = array(
// from get_declared_classes()
'Zend_Controller_Front',
'Zend_Controller_Plugin_Abstract',
'Zend_Controller_Plugin_Broker',
'Zend_Controller_Router_Abstract',
'Zend_Controller_Router_Rewrite',
'Zend_Controller_Router_Route_Abstract',
'Zend_Controller_Router_Route',
'Zend_Controller_Router_Route_Static',
'Zend_Controller_Dispatcher_Abstract',
'Zend_Controller_Dispatcher_Standard',
'Zend_Controller_Plugin_ErrorHandler',
'Zend_Controller_Request_Abstract',
'Zend_Controller_Request_Http',
'Zend_Controller_Response_Abstract',
'Zend_Controller_Response_Http',
'Zend_Controller_Router_Route_Module',
'Zend_Loader',
'Zend_Controller_Action',
'Zend_Controller_Action_HelperBroker',
'Zend_Controller_Action_HelperBroker_PriorityStack',
'Zend_View_Abstract',
'Zend_View',
'Zend_View_Stream',
'Zend_Loader_PluginLoader',
// from get_declared_interfaces()
'Zend_Controller_Router_Interface',
'Zend_Controller_Router_Route_Interface',
'Zend_Controller_Dispatcher_Interface',
'Zend_Controller_Action_Interface',
'Zend_View_Interface',
'Zend_Loader_PluginLoader_Interface'
);
$zfPath = '../library';
$preloadContent = '<?php' . PHP_EOL;
foreach($preloads as $preload) {
$content = file_get_contents(
$zfPath . '/' . str_replace('_','/',$preload) . '.php'
);
$content = str_replace('<?php', '', $content) . PHP_EOL;
$preloadContent .= $content;
}
file_put_contents('preload.php', $preloadContent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment