Esempio n. 1
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $this->call('config:clear');
     $config = $this->getFreshConfiguration();
     $this->files->put($this->app->getPath('build') . 'config.php', '<?php return ' . var_export($config, true) . ';' . PHP_EOL);
     $this->info('Configuration cached successfully!');
 }
Esempio n. 2
0
 /**
  * Get the migration stub file.
  *
  * @param string $table
  * @param bool   $stub
  *
  * @return string
  */
 protected function getStub($table, $stub = null)
 {
     if (is_null($table) || is_null($stub)) {
         return $this->files->get($this->getStubPath() . '/blank.stub');
     } else {
         // We also have stubs for creating new tables and modifying existing tables
         // to save the developer some typing when they are creating a new tables
         // or modifying existing tables. We'll grab the appropriate stub here.
         return $this->files->get($this->getStubPath() . "/{$stub}.stub");
     }
 }
Esempio n. 3
0
 /**
  * Find the given view in the list of paths.
  *
  * @param string $name
  * @param array  $paths
  *
  * @throws \InvalidArgumentException
  *
  * @return string
  */
 public function findInPaths($name, $paths)
 {
     foreach ((array) $paths as $path) {
         foreach ($this->getPossibleViewFiles($name) as $file) {
             if ($this->files->exists($viewPath = $path . '/' . $file)) {
                 return $viewPath;
             }
         }
     }
     throw new InvalidArgumentException("View [{$name}] not found.");
 }
Esempio n. 4
0
 protected function getCompileFiles($location)
 {
     $files = [];
     if ($this->files->exists($location)) {
         $extension = $this->files->extension($location);
         if ($extension == 'php') {
             return include $location;
         }
         $paths = $this->files->get($location);
         $paths = explode("\n", $paths);
         $paths = array_unique($paths);
         foreach ($paths as $file) {
             if (!empty($file) && substr($file, 0, 1) !== '#') {
                 $files[] = $file;
             }
         }
     }
     return $files;
 }
Esempio n. 5
0
 /**
  * Create the directory to house the published files if needed.
  *
  * @param string $directory
  */
 protected function createParentDirectory($directory)
 {
     if (!$this->files->isDirectory($directory)) {
         $this->files->makeDirectory($directory, 0755, true);
     }
 }
Esempio n. 6
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $this->files->delete($this->app->getPath('build') . 'config.php');
     $this->info('Configuration cache cleared!');
 }