src/A1comms/GaeSupportLaravel/Console/GaeViewCompileCommand.php
/**
     * Execute the console command.
     *
     * @return void
     */
Execute the console command.
@return void
Execute the console command . @return void
public function handle()
    {
        $this->info("Blade Compiler: Startup...");
        $compiledDirectory = config('view.compiled', null);
        $viewPaths = config('view.paths', []);
        $hints = app('view')->getFinder()->getHints();
        foreach ($hints as $namespace => $paths) {
            $viewPaths = array_merge($paths, $viewPaths);
        }
        $this->info("Blade Compiler: Cleaning view storage directory (" . $compiledDirectory . ")...");
        $this->files->cleanDirectory($compiledDirectory);
        $this->files->put($compiledDirectory . "/.gitkeep", " ");
        $this->info("Blade Compiler: Cleaning view storage directory...done");
        for ($i = 0; $i < count($viewPaths); $i++) {
            $path = $viewPaths[$i];
            $relativePath = FileViewFinder::getRelativePath(base_path(), $path);
            $this->info("Blade Compiler: Compiling views in " . $relativePath . " (" . ($i+1) . "/" . count($viewPaths) . ")...");
            $files = $this->files->allFiles($path);
            for ($g = 0; $g < count($files); $g++) {
                $file = $files[$g];
                $filePath = $file->getPathname();
                $fileRelativePath = FileViewFinder::getRelativePath(base_path(), $filePath);
                if (!preg_match("/(.*)\.blade\.php$/", $filePath)) {
                    $this->info("Blade Compiler: \tSkipping view (" . ($g+1) . "/" . count($files) . ") " . $fileRelativePath);
                    continue;
                }
                $compiler = new BladeCompiler($this->files, $compiledDirectory);
                $compiledPath = $compiler->compile($filePath);
                $this->manifest[$fileRelativePath] = FileViewFinder::getRelativePath($compiledDirectory, $compiledPath);
                $this->info("Blade Compiler: \tCompiled view (" . ($g+1) . "/" . count($files) . ") " . $fileRelativePath);
            }
            $this->info("Blade Compiler: Compiling views in " . $relativePath . " (" . ($i+1) . "/" . count($viewPaths) . ")...done");
        }
        $this->writeManifest($compiledDirectory);
    }
public function handle ( ) { $ this -> info ( " Blade Compiler: Startup... " ) ; $ compiledDirectory = config ( 'view.compiled' , null ) ; $ viewPaths = config ( 'view.paths' , [ ] ) ; $ hints = app ( 'view' ) -> getFinder ( ) -> getHints ( ) ; foreach ( $ hints as $ namespace => $ paths ) { $ viewPaths = array_merge ( $ paths , $ viewPaths ) ; } $ this -> info ( " Blade Compiler: Cleaning view storage directory ( " . $ compiledDirectory . " )... " ) ; $ this -> files -> cleanDirectory ( $ compiledDirectory ) ; $ this -> files -> put ( $ compiledDirectory . " /.gitkeep " , " " ) ; $ this -> info ( " Blade Compiler: Cleaning view storage directory...done " ) ; for ( $ i = 0 ; $ i < count ( $ viewPaths ) ; $ i ++ ) { $ path = $ viewPaths [ $ i ] ; $ relativePath = FileViewFinder :: getRelativePath ( base_path ( ) , $ path ) ; $ this -> info ( " Blade Compiler: Compiling views in  " . $ relativePath . "  ( " . ( $ i + 1 ) . " / " . count ( $ viewPaths ) . " )... " ) ; $ files = $ this -> files -> allFiles ( $ path ) ; for ( $ g = 0 ; $ g < count ( $ files ) ; $ g ++ ) { $ file = $ files [ $ g ] ; $ filePath = $ file -> getPathname ( ) ; $ fileRelativePath = FileViewFinder :: getRelativePath ( base_path ( ) , $ filePath ) ; if ( ! preg_match ( " /(.*)\.blade\.php$/ " , $ filePath ) ) { $ this -> info ( " Blade Compiler:  \t Skipping view ( " . ( $ g + 1 ) . " / " . count ( $ files ) . " )  " . $ fileRelativePath ) ; continue ; } $ compiler = new BladeCompiler ( $ this -> files , $ compiledDirectory ) ; $ compiledPath = $ compiler -> compile ( $ filePath ) ; $ this -> manifest [ $ fileRelativePath ] = FileViewFinder :: getRelativePath ( $ compiledDirectory , $ compiledPath ) ; $ this -> info ( " Blade Compiler:  \t Compiled view ( " . ( $ g + 1 ) . " / " . count ( $ files ) . " )  " . $ fileRelativePath ) ; } $ this -> info ( " Blade Compiler: Compiling views in  " . $ relativePath . "  ( " . ( $ i + 1 ) . " / " . count ( $ viewPaths ) . " )...done " ) ; } $ this -> writeManifest ( $ compiledDirectory ) ; }
Execute the console command.
Execute the console command .