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


PHP Filesystem::makeDirectory方法代码示例

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


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

示例1: createTmpDir

 private function createTmpDir($dir)
 {
     if (!$this->filesystem->exists($dir)) {
         $this->filesystem->makeDirectory($dir, 0755, true);
     }
     return true;
 }
开发者ID:filmoteca,项目名称:filmoteca,代码行数:7,代码来源:DeployCommand.php

示例2: 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

示例3: createDirectory

 protected function createDirectory()
 {
     $directory = $this->getDirectory();
     if (!$this->files->isDirectory($directory)) {
         $this->files->makeDirectory($directory, 0755, true);
     }
 }
开发者ID:samkitano,项目名称:repository,代码行数:7,代码来源:RepositoryCreator.php

示例4: 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

示例5: 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

示例6: makeDirectory

 protected function makeDirectory($path)
 {
     if (!($status = $this->files->makeDirectory($path))) {
         return $this->files->makeDirectory(dirname($path), 0777, true, true);
     }
     return $status;
 }
开发者ID:HOuaghad,项目名称:multilayering,代码行数:7,代码来源:MakeHttpLayer.php

示例7: 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

示例8: setUp

 public function setUp()
 {
     $this->loader = new FileLoader($this->files = new Filesystem());
     $this->group = md5(time() . uniqid());
     $this->namespace = md5(time() . uniqid());
     $this->environment = md5(time() . uniqid());
     $path = DIR_APPLICATION . '/config/';
     $this->loader->addNamespace($this->namespace, $path . $this->namespace);
     $paths = array("generated_overrides/{$this->group}.php" => array('non-namespaced' => true, 'override' => true, 'second' => false), "{$this->group}.php" => array('non-namespaced' => true, 'main_group' => true, 'second' => true, 'last' => false), "{$this->environment}.{$this->group}.php" => array('non-namespaced' => true, 'environment' => true, 'last' => true), "generated_overrides/{$this->namespace}/{$this->group}.php" => array('namespaced' => true, 'override' => true, 'second' => false), "{$this->namespace}/{$this->group}.php" => array('namespaced' => true, 'main_group' => true, 'second' => true, 'last' => false), "{$this->namespace}/{$this->environment}.{$this->group}.php" => array('namespaced' => true, 'environment' => true, 'last' => true));
     foreach ($paths as $relative_path => $array) {
         $split = explode('/', $relative_path);
         $current_path = $path;
         array_pop($split);
         foreach ($split as $directory) {
             $dir = "{$current_path}/{$directory}";
             if (!$this->files->exists($dir)) {
                 $this->files->makeDirectory($dir);
                 $this->to_remove[] = $dir;
             }
             $current_path = $dir;
         }
         $this->to_remove[] = $path . $relative_path;
         $this->files->put($path . $relative_path, id(new Renderer($array))->render());
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:25,代码来源:FileLoaderTest.php

示例9: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $model = ucfirst($this->argument('model'));
     $path = $this->option('path');
     if (empty($path)) {
         $path = database_path(config('smart-seeder.seedDir'));
     } else {
         $path = base_path($path);
     }
     $env = $this->option('env');
     if (!empty($env)) {
         $path .= "/{$env}";
     }
     if (!$this->files->exists($path)) {
         // mode 0755 is based on the default mode Laravel use.
         $this->files->makeDirectory($path, 755, true);
     }
     $created = date('Y_m_d_His');
     $path .= "/seed_{$created}_{$model}Seeder.php";
     $fs = $this->files->get(__DIR__ . '/stubs/DatabaseSeeder.stub');
     $namespace = rtrim($this->getAppNamespace(), '\\');
     $stub = str_replace('{{seeder}}', "seed_{$created}_" . $model . 'Seeder', $fs);
     $stub = str_replace('{{namespace}}', " namespace {$namespace};", $stub);
     $stub = str_replace('{{model}}', $model, $stub);
     $this->files->put($path, $stub);
     $message = "Seed created for {$model}";
     if (!empty($env)) {
         $message .= " in environment: {$env}";
     }
     $this->line($message);
 }
开发者ID:mtahv3,项目名称:SmartSeeder,代码行数:36,代码来源:SeedMakeCommand.php

示例10: 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

示例11: 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

示例12: 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

示例13: checkCacheDirectory

 /**
  * Check/Create cache directory
  */
 private function checkCacheDirectory()
 {
     if ($this->cachePath) {
         if (!$this->files->isDirectory($this->cachePath)) {
             $this->files->makeDirectory($this->cachePath);
         }
     }
 }
开发者ID:yhbyun,项目名称:avatar,代码行数:11,代码来源:Avatar.php

示例14: createDirectory

 /**
  * Create directory for anonymizers.
  *
  * @param string $dir
  */
 protected function createDirectory($dir)
 {
     if ($this->files->isDirectory($dir)) {
         $this->error("Directory {$dir} already exists");
         return;
     }
     $this->files->makeDirectory($dir);
 }
开发者ID:arrilot,项目名称:laravel-data-anonymization,代码行数:13,代码来源:AnonymizationInstallCommand.php

示例15: createFolders

 /**
  * Creates the module directory and other folders.
  */
 protected function createFolders()
 {
     $path = base_path('Modules/' . $this->name);
     $this->filesystem->makeDirectory($path);
     foreach ($this->foldersToGenerate as $folder) {
         $this->filesystem->makeDirectory($path . '/' . $folder);
     }
 }
开发者ID:mrterryh,项目名称:modules,代码行数:11,代码来源:ModuleGenerator.php


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