Skip to content

Commit

Permalink
Fixed install error due to runtime path not writable
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Mar 5, 2013
1 parent 8a23ea1 commit de5caf9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions index.php
Expand Up @@ -175,7 +175,22 @@
require_once BASEPATH . 'yii' . EXT;
require_once APPPATH . 'core/LSYii_Application' . EXT;

Yii::createApplication('LSYii_Application', APPPATH . 'config/config' . EXT)->run();
$config = APPPATH . 'config/config' . EXT;

if (!file_exists($config)) {
$config = APPPATH . 'config/config-sample-mysql' . EXT;

// If Yii can not start due to unwritable runtimePath, present an error
$config = require($config);
$runtimePath = $config['runtimePath'];
if (!is_dir($runtimePath) || !is_writable($runtimePath)) {
// @@TODO: present html page styled like the installer
die (sprintf('%s should be writable by the webserver (755 or 775).', $runtimePath));
}
}


Yii::createApplication('LSYii_Application', $config)->run();

/* End of file index.php */
/* Location: ./index.php */
/* Location: ./index.php */

0 comments on commit de5caf9

Please sign in to comment.