當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Storage::allFiles方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Storage::allFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP Storage::allFiles方法的具體用法?PHP Storage::allFiles怎麽用?PHP Storage::allFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Storage的用法示例。


在下文中一共展示了Storage::allFiles方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public function run()
 {
     $files = Storage::allFiles();
     foreach ($files as $file) {
         Storage::disk('local')->delete($file);
     }
     $products = Product::all();
     foreach ($products as $product) {
         $uri = str_random(12) . '_370x235.jpg';
         Storage::put($uri, file_get_contents('http://lorempixel.com/futurama/370/235/'));
         Picture::create(['product_id' => $product->id, 'uri' => $uri, 'title' => $this->faker->name]);
     }
 }
開發者ID:ivanovamarieta,項目名稱:ProjetStarWars,代碼行數:13,代碼來源:PictureTableSeeder.php

示例2: getVersions

 public function getVersions($id)
 {
     $entry = FileRecord::where('id', '=', $id)->firstOrFail();
     $owner = $entry->owner_id;
     $files = Storage::allFiles($entry->owner_id . $entry->id . $entry->filename . "/");
     $docType = $entry->doc_type_id;
     $i = 0;
     foreach ($files as $file) {
         $files[$i] = str_replace($entry->owner_id . $entry->id . $entry->filename . "/", "", $file);
         $i++;
     }
     return View::make('nav.cards.fileVersions')->with('files', $files)->with('id', $id)->with('owner', $owner)->with('docType', $docType);
 }
開發者ID:LarsNorlander,項目名稱:documenter,代碼行數:13,代碼來源:RightSideBarController.php

示例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('/');
 }
開發者ID:LarsNorlander,項目名稱:documenter,代碼行數:17,代碼來源:FileController.php


注:本文中的Illuminate\Support\Facades\Storage::allFiles方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。