Skip to content

Commit

Permalink
Fixed issue #11398: Tmp folder is not read from config-defaults.php
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jun 17, 2016
1 parent 4026718 commit d2cec57
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/core/LSYii_Application.php
Expand Up @@ -37,9 +37,8 @@ class LSYii_Application extends CWebApplication
* @param array $config
* @return void
*/
public function __construct($config = null)
public function __construct($aApplicationConfig = null)
{
parent::__construct($config);
// Load the default and environmental settings from different files into self.
$ls_config = require(__DIR__ . '/../config/config-defaults.php');
$email_config = require(__DIR__ . '/../config/email.php');
Expand All @@ -56,13 +55,16 @@ public function __construct($config = 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);
}
App()->getAssetManager()->setBaseUrl($settings['tempurl'] . '/assets');
// 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()->setBasePath($settings['tempdir'] . '/assets');
App()->setRuntimePath($settings['tempdir'] . '/runtime');

}

Expand Down

2 comments on commit d2cec57

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@c-schmitz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the hint ;)

Please sign in to comment.