westdc-zf1/public/index.php

32 lines
948 B
PHP
Raw Normal View History

<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
date_default_timezone_set('Asia/Shanghai');
define('APPLICATION_PATH',dirname(__DIR__));
chdir(APPLICATION_PATH);
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}
// Register Auto Loader
include_once("init_autoloader.php");
$loader = new Zend\Loader\StandardAutoloader(array(
'autoregister_zf' => true,
'namespaces' => array(
'Sookon' => APPLICATION_PATH . '/vendor/Sookon',
'Westdc' => APPLICATION_PATH . "/vendor/Westdc"
),
'fallback_autoloader' => true,
));
// Register with spl_autoload:
$loader->register();
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();