本文整理汇总了PHP中Illuminate\Support\Facades\Storage::directories方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::directories方法的具体用法?PHP Storage::directories怎么用?PHP Storage::directories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Storage
的用法示例。
在下文中一共展示了Storage::directories方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lists
/**
* Get a list of the theme directories.
* @return array
*/
public static function lists()
{
$themes = Storage::directories('resources/views/themes');
return array_map(function ($theme) {
return basename($theme);
}, $themes);
}
示例2: lists
public static function lists()
{
$templates = Storage::directories('resources/views/vendor/front');
return array_map(function ($template) {
return basename($template);
}, $templates);
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param $cluster
* @return Response
*/
public function edit(Cluster $cluster)
{
$directories = Storage::directories('axl/');
$versions = [];
foreach ($directories as $directory) {
preg_match('/\\/(.*)/', $directory, $matches);
$versions[$matches[1]] = $matches[1];
}
return view('cluster.edit', compact('cluster', 'versions'));
}
示例4: index
/**
* Show list of uploaded files
*
* @return mixed
*/
public function index()
{
$files = Storage::directories(getUploadDirectory());
//Remove foldername
foreach ($files as &$file) {
$file = str_replace(getUploadDirectory() . '/', '', $file);
//On Linux systems
$file = str_replace(getUploadDirectory() . '\\', '', $file);
//On Windows systems
}
return $files;
}
示例5: createSubDirectoryList
/**
* Returns an object of all directories within a directory
* @param $dir
* @return \stdClass
*/
protected function createSubDirectoryList($dir)
{
$folder = new \stdClass();
$folder->name = basename($dir);
$folder->path = $dir;
$folder->sub_directories = [];
$folder->show_sub_directories = false;
$folder->active = false;
$folder->parent_directory = dirname($dir);
$directories = Storage::directories($dir);
foreach ($directories as $dir) {
$folder->sub_directories[] = $this->createSubDirectoryList($dir);
}
$folder->hasSubDirectories = count($folder->sub_directories) > 0;
return $folder;
}
示例6: checkIfPageExists
/**
* Check if a directory or a file already exists in the current directory
* @param string $name file or directory name
* @param string $path current directory path
* @param string $type search a file or a directory
* @return bool
*/
public function checkIfPageExists($name, $path, $type = 'file')
{
if ($type === 'file') {
$files = Storage::files($path);
foreach ($files as $file) {
$explodeFilePath = explode('/', $file);
$fileName = explode('.', $explodeFilePath[count($explodeFilePath) - 1])[0];
if ($name === $fileName) {
return true;
}
}
} else {
$directories = Storage::directories($path);
foreach ($directories as $directory) {
$explodeFilePath = explode('/', $directory);
$fileName = $explodeFilePath[count($explodeFilePath) - 1];
if ($name === $fileName) {
return true;
}
}
}
return false;
}
示例7: edit
/**
* Show the form for editing the specified resource.
*
* @param $id
* @return Response
* @internal param $cluster
*/
public function edit($id)
{
$cluster = $this->cluster->find($id);
$activeClusterId = \Auth::user()->activeClusterId();
$directories = Storage::directories('app/axl/');
$versions = [];
foreach ($directories as $directory) {
preg_match('/\\/axl\\/(.*)/', $directory, $matches);
$versions[$matches[1]] = $matches[1];
}
return view('cluster.edit', compact('cluster', 'activeClusterId', 'versions'));
}