本文整理匯總了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);
});
}
示例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的博客'));
}
示例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);
}
}
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$files = \Storage::files();
return view('admin.proyectos.import', compact('files'));
}
示例5: readImages
public function readImages(Request $request)
{
return \Storage::files(storage_path('app/uploads/'));
}