Skip to content

Instantly share code, notes, and snippets.

@jakemcgraw
Created March 19, 2010 22:43
Show Gist options
  • Save jakemcgraw/338279 to your computer and use it in GitHub Desktop.
Save jakemcgraw/338279 to your computer and use it in GitHub Desktop.
<?php
/**
* Zend_Application, Zend_Loader, Zend_Loader_* and Zend_Exception require
* a 'hard coded' path. We've set up a special copy of the Zend Framework at:
*
* /usr/share/php/ZendFrameworkLoader/library
*
* This prevents the autoloader from confusingly loading the incorrect version
* of a given file.
*/
set_include_path(
implode(PATH_SEPARATOR, array(
'/usr/share/php/ZendFrameworkLoader/library',
// PHP Pear
'/usr/share/pear',
// PHP classes
'/usr/share/php',
// CWD
'.'
))
);
// Load up resources from ZendFrameworkLoader
require_once 'Zend/Application.php';
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
if (!defined('ZEND_FRAMEWORK_VERSION')) {
define('ZEND_FRAMEWORK_VERSION', 'latest');
}
// Dynamically set the Zend Framework version
$autoloader->setZfPath('/usr/share/php/ZendFramework', ZEND_FRAMEWORK_VERSION);
// Let our custom autoloader know which namespaces to autoload
$autoloader->registerNamespace(array('My_'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment