protected static function generateIfRequired()
 {
     $fs = new Filesystem();
     if (!isset(static::$values) || !isset(static::$records)) {
         static::$values = json_decode($fs->get(Path::join(__DIR__, 'data/values.json')), true)[0];
         static::$records = json_decode($fs->get(Path::join(__DIR__, 'data/records.json')), true);
     }
 }
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $path = config('database.connections.sqlite.database');
     $fs = new Filesystem();
     if (!$fs->exists($path)) {
         $fs->touch($path);
     }
 }
Example #3
0
 protected function copyDefaultConfigurationFiles(Application $app)
 {
     $fs = new Filesystem();
     $files = Finder::create()->files()->name('*.php')->in(Path::join(__DIR__, '..', '..', 'app', 'config'))->files();
     foreach ($files as $file) {
         $dest = Path::join($app->configPath(), $file->getRelativePathname());
         $fs->copy($file->getPathname(), $dest);
     }
 }
 public function bootstrap(Application $app)
 {
     $fs = new Filesystem();
     if ($fs->exists($app->getCachedServicesPath())) {
         $fs->remove($app->getCachedServicesPath());
     }
     if ($fs->exists($app->getCachedCompilePath())) {
         $fs->remove($app->getCachedCompilePath());
     }
 }
 /**
  * render
  *
  * @param       $string
  * @param array $vars
  * @return string
  */
 public function render($string, array $vars = array())
 {
     $this->files->put($this->tmpFilePath, $this->compiler->compileString($string));
     if (is_array($vars) && !empty($vars)) {
         extract($vars);
     }
     ob_start();
     include $this->tmpFilePath;
     $var = ob_get_contents();
     ob_end_clean();
     $this->files->delete($this->tmpFilePath);
     return $var;
 }
 /**
  * bootstrap method
  *
  * @param \Raphaelb\Foundation\Application $app
  *
  * @return mixed
  */
 public function bootstrap(Application $app)
 {
     $items = [];
     /** @var \Illuminate\Filesystem\Filesystem $fs */
     $fs = new Filesystem();
     $app->instance('config', $config = new Repository($items));
     foreach ($fs->files($app->getConfigPath()) as $file) {
         $config->set(Path::getFilenameWithoutExtension($file), $fs->getRequire($file));
     }
     // Foreach loop for .phar file.
     //  foreach (scandir($app->getConfigPath()) as $file )
     //  {
     //      $config->set(
     //          Path::getFilenameWithoutExtension($file),
     //          $fs->getRequire($app->getConfigPath() . '/' .$file)
     //      );
     //  }
     return $config;
 }
Example #7
0
 /**
  * Set the cachePath value
  *
  * @param mixed $cachePath
  *
  * @return Blade
  */
 public function setCachePath($cachePath)
 {
     $this->cachePath = $cachePath;
     $this->compiler = new BladeCompiler(Filesystem::create(), $this->cachePath);
     return $this;
 }
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $fs = new Filesystem();
     $fs->copyDirectory(app_path(), export_path());
 }
 protected function ensureDirectory($path)
 {
     if (!$this->fs->exists($path)) {
         $this->fs->makeDirectory($path, 0755, true);
     }
 }