From d445c40e5de92fd612d97c56ee61e2327806f424 Mon Sep 17 00:00:00 2001 From: tatarinov Date: Thu, 5 May 2016 13:23:42 +0300 Subject: [PATCH] =?UTF-8?q?Bug=20#208:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=B1=D0=B0=D0=B3=20=D0=B2=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5=20production?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/index.php | 6 ++--- backend/protected/tests/bootstrap.php | 6 ++--- index.php | 2 +- protected/config/console.php | 24 +++++++---------- protected/config/frontend.php | 26 ++++++++----------- .../nested-set-behavior/tests/bootstrap.php | 9 +++---- .../share/behaviors/DaoParametersBehavior.php | 2 +- protected/tests/bootstrap.php | 6 ++--- protected/yiic.php | 9 +++---- 9 files changed, 38 insertions(+), 52 deletions(-) diff --git a/backend/index.php b/backend/index.php index 01530c76..e6b62341 100644 --- a/backend/index.php +++ b/backend/index.php @@ -2,10 +2,10 @@ /** * @var GlobalConfig $globalConfig */ -require_once __DIR__.'/../protected/config/global_config.php'; - +require_once(__DIR__.'/../protected/config/global_config.php'); +$config = require_once($globalConfig->backendConfigPath.'/backend.php'); require_once($globalConfig->frameworkPath.'/yii.php'); require_once($globalConfig->backendPath.'/components/BApplication.php'); -$app = new BApplication($globalConfig->backendConfigPath.'/backend.php'); +$app = new BApplication($config); $app->run(); \ No newline at end of file diff --git a/backend/protected/tests/bootstrap.php b/backend/protected/tests/bootstrap.php index c5b07d4f..ecb9f4b9 100644 --- a/backend/protected/tests/bootstrap.php +++ b/backend/protected/tests/bootstrap.php @@ -2,10 +2,10 @@ /** * @var GlobalConfig $globalConfig */ -require_once __DIR__.'/../../../protected/config/global_config.php'; - +require_once(__DIR__.'/../../../protected/config/global_config.php'); +$config = require_once($globalConfig->backendConfigPath.'/test.php'); require_once($globalConfig->frameworkPath.'/yiit.php'); require_once($globalConfig->backendPath.'/tests/components/BTestApplication.php'); -$app = new BTestApplication($globalConfig->backendConfigPath.'/test.php'); +$app = new BTestApplication($config); $app->initModules(); \ No newline at end of file diff --git a/index.php b/index.php index 358e0293..31af60d6 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ error_reporting(E_ALL); ini_set('display_errors', 1); $yii = 'yii.php'; - $config = $globalConfig->frontendConfigPath.'/frontend.php'; + $config = require_once $globalConfig->frontendConfigPath.'/frontend.php'; } require_once($globalConfig->frameworkPath.'/'.$yii); diff --git a/protected/config/console.php b/protected/config/console.php index 19ffd0c8..14aa68c6 100644 --- a/protected/config/console.php +++ b/protected/config/console.php @@ -4,17 +4,14 @@ */ $globalConfig = GlobalConfig::instance(); -$frontend = realpath(__DIR__.'/..'); -$backend = realpath(__DIR__.'/../../backend/protected'); - $config = array( - 'basePath' => $frontend, + 'basePath' => $globalConfig->frontendPath, 'name' => 'Console Application', 'preload' => array('log'), 'aliases' => array( - 'backend' => $backend, - 'frontend' => $frontend, + 'backend' => $globalConfig->backendPath, + 'frontend' => $globalConfig->frontendPath, ), 'import' => array( @@ -23,8 +20,7 @@ ), 'components' => array( - 'db' => CMap::mergeArray(require($frontend.'/config/db.php'), - array() + 'db' => require($globalConfig->frontendConfigPath.'/db.php' ), 'log' => array( 'class' => 'CLogRouter', @@ -36,13 +32,13 @@ ), ), 'format' => array( - 'class' => 'SFormatter', + 'class' => 'SFormatter', 'datetimeFormat' => 'd.m.Y H:i:s', - 'dateFormat' => 'd.m.Y', - 'timeFormat' => 'H:i:s', - 'numberFormat' => array( - 'decimals' => 0, - 'decimalSeparator' => ',', + 'dateFormat' => 'd.m.Y', + 'timeFormat' => 'H:i:s', + 'numberFormat' => array( + 'decimals' => 0, + 'decimalSeparator' => ',', 'thousandSeparator' => ' ' ) ), diff --git a/protected/config/frontend.php b/protected/config/frontend.php index 3ee27028..a62ce912 100755 --- a/protected/config/frontend.php +++ b/protected/config/frontend.php @@ -8,14 +8,11 @@ defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', true); -$frontend = realpath(__DIR__.'/..'); -$backend = realpath(__DIR__.'/../../backend/protected'); - return array_merge_recursive(array( 'basePath' => $globalConfig->frontendPath, 'name' => 'argilla.ru', 'defaultController' => 'index', - 'preload' => array('requestRedirect'), + 'preload' => array('requestRedirect'), 'aliases' => array( 'backend' => $globalConfig->backendPath, @@ -72,10 +69,9 @@ 'modules' => array(), 'components' => array( - 'db' => array_replace_recursive(require($globalConfig->frontendConfigPath.'/db.php'), array( - 'enableProfiling' => YII_DEBUG, + 'enableProfiling' => YII_DEBUG, 'enableParamLogging' => YII_DEBUG, ) ), @@ -95,16 +91,16 @@ ), 'user' => array( - 'class' => 'FWebUser', + 'class' => 'FWebUser', 'allowAutoLogin' => true, - 'loginUrl' => '/user/login' + 'loginUrl' => '/user/login' ), 'urlManager' => array( - 'class' => 'FUrlManager', - 'urlFormat' => 'path', + 'class' => 'FUrlManager', + 'urlFormat' => 'path', 'useStrictParsing' => true, - 'showScriptName' => false, + 'showScriptName' => false, ), 'requestRedirect' => array( @@ -118,15 +114,15 @@ 'log' => array( 'class' => 'CLogRouter', 'enabled' => true, - 'routes' => array( + 'routes' => array( array( - 'class' => 'CFileLogRoute', + 'class' => 'CFileLogRoute', 'levels' => 'error, warning', ), array( - 'class' => 'ext.yii-debug-toolbar.YiiDebugToolbarRoute', + 'class' => 'ext.yii-debug-toolbar.YiiDebugToolbarRoute', 'ipFilters' => array('192.168.*'), - 'enabled' => YII_DEBUG && isset($_COOKIE['YII_DEBUG']), + 'enabled' => YII_DEBUG && isset($_COOKIE['YII_DEBUG']), ), ), ), diff --git a/protected/extensions/nested-set-behavior/tests/bootstrap.php b/protected/extensions/nested-set-behavior/tests/bootstrap.php index 7047eb9b..5732b5cc 100644 --- a/protected/extensions/nested-set-behavior/tests/bootstrap.php +++ b/protected/extensions/nested-set-behavior/tests/bootstrap.php @@ -2,11 +2,8 @@ /** * @var GlobalConfig $globalConfig */ -require_once __DIR__.'/../../../config/global_config.php'; - -$yiit = $globalConfig->frameworkPath.'/yiit.php'; -$config = dirname(__FILE__).'/config/test.php'; - -require_once($yiit); +require_once(__DIR__.'/../../../config/global_config.php'); +$config = require_once(dirname(__FILE__).'/config/test.php'); +require_once($globalConfig->frameworkPath.'/yiit.php'); Yii::createWebApplication($config); \ No newline at end of file diff --git a/protected/share/behaviors/DaoParametersBehavior.php b/protected/share/behaviors/DaoParametersBehavior.php index 53f1a777..2aa8a540 100644 --- a/protected/share/behaviors/DaoParametersBehavior.php +++ b/protected/share/behaviors/DaoParametersBehavior.php @@ -123,6 +123,6 @@ public function getParametersByCriteriaByCondition($condition = '', array $param $criteria->condition = $condition; $criteria->params = $parameters; - return $this->getParametersByCriteriaByCondition($criteria, $refresh, $indexBy); + return $this->getParametersByCriteria($criteria, $refresh, $indexBy); } } \ No newline at end of file diff --git a/protected/tests/bootstrap.php b/protected/tests/bootstrap.php index 2d0a199d..6bfe3eaf 100644 --- a/protected/tests/bootstrap.php +++ b/protected/tests/bootstrap.php @@ -2,9 +2,9 @@ /** * @var GlobalConfig $globalConfig */ -require_once realpath(__DIR__.'/../config/global_config.php'); - +require_once(__DIR__.'/../config/global_config.php'); +$config = require_once($globalConfig->frontendConfigPath.'/test.php'); require_once($globalConfig->frameworkPath.'/yiit.php'); require_once($globalConfig->frontendPath.'/tests/components/FTestApplication.php'); -$app = new FTestApplication($globalConfig->frontendConfigPath.'/test.php'); \ No newline at end of file +$app = new FTestApplication($config); \ No newline at end of file diff --git a/protected/yiic.php b/protected/yiic.php index d1b801cf..b78bb3e7 100644 --- a/protected/yiic.php +++ b/protected/yiic.php @@ -2,9 +2,6 @@ /** * @var GlobalConfig $globalConfig */ -require_once __DIR__.'/config/global_config.php'; - -$yiic = $globalConfig->frameworkPath.'/yiic.php'; -$config = $globalConfig->frontendConfigPath.'/console.php'; - -require_once($yiic); +require_once(__DIR__.'/config/global_config.php'); +$config = require_once($globalConfig->frontendConfigPath.'/console.php'); +require_once($globalConfig->frameworkPath.'/yiic.php'); \ No newline at end of file