diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index 573450d8..54b93f9f 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -23,7 +23,7 @@ protected function zipball($bundle, $url) { // When installing a bundle from a Zip archive, we'll first clone // down the bundle zip into the bundles "working" directory so - // we have a spot to do all of our bundle extrations. + // we have a spot to do all of our bundle extration work. $target = path('storage').'work/laravel-bundle.zip'; File::put($target, file_get_contents($url)); @@ -46,6 +46,8 @@ protected function zipball($bundle, $url) $path = $this->path($bundle); File::cpdir($latest->getRealPath(), path('bundle').$path); + + @unlink($target); } /** diff --git a/laravel/file.php b/laravel/file.php index 6f82c771..4796c6a3 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -1,4 +1,4 @@ -getRealPath()); + if ($delete) @rmdir($item->getRealPath()); } // If the file system item is an actual file, we can copy the // file from the bundle asset directory to the public asset @@ -220,7 +234,7 @@ public static function cpdir($source, $destination, $delete = false) { copy($item->getRealPath(), $location); - if ($delete) unlink($item->getRealPath()); + if ($delete) @unlink($item->getRealPath()); } } @@ -231,13 +245,14 @@ public static function cpdir($source, $destination, $delete = false) * Get the most recently modified file in a directory. * * @param string $directory + * @param int $options * @return SplFileInfo */ - public static function latest($directory) + public static function latest($directory, $options = fIterator::SKIP_DOTS) { $time = 0; - $items = new FilesystemIterator($directory, FilesystemIterator::SKIP_DOTS); + $items = new fIterator($directory, $options); // To get the latest created file, we'll simply spin through the // directory, setting the latest file if we encounter a file