Commit dad2a507 authored by Alex Pott's avatar Alex Pott
Browse files

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
Loading
Loading
Loading
Loading
+1 −9
Changes for core/lib/Drupal/Component/PhpStorage/FileStorage.php: 1 added line, 9 removed lines.
Original line number Diff line number Diff line
@@ -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)) {