The good thing about the Zend structure is that it is very modular, you can use almost any part of it without taking it all.
For example, we can use Zend_Loader_Autoloader to configure class autoload without using Zend_Application
First, make sure the Zend library is in your inclusion path:
set_include_path('/path/to/zend/' . PATH_SEPARATOR . get_include_path());
Then the Autoloader class is required:
require_once 'Zend/Loader/Autoloader.php';
Then we install the autoloader:
// instantiate the loader $loader = Zend_Loader_Autoloader::getInstance(); // specify class namespaces you want to be auto-loaded. // 'Zend_' and 'ZendX_' are included by default $loader->registerNamespace('My_App_'); // optional argument if you want the auto-loader to load ALL namespaces $loader->setFallbackAutoloader(true);
Once the autoloader is configured (preferably in bootstrap or something else), you can call the Zend environment classes (or your own application classes) without the need for their individual use:
$foo = new Zend_Library_Class(); $bar = new My_App_Class();
Read more about this in the documentation.
Bryan M.
source share