Skip to content

Commit

Permalink
Dev: Fixed issue about default assetManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Mar 23, 2017
1 parent 0eb2bb8 commit 71685ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions application/config/internal.php
Expand Up @@ -118,8 +118,6 @@
// These are defaults and are later overwritten in LSYii_Application by a path based on config tempdir/tempurl
'assetManager' => array(
'excludeFiles' => array("config.xml", "assessment.pstpl", "clearall.pstpl", "completed.pstpl", "endgroup.pstpl", "endpage.pstpl", "groupdescription.pstpl", "load.pstpl", "navigator.pstpl", "printanswers.pstpl", "print_group.pstpl", "print_question.pstpl", "print_survey.pstpl", "privacy.pstpl", "question.pstpl", "register.pstpl", "save.pstpl", "startgroup.pstpl", "startpage.pstpl", "surveylist.pstpl", "survey.pstpl", "welcome.pstpl" ),
'baseUrl' => '/tmp/assets',
'basePath'=> dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'assets',
),

'request' => array(
Expand Down
18 changes: 10 additions & 8 deletions application/core/LSYii_Application.php
Expand Up @@ -64,15 +64,8 @@ public function __construct($aApplicationConfig = null)

/* Construct CWebApplication */
parent::__construct($aApplicationConfig);
/* Update asset manager path and url only if not directly set in aApplicationConfig */
if(!isset($aApplicationConfig['components']['assetManager']['baseUrl'])){
App()->getAssetManager()->setBaseUrl($settings['tempurl']. '/assets');
}
if(!isset($aApplicationConfig['components']['assetManager']['basePath'])){
App()->getAssetManager()->setBasePath($settings['tempdir'] . '/assets');
}

/* Because we have app now : we have to call again the config (usage of Yii::app() for publicurl */
/* Because we have app now : we have to call again the config (usage of Yii::app() for publicurl) */
$coreConfig = require(__DIR__ . '/../config/config-defaults.php');
$emailConfig = require(__DIR__ . '/../config/email.php');
$versionConfig = require(__DIR__ . '/../config/version.php');
Expand All @@ -86,6 +79,15 @@ public function __construct($aApplicationConfig = null)
$lsConfig = array_merge($lsConfig, $userConfigs['config']);
}
}
/* Update asset manager path and url only if not directly set in aApplicationConfig (from config.php),
* must do after reloading to have valid publicurl (the tempurl) */
if(!isset($aApplicationConfig['components']['assetManager']['baseUrl'])){
App()->getAssetManager()->setBaseUrl($lsConfig['tempurl']. '/assets');
}
if(!isset($aApplicationConfig['components']['assetManager']['basePath'])){
App()->getAssetManager()->setBasePath($lsConfig['tempdir'] . '/assets');
}

$this->config = array_merge($this->config, $lsConfig);
}

Expand Down

0 comments on commit 71685ac

Please sign in to comment.