本文整理汇总了PHP中Illuminate\Support\Facades\Storage::deleteDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::deleteDirectory方法的具体用法?PHP Storage::deleteDirectory怎么用?PHP Storage::deleteDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Storage
的用法示例。
在下文中一共展示了Storage::deleteDirectory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Delete the directory with the filename and all files inside
* Fire FileWasDeleted Event
*
*/
public function handle()
{
if (Storage::exists($this->getFileDirectory())) {
Storage::deleteDirectory($this->getFileDirectory());
}
event(new FileWasDeleted($this->filename));
}
示例2: tearDown
public function tearDown()
{
parent::tearDown();
$this->refreshApplication();
Storage::deleteDirectory('testing/ahk');
Storage::deleteDirectory('testing/cms');
Storage::deleteDirectory('testing/img');
}
示例3: deleteFileVer
public function deleteFileVer($id, $ver)
{
$entry = FileRecord::where('id', '=', $id)->firstOrFail();
Storage::delete($entry->owner_id . $entry->id . $entry->filename . "/" . $ver);
$files = Storage::allFiles($entry->owner_id . $entry->id . $entry->filename . "/");
if (count($files) == 0) {
Storage::deleteDirectory($entry->owner_id . $entry->id . $entry->filename);
$entry->delete();
} else {
if ($ver == $entry->public_version) {
$last = str_replace($entry->owner_id . $entry->id . $entry->filename . "/", "", end($files));
$entry->public_version = $last;
$entry->save();
}
}
return redirect('/');
}
示例4: reset_crawl
/**
*
*/
private function reset_crawl()
{
echo $this->state->state_name . " Resetting Crawl ... ";
$state = snake_case($this->state->state_name);
$state_code = strtolower($this->state->state_code);
// Delete Crawl Files
Storage::delete('sexoffenders/' . $state . '.sql.gz');
Storage::deleteDirectory('sexoffenders/' . $state, true);
Storage::deleteDirectory('sexoffenders/_html/' . str_slug($this->state->state_name), true);
// DB Reset
if ($this->counties_table) {
DB::table($state_code . '_counties')->update(['status' => '0']);
}
DB::table($state_code . '_offenders')->truncate();
DB::table($state_code . '_offenses')->truncate();
if ($this->profiles_table) {
DB::table($state_code . '_profiles')->truncate();
}
//
echo "State Crawl Refreshed" . PHP_EOL;
return;
}
示例5: decline
public function decline($id)
{
$entry = Achievements::where('achievement_id', '=', $id)->firstOrFail();
$file = FileRecord::where('id', $id)->firstOrFail();
$owner = User::where('id', $file->owner_id)->firstOrFail();
$data = ['fileName' => $entry->name];
Mail::queue('mail.hrDeny', $data, function ($message) use(&$owner) {
$message->to($owner->email, $owner->fname)->subject('Achievement rejected');
});
Storage::deleteDirectory($file->owner_id . $file->id . $file->filename);
$entry->delete();
$file->delete();
return redirect('/hr/verify');
}
示例6: deleteContent
/**
* Delete content
* @param string $path path to the content
* @return bool
*/
public function deleteContent($path)
{
if (is_file(storage_path() . '/app/' . $path)) {
return Storage::delete($path);
}
return Storage::deleteDirectory($path);
}