Commit dad2a507 authored by alexpott's avatar alexpott

Issue #2505793 by denutkarsh, jhedstrom, 20th: FileStorage::ensureDirectory...

Issue #2505793 by denutkarsh, jhedstrom, 20th: FileStorage::ensureDirectory has no return value, but save() uses it and docs say it does
parent f96bb93e
......@@ -49,12 +49,7 @@ public function load($name) {
public function save($name, $code) {
$path = $this->getFullPath($name);
$directory = dirname($path);
if ($this->ensureDirectory($directory)) {
$htaccess_path = $directory . '/.htaccess';
if (!file_exists($htaccess_path) && file_put_contents($htaccess_path, static::htaccessLines())) {
@chmod($htaccess_path, 0444);
}
}
$this->ensureDirectory($directory);
return (bool) file_put_contents($path, $code);
}
......@@ -120,9 +115,6 @@ public static function htaccessLines($private = TRUE) {
* The directory path.
* @param int $mode
* The mode, permissions, the directory should have.
*
* @return bool
* TRUE if the directory exists or has been created, FALSE otherwise.
*/
protected function ensureDirectory($directory, $mode = 0777) {
if ($this->createDirectory($directory, $mode)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment