diff --git a/classes/Autoload.php b/classes/Autoload.php index ad4f3c49f..96bb8f54d 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -133,7 +133,9 @@ class Autoload // Write classes index on disc to cache it $filename = $this->root_dir.Autoload::INDEX_FILE; - if ((file_exists($filename) && is_writable($filename)) || is_writable(dirname($filename))) + if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename))) + throw new PrestaShopException($filename.' is not writable, please give write permissions (chmod 666) on this file.'); + else { // Let's write index content in cache file // In order to be sure that this file is correctly written, a check is done on the file content @@ -157,8 +159,6 @@ class Autoload throw new PrestaShopException('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically'); } } - else - throw new PrestaShopException($filename.' is not writable!'); $this->index = $classes; }