当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::glob方法代码示例

本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::glob方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::glob方法的具体用法?PHP Filesystem::glob怎么用?PHP Filesystem::glob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Filesystem\Filesystem的用法示例。


在下文中一共展示了Filesystem::glob方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: removeFiles

 /**
  * @param string $dir
  */
 protected function removeFiles($dir)
 {
     $files = $this->filesystem->glob($dir . '/*');
     foreach ($files as $file) {
         $this->filesystem->delete($file);
     }
 }
开发者ID:ytake,项目名称:laravel-aspect,代码行数:10,代码来源:ClearCacheCommand.php

示例2: findExtensions

 /**
  * Find the extensions.
  *
  * @param  array $paths
  * @return array
  */
 public function findExtensions(array $paths)
 {
     $files = array();
     // Iterate over the paths.
     foreach ($paths as $path) {
         // Find the extension files.
         $found = $this->filesystem->glob($path . '/*/*/extension.php');
         // Check if we found some files.
         if (is_array($found)) {
             // Merge the files.
             $files = array_merge($files, $found);
         }
     }
     $extensions = array();
     // Iterate over the files.
     foreach ($files as $file) {
         // Get the extension attributes.
         $attributes = $this->filesystem->getRequire($file);
         // Check if the attributes are valid.
         if (is_array($attributes) && isset($attributes['slug'])) {
             // Initialise the extension class.
             $extensions[$attributes['slug']] = new Extension(dirname($file), $attributes);
         }
     }
     return $extensions;
 }
开发者ID:maclof,项目名称:extensions,代码行数:32,代码来源:ExtensionFinder.php

示例3: findExtensionsInPath

 /**
  * {@inheritDoc}
  */
 public function findExtensionsInPath($path)
 {
     $extensions = $this->filesystem->glob($path . '/*/*/extension.php');
     if ($extensions === false) {
         return array();
     }
     return $extensions;
 }
开发者ID:sohailaammarocs,项目名称:lfc,代码行数:11,代码来源:FileFinder.php

示例4: fire

 /**
  * @return void
  */
 public function fire()
 {
     $statics = $this->files->glob($this->notadd->publicPath() . DIRECTORY_SEPARATOR . 'cache' . '/*');
     foreach ($statics as $static) {
         $this->files->deleteDirectory($static);
     }
     $this->info('Static files cleared!');
 }
开发者ID:darrengopower,项目名称:framework,代码行数:11,代码来源:StaticClearCommand.php

示例5: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $views = $this->files->glob($this->laravel['config']['view.compiled'] . '/*');
     foreach ($views as $view) {
         $this->files->delete($view);
     }
     $this->info('Compiled views cleared!');
 }
开发者ID:saj696,项目名称:pipe,代码行数:13,代码来源:ViewClearCommand.php

示例6: files

 /**
  * Get an array of paths to a given file.
  * @param type $path
  */
 public function files($filepath)
 {
     $out = array();
     foreach ($this->modules as $dir) {
         $files = $this->fs->glob(app_path() . "/../{$dir}/{$filepath}");
         $out = array_merge($out, $files);
     }
     return $out;
 }
开发者ID:samwilson,项目名称:ormic,代码行数:13,代码来源:Modules.php

示例7: determineFiles

 /**
  * Figure out what files are to be formatted
  *
  * @return string
  */
 private function determineFiles()
 {
     // NOTE: Since we are using file, then it exist, but may not be set
     if ($this->input->hasOption('file') && $this->input->getOption('file')) {
         $this->output->writeln("<info>Formatting " . $this->input->getOption('file') . "</info>");
         return $this->input->getOption('file');
     }
     $this->output->writeln("<info>Formatting code in " . $this->generator->generatedDirectory('*.php', false) . "</info>");
     // Has a default, so don't have to check for existence
     return implode(" ", $this->files->glob($this->generator->generatedDirectory('*.php', false)));
 }
开发者ID:JustinAzoff,项目名称:connectwise-php-generator,代码行数:16,代码来源:FormatCode.php

示例8: execute

 /**
  * Runs through the files int the API src dir, and pulls the public methods out
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int|null|void
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $this->setInputOutput($input, $output);
     $output->writeln("<info>Adding type hints to generated code...</info>");
     $this->generator->setAndMakeApiDirectory($this->input->getOption('directory'), false, $this->output);
     // Grab each file in the folder
     foreach ($this->files->glob($this->generator->generatedDirectory('*.php', false)) as $file) {
         $output->writeln("<comment>Adding type hints to " . $file . "</comment>");
         $this->type_hinter->process($file);
     }
 }
开发者ID:JustinAzoff,项目名称:connectwise-php-generator,代码行数:19,代码来源:InsertTypeHints.php

示例9: fire

 /**
  * @return void
  */
 public function fire()
 {
     $path = $this->laravel['config']['view.compiled'];
     if (!$path) {
         throw new RuntimeException('View path not found.');
     }
     foreach ($this->files->glob("{$path}/*") as $view) {
         $this->files->delete($view);
     }
     $this->info('Compiled views cleared!');
 }
开发者ID:notadd,项目名称:framework,代码行数:14,代码来源:ViewClearCommand.php

示例10: init

 /**
  * 初始化匯入資料.
  *
  * @return void
  */
 protected function init()
 {
     $dir = $this->option('dir') ? realpath($this->option('dir')) : false;
     if (false !== $dir && $this->filesystem->isDirectory($dir)) {
         $this->files = array_merge($this->files, $this->filesystem->glob(file_build_path($dir, '*.html')));
     }
     $file = $this->option('file') ? realpath($this->option('file')) : false;
     if (false !== $file && ends_with($file, '.html') && $this->filesystem->isFile($file)) {
         $this->files[] = $file;
     }
 }
开发者ID:BePsvPT,项目名称:CCU-Plus,代码行数:16,代码来源:ImportCourse.php

示例11: fire

 /**
  * fire.
  *
  * @method fire
  */
 public function fire()
 {
     $root = $this->getLaravel()->basePath();
     $directories = ['.git', 'node_modules', 'vendor/**/**/.git', 'vendor/**/**/node_modules', 'vendor/**/**/vendor', 'vendor/**/**/Tests', 'vendor/**/**/tests', 'vendor/**/**/Test', 'vendor/**/**/test'];
     (new Collection($directories))->map(function ($directory) use($root) {
         return $this->filesystem->glob($root . '/' . $directory, GLOB_ONLYDIR);
     })->collapse()->each(function ($directory) {
         $this->filesystem->deleteDirectory($directory);
         $this->error('delete directory: ' . $directory);
     });
 }
开发者ID:recca0120,项目名称:laravel-terminal,代码行数:16,代码来源:Cleanup.php

示例12: findPlugins

 /**
  * @return mixed
  */
 private function findPlugins()
 {
     $directories = $this->filesystem->directories($this->config->get('plugins.path'));
     return Collection::make($directories)->reduce(function (&$initial, $directory) {
         $files = $this->filesystem->glob($directory . '/*.php');
         foreach ($files as $file) {
             $plugin = $this->get_plugin_data($file);
             if (!empty($plugin['Title']) && !empty($plugin['Version'])) {
                 $plugin['Name'] = basename($directory);
                 $initial[] = $this->transformWPPluginToPlugin($plugin);
             }
         }
         return $initial;
     }, []);
 }
开发者ID:Zae,项目名称:wp-vulnerabilities,代码行数:18,代码来源:Files.php

示例13: getTranslationFilenamesFromPaths

 /**
  * Get all of the names of the Translations files from an array of Paths.
  * Returns [ 'translationkeyprefix' => 'filepath' ]
  * @param array $paths
  * @return array
  */
 protected function getTranslationFilenamesFromPaths(array $paths)
 {
     $files = [];
     $locales = config('laravellocalization.supportedLocales');
     foreach ($paths as $hint => $path) {
         foreach ($locales as $locale => $language) {
             foreach ($this->finder->glob("{$path}/{$locale}/*.php") as $file) {
                 $category = str_replace(["{$path}/", ".php", "{$locale}/"], "", $file);
                 $category = str_replace("/", ".", $category);
                 $category = !is_int($hint) ? "{$hint}::{$category}" : $category;
                 $files[$locale][$category] = $file;
             }
         }
     }
     return $files;
 }
开发者ID:arytest,项目名称:Translation,代码行数:22,代码来源:FileTranslationRepository.php

示例14: decompress

 /**
  * Decompress archive and delete non-used files.
  *
  * @return void
  */
 protected function decompress()
 {
     $directory = dirname($this->archivePath);
     $this->externalCommand("tar zxf {$this->archivePath}", $directory);
     $specifics = [file_build_path($directory, 'index.html'), file_build_path($directory, 'all_english.html'), $this->archivePath];
     $this->filesystem->delete(array_merge($this->filesystem->glob(file_build_path($directory, '*e.html')), $this->getOldFiles($directory), $specifics));
 }
开发者ID:BePsvPT,项目名称:CCU-Plus,代码行数:12,代码来源:DownloadCourseArchive.php

示例15: cleanupVendor

 /**
  * cleanupVendor.
  *
  * @method cleanupVendor
  *
  * @param string $vendorDirectory
  */
 public function cleanupVendor($vendorDirectory)
 {
     $rules = static::getRules();
     foreach ($rules as $packageDir => $rules) {
         $packageDir = $vendorDirectory . '/' . $packageDir;
         if ($this->filesystem->isDirectory($packageDir) === false) {
             continue;
         }
         foreach ((array) $rules as $part) {
             $patterns = explode(' ', trim($part));
             foreach ($patterns as $pattern) {
                 $this->delete($this->filesystem->glob($packageDir . '/' . $pattern));
             }
         }
     }
 }
开发者ID:recca0120,项目名称:terminal,代码行数:23,代码来源:Cleanup.php


注:本文中的Illuminate\Filesystem\Filesystem::glob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。