diff --git a/cache/.gitkeep b/cache/.gitkeep old mode 100644 new mode 100755 diff --git a/cache/.htaccess b/cache/.htaccess old mode 100644 new mode 100755 diff --git a/core/lib/Thelia/Command/Install.php b/core/lib/Thelia/Command/Install.php index 9a1cb8dfa..1a486a124 100644 --- a/core/lib/Thelia/Command/Install.php +++ b/core/lib/Thelia/Command/Install.php @@ -53,6 +53,8 @@ class Install extends ContainerAwareCommand '' )); + $this->checkPermission($output); + do { $connectionInfo = $this->getConnectionInfo($input, $output); } while(false === $connection = $this->tryConnection($connectionInfo, $output)); @@ -82,6 +84,50 @@ class Install extends ContainerAwareCommand )); } + protected function checkPermission(OutputInterface $output) + { + $output->writeln(array( + "Checking some permissions" + )); + + $confDir = THELIA_ROOT . "local/config"; + $cacheDir = THELIA_ROOT . "cache"; + $logDir = THELIA_ROOT . "log"; + + $conf = is_writable($confDir); + $cache = is_writable($cacheDir); + $log = is_writable($logDir); + + $output->writeln(array( + sprintf( + "config directory(%s)... %s", + $confDir, + $conf ? "Ok" : "Fail" + ), + sprintf( + "cache directory(%s)... %s" + ,$cacheDir, + $cache ? "Ok" : "Fail" + ), + sprintf( + "log directory(%s)... %s", + $logDir, + $log ? "Ok" : "Fail" + ), + )); + + if ($conf === false || $cache === false || $log === false) { + $output->writeln(array( + "", + "Please put correct permission and reload install process" + )); + exit; + } + + + + } + protected function createConfigFile($connectionInfo) { $fs = new Filesystem(); diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index 600779ad1..49376093e 100644 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -118,18 +118,20 @@ class Thelia extends Kernel $loader->load("config.xml"); $loader->load("routing.xml"); $loader->load("action.xml"); + if (defined("THELIA_INSTALL_MODE") === false) { + $modules = \Thelia\Model\ModuleQuery::getActivated(); - $modules = \Thelia\Model\ModuleQuery::getActivated(); + foreach ($modules as $module) { - foreach ($modules as $module) { - - try { - $loader = new XmlFileLoader($container, new FileLocator(THELIA_MODULE_DIR . "/" . ucfirst($module->getCode()) . "/Config")); - $loader->load("config.xml"); - } catch(\InvalidArgumentException $e) { + try { + $loader = new XmlFileLoader($container, new FileLocator(THELIA_MODULE_DIR . "/" . ucfirst($module->getCode()) . "/Config")); + $loader->load("config.xml"); + } catch(\InvalidArgumentException $e) { + } } } + } /** diff --git a/local/config/database.yml.sample b/local/config/database.yml.sample deleted file mode 100644 index 3bb829965..000000000 --- a/local/config/database.yml.sample +++ /dev/null @@ -1,6 +0,0 @@ -database: - connection: - driver: %DRIVER% - user: %USERNAME% - password: %PASSWORD% - dsn: %DSN% diff --git a/log/.htaccess b/log/.htaccess old mode 100644 new mode 100755