當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。