From 5db37437025b2f7e8ae895045f6a6c1d078a001e Mon Sep 17 00:00:00 2001 From: Pavel Date: Thu, 19 Apr 2012 10:36:28 +0400 Subject: [PATCH] Fixing "Cannot remove ...: Permission denied" in File and bundle:: task Signed-off-by: Pavel --- laravel/cli/tasks/bundle/providers/provider.php | 1 + laravel/file.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index bdf3b8ced0c..bf6401f71a0 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -54,6 +54,7 @@ protected function zipball($url, $bundle, $path) File::rmdir($work.'zip'); + $zip->close(); @unlink($target); } diff --git a/laravel/file.php b/laravel/file.php index 0346c83c71d..1cb33c00547 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -94,7 +94,7 @@ public static function copy($path, $target) /** * Extract the file extension from a file path. - * + * * @param string $path * @return string */ @@ -273,8 +273,9 @@ public static function cpdir($source, $destination, $delete = false, $options = } } - if ($delete) rmdir($source); - + unset($items); + if ($delete) @rmdir($source); + return true; } @@ -306,6 +307,7 @@ public static function rmdir($directory, $preserve = false) } } + unset($items); if ( ! $preserve) @rmdir($directory); }