Exemplo n.º 1
0
/**
 * путь до корневой директории
 */
$projectRoot = '/home/sites/balancer1.lj-top.ru/';
/**
 * Управляем кешом уровня nginx сразу - в случае любой ошибки, кеширование отключено.
 * Заголовок кеширования со временем отправляется при выводе в браузер, иначе - 0
 */
header('X-Accel-Expires: 0');
/**
 * Уровень ошибок
 */
error_reporting(E_ALL);
ini_set('display_errors', 1);
/**
 * Загружаем настройки проекта
 */
$configuration = (require_once $projectRoot . 'configs' . DIRECTORY_SEPARATOR . 'main.php');
/**
 * Autoloader
 */
require_once $projectRoot . 'lib' . DIRECTORY_SEPARATOR . 'AutoLoader.php';
AutoLoader::init($projectRoot, $configuration['includePathes']);
/**
 * Инициализируем приложение по загруженному конфигу
 */
$application = new \Application\Web($configuration);
/**
 * Запускаем приложение
 */
$application->run();
Exemplo n.º 2
0
    ini_set('display_errors', $config['phpErrorReporting']['displayErrors']);
}
if (isset($config['phpErrorReporting']['errorReportingValue'])) {
    error_reporting($config['phpErrorReporting']['errorReportingValue']);
}
if (isset($config['phpErrorReporting']['logErrors'])) {
    ini_set('log_errors', $config['phpErrorReporting']['logErrors']);
}
if (isset($config['phpErrorReporting']['errorLogFile'])) {
    if ($config['phpErrorReporting']['errorLogFile'] != '') {
        ini_set('error_log', $config['phpErrorReporting']['errorLogFile']);
    }
}
// Load and initialize the AutoLoader class
require_once APPLICATION_ROOT . 'system/core/library/AutoLoader.php';
AutoLoader::init();
// Start the InvokeConfig mechanism
InvokeConfig::init();
// Set the timezone
if (function_exists("date_default_timezone_set")) {
    if (isset($config['timezone'])) {
        date_default_timezone_set($config['timezone']);
    } else {
        date_default_timezone_set('Europe/Berlin');
    }
}
// Set up the FileUtils-library
if (isset($config['fileUtils'])) {
    FileUtils::setChmodSettings($config['fileUtils']['useChmod'], $config['fileUtils']['directoryMode'], $config['fileUtils']['fileMode']);
}
// delete the global variable $config