Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions laravel/cli/tasks/bundle/providers/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected function zipball($url, $bundle, $path)

File::rmdir($work.'zip');

$zip->close();
@unlink($target);
}

Expand Down
8 changes: 5 additions & 3 deletions laravel/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function copy($path, $target)

/**
* Extract the file extension from a file path.
*
*
* @param string $path
* @return string
*/
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -306,6 +307,7 @@ public static function rmdir($directory, $preserve = false)
}
}

unset($items);
if ( ! $preserve) @rmdir($directory);
}

Expand Down