Skip to content

Commit

Permalink
Dev: config looping...
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 17, 2016
1 parent 0232f6b commit fd447dc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
25 changes: 21 additions & 4 deletions application/core/LSYii_Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ class LSYii_Application extends CWebApplication
public function __construct($aApplicationConfig = null)
{
// Load the default and environmental settings from different files into self.
$settings = require(__DIR__ . '/../config/config-defaults.php');

if(file_exists(__DIR__ . '/../config/config.php'))
{
$ls_config = require(__DIR__ . '/../config/config.php');
if(is_array($ls_config['config']))
{
$settings = array_merge($settings, $ls_config['config']);
}
}
// Runtime path has to be set before parent constructor is executed
$aApplicationConfig['runtimePath']=$settings['tempdir'] . '/runtime';

parent::__construct($aApplicationConfig);

$ls_config = require(__DIR__ . '/../config/config-defaults.php');
$email_config = require(__DIR__ . '/../config/email.php');
$version_config = require(__DIR__ . '/../config/version.php');
Expand All @@ -55,17 +70,19 @@ public function __construct($aApplicationConfig = null)
$settings = array_merge($settings, $ls_config['config']);
}
}
// Runtime path has to be set before parent constructor is executed
$aApplicationConfig['runtimePath']=$settings['tempdir'] . '/runtime';
parent::__construct($aApplicationConfig);



foreach ($settings as $key => $value)
{
$this->setConfig($key, $value);
}
// Asset manager path can only be set after App was constructed because it relies on App()
App()->getAssetManager()->setBaseUrl(Yii::app()->getBaseUrl(false).$settings['tempurl']. '/assets');
App()->getAssetManager()->setBaseUrl($settings['tempurl']. '/assets');
App()->getAssetManager()->setBasePath($settings['tempdir'] . '/assets');



}

public function init() {
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/expressions/em_core_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1636,8 +1636,8 @@ public function GetPrettyPrintString()
$oAdminTheme->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'expression.js');
*/

App()->getClientScript()->registerCssFile( Yii::app()->getBaseUrl(true) . Yii::app()->getConfig('publicstyleurl') . "expressions.css" );
App()->getClientScript()->registerScriptFile(Yii::app()->getBaseUrl(true) . Yii::app()->getConfig('adminscripts') . "expression.js");
App()->getClientScript()->registerCssFile( Yii::app()->getConfig('publicstyleurl') . "expressions.css" );
App()->getClientScript()->registerScriptFile( Yii::app()->getConfig('adminscripts') . "expression.js");

}
$sClass='em-expression';
Expand Down

0 comments on commit fd447dc

Please sign in to comment.