Skip to content
Browse files

Install process cleaned up - warnings removed and an extra check has …

…been to esnure the app/tmp/cache directory is writable.
  • Loading branch information...
1 parent 133fafc commit 1c71d29bb967002fb639e5823455a8adaaedcf43 @Datawalke committed Aug 30, 2012
Showing with 19 additions and 24 deletions.
  1. +10 −9 app/controllers/installer_controller.php
  2. +9 −6 app/views/installer/start.ctp
  3. +0 −9 app/views/layouts/install.ctp
View
19 app/controllers/installer_controller.php
@@ -10,15 +10,16 @@ public function beforeFilter() {
//$this->Auth->allow('*');
}
- public function start() {
- $this->set('write_config', is_writable(APP.'/config'));
- $this->set('write_tmp', is_writable(TMP));
- $this->set('write_uploads', is_writable(APP.'/webroot/img/uploads/users'));
- $this->set('write_thumbs', is_writable(APP.'/webroot/img/thumbs'));
- $this->set('write_database', is_writable(APP.'/config/database.php'));
- if(is_writable(APP.'/config/database.php') && is_writable(TMP) && is_writable(APP.'/webroot/img/uploads/users') && is_writable(APP.'/webroot/img/thumbs')) {
- $this->set('continue', true);
- }
+ public function start() {
+ $writeChecks = array(
+ 'config' => is_writable(APP.'/config'),
+ 'tmp' => is_writable(TMP),
+ 'tmp_cache' => is_writable(TMP.'/cache'),
+ 'uploads' => is_writable(APP.'/webroot/img/uploads/users'),
+ 'thumbs' => is_writable(APP.'/webroot/img/thumbs'),
+ 'database' => is_writable(APP.'/config/database.php')
+ );
+ $this->set('writeChecks', $writeChecks);
}
public function license() {
View
15 app/views/installer/start.ctp
@@ -14,24 +14,27 @@
<p>Directory permission tests:</p>
<ul>
- <li>/app/config <?if($write_config) { echo '<span class="success">is writable.</span>'; }
+ <li>/app/config <?if($writeChecks['config']) { echo '<span class="success">is writable.</span>'; }
else { echo '<span class="error">is not writable.</span>';}?>
</li>
- <li>/app/config/database.php <?if($write_database) { echo '<span class="success">is writable.</span>'; }
+ <li>/app/config/database.php <?if($writeChecks['database']) { echo '<span class="success">is writable.</span>'; }
else { echo '<span class="error">is not writable.</span>';}?>
</li>
- <li>/app/tmp <?if($write_tmp) { echo '<span class="success">is writable.</span>'; }
+ <li>/app/tmp <?if($writeChecks['tmp']) { echo '<span class="success">is writable.</span>'; }
else { echo '<span class="error">is not writable.</span>';}?>
</li>
- <li>/app/webroot/img/thumbs <?if($write_thumbs) { echo '<span class="success">is writable.</span>'; }
+ <li>/app/tmp/cache <?if($writeChecks['tmp_cache']) { echo '<span class="success">is writable.</span>'; }
+ else { echo '<span class="error">is not writable.</span>';}?>
+ </li>
+ <li>/app/webroot/img/thumbs <?if($writeChecks['thumbs']) { echo '<span class="success">is writable.</span>'; }
else { echo '<span class="error">is not writable.</span>';}?>
</li>
- <li>/app/webroot/img/uploads/users <?if($write_uploads) { echo '<span class="success">is writable.</span>'; }
+ <li>/app/webroot/img/uploads/users <?if($writeChecks['uploads']) { echo '<span class="success">is writable.</span>'; }
else { echo '<span class="error">is not writable.</span>';}?>
</li>
</ul>
-<? if($continue) { ?>
+<? if(!in_array(false, $writeChecks)) { ?>
<p>Looks like you are good to go. <a href="install/database-config">Lets Continue!</a></p>
<? } else { ?>
<p><span class="error">Look above for errors you must fix.</span></p>
View
9 app/views/layouts/install.ctp
@@ -9,15 +9,6 @@
</head>
<body>
<?=$html->image('coordino_logo.png');?>
- <div style="float:right">
- <li>
- <a href='#'><?php __('change language'); ?></a>
- <ul>
- <li><?=$html->link(__('english',true),'/lang/eng')?></li>
- <li><?=$html->link(__('french',true),'/lang/fre')?></li>
- </ul>
- </li>
- </div>
<? echo $session->flash(); ?>
<?=$content_for_layout;?>
<body>

0 comments on commit 1c71d29

Please sign in to comment.
Something went wrong with that request. Please try again.