Browse Source

Fixing "Cannot remove ...: Permission denied" in File and bundle:: task

Signed-off-by: Pavel <proger.xp@gmail.com>
Pavel 12 years ago
parent
commit
5db3743702
2 changed files with 6 additions and 3 deletions
  1. 1 0
      laravel/cli/tasks/bundle/providers/provider.php
  2. 5 3
      laravel/file.php

+ 1 - 0
laravel/cli/tasks/bundle/providers/provider.php

@@ -54,6 +54,7 @@ abstract class Provider {
 
 		File::rmdir($work.'zip');
 
+		$zip->close();
 		@unlink($target);
 	}
 

+ 5 - 3
laravel/file.php

@@ -94,7 +94,7 @@ class File {
 
 	/**
 	 * Extract the file extension from a file path.
-	 * 
+	 *
 	 * @param  string  $path
 	 * @return string
 	 */
@@ -273,8 +273,9 @@ class File {
 			}
 		}
 
-		if ($delete) rmdir($source);
-		
+		unset($items);
+		if ($delete) @rmdir($source);
+
 		return true;
 	}
 
@@ -306,6 +307,7 @@ class File {
 			}
 		}
 
+		unset($items);
 		if ( ! $preserve) @rmdir($directory);
 	}