Skip to content

Commit

Permalink
Bug #208: Исправлен баг в режиме production
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarinov committed May 5, 2016
1 parent c5bb663 commit d445c40
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 52 deletions.
6 changes: 3 additions & 3 deletions backend/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
6 changes: 3 additions & 3 deletions backend/protected/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
24 changes: 10 additions & 14 deletions protected/config/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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',
Expand All @@ -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' => ' '
)
),
Expand Down
26 changes: 11 additions & 15 deletions protected/config/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)
),
Expand All @@ -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(
Expand All @@ -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']),
),
),
),
Expand Down
9 changes: 3 additions & 6 deletions protected/extensions/nested-set-behavior/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion protected/share/behaviors/DaoParametersBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 3 additions & 3 deletions protected/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
$app = new FTestApplication($config);
9 changes: 3 additions & 6 deletions protected/yiic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

0 comments on commit d445c40

Please sign in to comment.