Commit 80d98eca authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3254485: Use delete recursive instead of manually cleaning up files

parent 36052587
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -445,20 +445,7 @@ Host *
      }
    }
    // Clean up.
    $files = glob("$directory/*");
    foreach ($files as $file) {
      try {
        $this->file->unlink($file);
      }
      catch (\Throwable $e) {
      }
    }
    // For some reason, some times there is an empty directory called "vendor"
    // in there. Not sure why.
    if (@file_exists("$directory/vendor")) {
      $this->file->rmdir("$directory/vendor");
    }
    $this->file->rmdir($directory);
    $this->file->deleteRecursive($directory);
    if ($our_sha) {
      $this->cache->set($cid, $our_sha, time() + 600);
    }