本文整理汇总了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/'));
}