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


PHP Storage::files方法代碼示例

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


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

示例1: clearScreenshotFolder

 /**
  * Clear out all screenshots from the screenshot directory
  * TODO: Should be removed, as soon as the virtual-filesystem is integrated
  */
 protected function clearScreenshotFolder()
 {
     $screenshot = app()->make(Screeenly\Core\Screeenshot\Screenshot::class);
     $path = $screenshot->setStoragePath();
     $files = \Storage::files($path);
     array_filter($files, function ($file) {
         \Storage::delete($file);
     });
 }
開發者ID:MehmetNuri,項目名稱:screeenly,代碼行數:13,代碼來源:ApiV2Test.php

示例2: index

 public function index()
 {
     $paths = \Storage::files('blog');
     $articles = array();
     foreach ($paths as $path) {
         preg_match('/^.*$/m', \Storage::get($path), $matches);
         $articles[] = array('uri' => substr($path, 5, -3), 'title' => substr($matches[0], 2));
     }
     return view('blog/index', array('articles' => $articles, 'title' => 'sinkcup的博客'));
 }
開發者ID:sinkcup,項目名稱:portal,代碼行數:10,代碼來源:Blog.php

示例3: drop

 public function drop($filename)
 {
     // Cut original file name
     $dot = strpos($filename, '.');
     $origin_name = substr($filename, 0, $dot);
     // Find all images in basepath
     $allFiles = \Storage::files($this->basepath);
     $files = array_filter($allFiles, function ($file) use($origin_name) {
         return preg_match('/^(.*)' . $origin_name . '(.*)$/', $file);
     });
     // Delete original image and thumbnails
     foreach ($files as $file) {
         \Storage::delete($file);
     }
 }
開發者ID:wielski,項目名稱:laravel-fileapi,代碼行數:15,代碼來源:FileApi.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $files = \Storage::files();
     return view('admin.proyectos.import', compact('files'));
 }
開發者ID:armandolazarte,項目名稱:guia,代碼行數:10,代碼來源:ImportarProyectoController.php

示例5: readImages

 public function readImages(Request $request)
 {
     return \Storage::files(storage_path('app/uploads/'));
 }
開發者ID:andycrockett,項目名稱:andycrockett,代碼行數:4,代碼來源:AdminController.php


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