Example #1
0
<?php

/**
 * Входной скрипт index:
 *
 * @category YupeScript
 * @package  YupeCMS
 * @author   Yupe Team <*****@*****.**>
 * @license  https://github.com/yupe/yupe/blob/master/LICENSE BSD
 * @link     http://yupe.ru
 **/
// подробнее про index.php http://www.yiiframework.ru/doc/guide/ru/basics.entry
if (!ini_get('date.timezone')) {
    date_default_timezone_set('Europe/Moscow');
}
// Setting internal encoding to UTF-8.
if (!ini_get('mbstring.internal_encoding')) {
    @ini_set("mbstring.internal_encoding", 'UTF-8');
    mb_internal_encoding('UTF-8');
}
// две строки закомментировать на продакшн сервере
define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require __DIR__ . '/../vendor/yiisoft/yii/framework/yii.php';
$base = (require __DIR__ . '/../protected/config/main.php');
$confManager = new yupe\components\ConfigManager();
$confManager->sentEnv(\yupe\components\ConfigManager::ENV_WEB);
require __DIR__ . '/../vendor/autoload.php';
Yii::createWebApplication($confManager->merge($base))->run();
Example #2
0
 **/
// подробнее про index.php http://www.yiiframework.ru/doc/guide/ru/basics.entry
ob_start("ob_gzhandler");
if (!ini_get('date.timezone')) {
    date_default_timezone_set('Europe/Moscow');
}
$development = isset($_SERVER['SERVER_ADDR']) ? strpos($_SERVER['SERVER_ADDR'], '127') === 0 : $_SERVER['SERVER_NAME'] == 'localhost';
// Выбираем конфигурацию development-main.php, если сайт работает на localhost
if ($development || defined('APPLICATION_ENV') || getenv('APPLICATION_ENV') !== false) {
    // Комментируем перед выпуском в продакшен:
    // в режиме разработки необходимо демонстрировать все ошибки
    // независимо от среды
    ini_set('display_errors', 'On');
    define('YII_DEBUG', true);
    defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
    // путь к фреймворку Yii
    $yii = dirname(__FILE__) . '/../../vendor/yiisoft/yii/framework/yii.php';
} else {
    //production считается во всех случаях, когда не выполнены условия
    // путь к фреймворку Yii, при необходимости заменить на yii.php
    $yii = dirname(__FILE__) . '/../../vendor/yiisoft/yii/framework/yiilite.php';
    // путь к основному конфигурационному файлу Yii
}
require $yii;
$base = (require dirname(__FILE__) . '/../protected/config/main.php');
$userspace = dirname(__FILE__) . '/../protected/config/userspace.php';
$userspace = file_exists($userspace) ? require $userspace : array();
$confManager = new yupe\components\ConfigManager();
$config = $confManager->merge($base, $userspace);
require dirname(__FILE__) . '/../../vendor/autoload.php';
Yii::createWebApplication($config)->run();
Example #3
0
<?php

require dirname(__FILE__) . '/../vendor/autoload.php';
$yiic = (require dirname(__FILE__) . '/../vendor/yiisoft/yii/framework/yii.php');
$config = (require dirname(__FILE__) . '/config/console.php');
$configManager = new yupe\components\ConfigManager();
$configManager->sentEnv(\yupe\components\ConfigManager::ENV_CONSOLE);
$app = \Yii::createConsoleApplication($configManager->merge($config));
$app->commandRunner->addCommands(YII_PATH . '/cli/commands');
$app->run();
Example #4
0
<?php

/**
 * Входной скрипт index:
 * 
 *   @category YupeScript
 *   @package  YupeCMS
 *   @author   Yupe Team <*****@*****.**>
 *   @license  https://github.com/yupe/yupe/blob/master/LICENSE BSD
 *   @link     http://yupe.ru
 **/
// подробнее про index.php http://www.yiiframework.ru/doc/guide/ru/basics.entry
if (!ini_get('date.timezone')) {
    date_default_timezone_set('Europe/Moscow');
}
// Setting internal encoding to UTF-8.
if (!ini_get('mbstring.internal_encoding')) {
    @ini_set("mbstring.internal_encoding", 'UTF-8');
    mb_internal_encoding('UTF-8');
}
define('YII_APP_TYPE', 'web');
// две строки закомментировать на продакшн сервере
define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require dirname(__FILE__) . '/../vendor/yiisoft/yii/framework/yii.php';
$base = (require dirname(__FILE__) . '/../protected/config/main.php');
$confManager = new yupe\components\ConfigManager();
$config = $confManager->merge($base);
require dirname(__FILE__) . '/../vendor/autoload.php';
Yii::createWebApplication($config)->run();
Example #5
0
<?php

/**
 * Входной скрипт index:
 * 
 *   @category YupeScript
 *   @package  YupeCMS
 *   @author   Yupe Team <*****@*****.**>
 *   @license  https://github.com/yupe/yupe/blob/master/LICENSE BSD
 *   @link     http://yupe.ru
 **/
// подробнее про index.php http://www.yiiframework.ru/doc/guide/ru/basics.entry
if (!ini_get('date.timezone')) {
    date_default_timezone_set('Europe/Moscow');
}
// две строки закомментировать на продакшн сервере
define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require dirname(__FILE__) . '/../vendor/yiisoft/yii/framework/yii.php';
$base = (require dirname(__FILE__) . '/../protected/config/main.php');
$confManager = new yupe\components\ConfigManager();
require dirname(__FILE__) . '/../vendor/autoload.php';
Yii::createWebApplication($confManager->merge($base))->run();