コード例 #1
0
 /**
  * Compile views.
  *
  * @param  array  $paths
  * @param  string $storagePath
  * @return $this
  */
 public function compileViews(array $paths, $storagePath)
 {
     $this->makeDestination($storagePath);
     $compiler = new BladeCompiler($this->files, $storagePath);
     foreach ($paths as $path) {
         $files = $this->files->glob(realpath($path) . '/{,**/}*.php', GLOB_BRACE);
         foreach ($files as $file) {
             if (!Str::endsWith(strtolower($file), '.blade.php')) {
                 continue;
             }
             $compiler->setPath($file);
             $contents = $this->parseToken($this->files->get($file));
             $contents = $compiler->compileString($contents);
             $compiledPath = $compiler->getCompiledPath($compiler->getPath());
             $this->files->put($compiledPath . '.php', $contents);
         }
     }
     return $this;
 }
コード例 #2
0
 public function handle()
 {
     $this->info('start view compiler');
     $targetDir = storage_path(config('trans.view_store_path'));
     if (!file_exists($targetDir)) {
         $this->createDirectory($targetDir);
         $this->comment('created directory ' . $targetDir);
     }
     $path = base_path(config('trans.view_blade_path'));
     $fs = new Filesystem($path);
     $files = $fs->allFiles(realpath($path));
     $compiler = new BladeCompiler($fs, $targetDir);
     foreach ($files as $file) {
         $filePath = $file->getRealPath();
         $this->comment('compile view: ' . $filePath);
         $compiler->setPath($filePath);
         $contents = $compiler->compileString($fs->get($filePath));
         $compiledPath = $compiler->getCompiledPath($compiler->getPath());
         $fs->put($compiledPath . '.php', $contents);
     }
 }
コード例 #3
0
ファイル: _ide_helper.php プロジェクト: satriashp/tour
 /**
  * Get the path to the compiled version of a view.
  *
  * @param string $path
  * @return string 
  * @static 
  */
 public static function getCompiledPath($path)
 {
     //Method inherited from \Illuminate\View\Compilers\Compiler
     return \Illuminate\View\Compilers\BladeCompiler::getCompiledPath($path);
 }
コード例 #4
0
ファイル: BladeCompiler.php プロジェクト: netson/l4gettext
 /**
  * method just adds extension .php to parents' compiled path
  *
  * @param string $path
  * @return string
  */
 public function getCompiledPath($path)
 {
     return parent::getCompiledPath($path) . ".php";
 }