當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Filesystem::isDirectory方法代碼示例

本文整理匯總了PHP中Illuminate\Filesystem\Filesystem::isDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Filesystem::isDirectory方法的具體用法?PHP Filesystem::isDirectory怎麽用?PHP Filesystem::isDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Filesystem\Filesystem的用法示例。


在下文中一共展示了Filesystem::isDirectory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getExtensions

 /**
  * Extension list.
  *
  * @return \Illuminate\Support\Collection
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
  */
 public function getExtensions()
 {
     if ($this->extensions->isEmpty()) {
         if ($this->files->isDirectory($this->getExtensionPath()) && !empty($vendors = $this->files->directories($this->getExtensionPath()))) {
             collect($vendors)->each(function ($vendor) {
                 if ($this->files->isDirectory($vendor) && !empty($directories = $this->files->directories($vendor))) {
                     collect($directories)->each(function ($directory) {
                         if ($this->files->exists($file = $directory . DIRECTORY_SEPARATOR . 'composer.json')) {
                             $package = new Collection(json_decode($this->files->get($file), true));
                             if (Arr::get($package, 'type') == 'notadd-extension' && ($name = Arr::get($package, 'name'))) {
                                 $extension = new Extension($name);
                                 $extension->setAuthor(Arr::get($package, 'authors'));
                                 $extension->setDescription(Arr::get($package, 'description'));
                                 if ($entries = data_get($package, 'autoload.psr-4')) {
                                     foreach ($entries as $namespace => $entry) {
                                         $extension->setEntry($namespace . 'Extension');
                                     }
                                 }
                                 $this->extensions->put($directory, $extension);
                             }
                         }
                     });
                 }
             });
         }
     }
     return $this->extensions;
 }
開發者ID:notadd,項目名稱:framework,代碼行數:34,代碼來源:ExtensionManager.php

示例2: createModulesDir

 /**
  * Creates the modules directory if it doesn't already exist.
  */
 protected function createModulesDir()
 {
     $path = base_path('Modules');
     if (!$this->filesystem->isDirectory($path)) {
         $this->filesystem->makeDirectory($path);
     }
 }
開發者ID:mrterryh,項目名稱:modules,代碼行數:10,代碼來源:ModuleGenerator.php

示例3: makeDir

 /**
  * Make directory.
  *
  * @param  string $directory
  * @return void
  */
 protected function makeDir($directory)
 {
     if (!$this->files->isDirectory($directory)) {
         $this->info('Creating directory ' . $directory);
         $this->files->makeDirectory($directory, 0777, true);
     }
 }
開發者ID:pampdev,項目名稱:certbuilder,代碼行數:13,代碼來源:CertificatesTemplate.php

示例4: publish

 /**
  * Publishes all themes files in the given package to their
  * respective themes.
  *
  * @param  string  $source
  * @return bool
  * @throws \InvalidArgumentException
  * @throws \RuntimeException
  */
 public function publish($source)
 {
     if (!$this->filesystem->isDirectory($source)) {
         throw new InvalidArgumentException("Source [{$source}] does not exist.");
     }
     $paths = $this->getThemeSourcePaths($source);
     foreach ($paths as $path) {
         $relativePath = str_replace(str_finish($source, '/'), '', $path);
         $slugs = $this->extractSlugsFromPath($relativePath);
         // If we cannot resolve a theme, the user has probably got assets
         // for a theme which isn't in this installation. Let's not punish
         // them for supporting more than the installed themes, we'll just
         // let them know we've skipped it.
         try {
             $theme = $this->getThemeForSlugs($slugs);
         } catch (RuntimeException $e) {
             $this->note(sprintf('Couln\'t load theme for slug(s) [%s] in source [%s], skipping.', implode(', ', $slugs), $source));
             continue;
         }
         $mappings = $this->getCopyMappings($path, $theme);
         foreach ($mappings as $_source => $destination) {
             $success = $this->filesystem->copyDirectory($_source, $destination);
             if (!$success) {
                 throw new RuntimeException("Failed to publish [{$_source}] to [{$destination}].");
             }
         }
     }
     return true;
 }
開發者ID:sohailaammarocs,項目名稱:lfc,代碼行數:38,代碼來源:ThemePublisher.php

示例5: createDirectory

 protected function createDirectory()
 {
     $directory = $this->getDirectory();
     if (!$this->files->isDirectory($directory)) {
         $this->files->makeDirectory($directory, 0755, true);
     }
 }
開發者ID:samkitano,項目名稱:repository,代碼行數:7,代碼來源:RepositoryCreator.php

示例6: makeDir

 /**
  * Make directory.
  *
  * @param  string $directory
  * @return void
  */
 protected function makeDir($directory)
 {
     if (!$this->files->isDirectory($this->getPath($directory))) {
         $this->info('Createing directory ' . $this->getPath($directory));
         $this->files->makeDirectory($this->getPath($directory), 0777, true);
     }
 }
開發者ID:pampdev,項目名稱:certbuilder,代碼行數:13,代碼來源:CertificatesSetup.php

示例7: makeDir

 /**
  * Create dir if does not exists !
  *
  * @param $directory
  * @return bool
  */
 public function makeDir($directory)
 {
     if (!$this->filesystem->isDirectory($directory)) {
         return $this->filesystem->makeDirectory($directory);
     }
     return false;
 }
開發者ID:ionutmilica,項目名稱:themes,代碼行數:13,代碼來源:AbstractMakeCommand.php

示例8: getModules

 /**
  * Modules of installed or not installed.
  *
  * @param bool $installed
  *
  * @return \Illuminate\Support\Collection
  */
 public function getModules($installed = false)
 {
     if ($this->modules->isEmpty()) {
         if ($this->files->isDirectory($this->getModulePath()) && !empty($directories = $this->files->directories($this->getModulePath()))) {
             (new Collection($directories))->each(function ($directory) use($installed) {
                 if ($this->files->exists($file = $directory . DIRECTORY_SEPARATOR . 'composer.json')) {
                     $package = new Collection(json_decode($this->files->get($file), true));
                     if (Arr::get($package, 'type') == 'notadd-module' && ($name = Arr::get($package, 'name'))) {
                         $module = new Module($name);
                         $module->setAuthor(Arr::get($package, 'authors'));
                         $module->setDescription(Arr::get($package, 'description'));
                         if ($installed) {
                             $module->setInstalled($installed);
                         }
                         if ($entries = data_get($package, 'autoload.psr-4')) {
                             foreach ($entries as $namespace => $entry) {
                                 $module->setEntry($namespace . 'ModuleServiceProvider');
                             }
                         }
                         $this->modules->put($directory, $module);
                     }
                 }
             });
         }
     }
     return $this->modules;
 }
開發者ID:notadd,項目名稱:framework,代碼行數:34,代碼來源:ModuleManager.php

示例9: createMissingController

 /**
  * @param Request $request
  * @return mixed
  * @throws \Exception
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
  */
 public function createMissingController(Request $request)
 {
     $namespace = $request->namespace;
     $controller = $request->controller;
     $module = $request->module;
     //Get controllers folder
     $controllersDir = $this->getMainControllerPath();
     //Get controller path for new controller
     $newControllerDir = $this->getControllerPath($namespace, $module);
     //Get controller namespace
     $controllerNamespace = $this->getMainControllerNamespace();
     //Get namespace for the new controller
     $newControllerNamespace = $this->getControllerNamespace($namespace, $module);
     //Get the file
     $file = $this->getFileLocation($namespace, $module, $controller);
     $controllerClass = studly_case($controller . 'Controller');
     //Check if file exists
     $fileExists = $this->fileExists($file);
     //Check if is dir
     if (!$this->fs->isDirectory($newControllerDir)) {
         $this->fs->makeDirectory($newControllerDir, 0755, true, true);
     }
     //If file doesnt exist, create the file
     if (!$fileExists) {
         $template = $this->builder->setNamespace($newControllerNamespace)->setTemplate($this->fs->get($this->config['templates']['controller']))->setClassName(studly_case($controllerClass))->setUses(Request::class)->buildController();
         //Store the file
         $this->fs->put($file, $template);
         //Call the created controller
         return app($newControllerNamespace . '\\' . $controllerClass)->index();
     }
     throw new \Exception('File exists! I don\'t want to override it!');
 }
開發者ID:donny5300,項目名稱:modulair-router,代碼行數:38,代碼來源:ControllerNotFoundExceptionController.php

示例10: makeDirectory

 /**
  * Create the directory for the controller.
  *
  * @param  string  $controller
  * @param  string  $path
  * @return void
  */
 protected function makeDirectory($controller, $path)
 {
     $directory = $this->getDirectory($controller);
     if (!$this->files->isDirectory($full = $path . '/' . $directory)) {
         $this->files->makeDirectory($full, 0777, true);
     }
 }
開發者ID:flelievre,項目名稱:EasyVisit,代碼行數:14,代碼來源:ControllerGenerator.php

示例11: save

 public function save($item, $value, $environment, $group, $namespace = null)
 {
     $path = DIR_APPLICATION . '/config/generated_overrides';
     if (!$this->files->exists($path)) {
         $this->files->makeDirectory($path, 0777);
     } elseif (!$this->files->isDirectory($path)) {
         $this->files->delete($path);
         $this->files->makeDirectory($path, 0777);
     }
     if ($namespace) {
         $path = "{$path}/{$namespace}";
         if (!$this->files->exists($path)) {
             $this->files->makeDirectory($path, 0777);
         } elseif (!$this->files->isDirectory($path)) {
             $this->files->delete($path);
             $this->files->makeDirectory($path, 0777);
         }
     }
     $file = "{$path}/{$group}.php";
     $current = array();
     if ($this->files->exists($file)) {
         $current = $this->files->getRequire($file);
     }
     array_set($current, $item, $value);
     $renderer = new Renderer($current);
     return $this->files->put($file, $renderer->render()) !== false;
 }
開發者ID:meixelsberger,項目名稱:concrete5-5.7.0,代碼行數:27,代碼來源:FileSaver.php

示例12: makeDirectory

 /**
  * Build the directory for the view if necessary.
  *
  * @param $path
  */
 private function makeDirectory($path)
 {
     $dir = dirname($path);
     if (!$this->files->isDirectory($dir)) {
         $this->files->makeDirectory($dir, 0777, true, true);
     }
 }
開發者ID:AlexanderZon,項目名稱:proyecto_crister,代碼行數:12,代碼來源:ViewMakeCommand.php

示例13: it_should_generate_module_folder

 /** @test */
 public function it_should_generate_module_folder()
 {
     // Run
     $this->scaffoldModuleWithEloquent();
     // Assert
     $this->assertTrue($this->finder->isDirectory($this->testModulePath));
     $this->cleanUp();
 }
開發者ID:Houbsi,項目名稱:Workshop,代碼行數:9,代碼來源:ModuleScaffoldTest.php

示例14: tearDown

 public function tearDown()
 {
     $this->finder->deleteDirectory($this->modulePath);
     if ($this->finder->isDirectory(base_path('modules/ModuleName'))) {
         $this->finder->deleteDirectory(base_path('modules/ModuleName'));
     }
     parent::tearDown();
 }
開發者ID:nwidart,項目名稱:laravel-modules,代碼行數:8,代碼來源:ModuleGeneratorTest.php

示例15: parse

 /**
  * Parse some content.
  *
  * @param $content
  * @return string
  */
 public function parse($content)
 {
     if (!$this->files->isDirectory($path = storage_path('framework/views/asset'))) {
         $this->files->makeDirectory($path);
     }
     $this->files->put(storage_path('framework/views/asset/' . (($filename = md5($content)) . '.twig')), $content);
     return $this->views->make('root::storage/framework/views/asset/' . $filename)->render();
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:14,代碼來源:AssetParser.php


注:本文中的Illuminate\Filesystem\Filesystem::isDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。