diff --git a/modules/setup/application/clicommands/ConfigCommand.php b/modules/setup/application/clicommands/ConfigCommand.php index a4a5da12e..c1e2ef782 100644 --- a/modules/setup/application/clicommands/ConfigCommand.php +++ b/modules/setup/application/clicommands/ConfigCommand.php @@ -54,7 +54,7 @@ class ConfigCommand extends Command )); } - if (! file_exists($configDir) && ! @mkdir($configDir)) { + if (! file_exists($configDir) && ! @mkdir($configDir, 0755, true)) { $e = error_get_last(); $this->fail(sprintf( $this->translate('Can\'t create configuration directory %s: %s'), diff --git a/modules/setup/library/Setup/Utils/MakeDirStep.php b/modules/setup/library/Setup/Utils/MakeDirStep.php deleted file mode 100644 index 5e486d561..000000000 --- a/modules/setup/library/Setup/Utils/MakeDirStep.php +++ /dev/null @@ -1,70 +0,0 @@ -paths = $paths; - $this->dirmode = $dirmode; - $this->errors = array(); - } - - public function apply() - { - $success = true; - foreach ($this->paths as $path) { - if (false === file_exists($path)) { - if (false === @mkdir($path)) { - $this->errors[$path] = error_get_last(); - $success = false; - } else { - $this->errors[$path] = null; - chmod($path, $this->dirmode); - } - } - } - - return $success; - } - - public function getSummary() - { - // This step is usually being used for directories which are required for the configuration but - // are not defined in any way by the user. So there is no need to show a summary for this step. - } - - public function getReport() - { - $okMessage = mt('setup', 'Directory "%s" in "%s" has been successfully created.'); - $failMessage = mt('setup', 'Unable to create directory "%s" in "%s". An error occured:'); - - $report = array(); - foreach ($this->paths as $path) { - if (array_key_exists($path, $this->errors)) { - if (is_array($this->errors[$path])) { - $report[] = sprintf($failMessage, basename($path), dirname($path)); - $report[] = sprintf(mt('setup', 'ERROR: %s'), $this->errors[$path]['message']); - } else { - $report[] = sprintf($okMessage, basename($path), dirname($path)); - } - } - } - - return $report; - } -}