2014年9月15日月曜日

<?php
function myloader($classname) {
    return @include str_replace('_', DIRECTORY_SEPARATOR, $classname).'.php';
}
spl_autoload_register('myloader');

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    APPLICATION_PATH."/models",
    get_include_path(),
)));
// 年月日文字列の定義(ログファイル名に使用)
define('DATESTAMP', Date('Y-m-d'));
//require_once 'Zend/Loader/Autoloader.php';
$al=  Zend_Loader_Autoloader::getInstance();
$al->setFallbackAutoloader(true);
$al->registerNamespace('Oni_');


$cachefile = APPLICATION_PATH . '/../data/cache/plugins.php';
if (file_exists($cachefile)) {
    include_once $cachefile;
}
Zend_Loader_PluginLoader::setIncludeFileCache($cachefile);

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);

$application->bootstrap()
            ->run();

0 件のコメント: