当前位置: 首页>>代码示例>>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;未经允许,请勿转载。