/** * 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!'); }
/** * 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"); } }
/** * 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."); }
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; }
/** * 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); } }
/** * Execute the console command. */ public function fire() { $this->files->delete($this->app->getPath('build') . 'config.php'); $this->info('Configuration cache cleared!'); }