Get the internal compiler in use.

@return BladeCompiler
769160
private function getCompiler(): BladeCompiler
    {
        if ($this->compiler) {
            return $this->compiler;
        }

        if (!is_dir($this->cache)) {
            mkdir($this->cache, 0777, true);
        }

        $blade = new BladeCompiler(new Filesystem(), $this->cache);

        $this->directives->register($blade);

        $this->compiler = $blade;

        return $this->compiler;
    }
1071752
protected function extendBlade() {
        $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();

        $blade->extend(function($value) use ($blade)
        {
            return $this->compileBlade($value, $blade);
        });
    }
51493
protected function compileClasses()
    {
        $preloader = (new Factory())->create(['skip' => true]);

        $path = $this->laravel->getCachedCompilePath();

        if (file_exists($path)) {
            unlink($path);
        }

        $handle = $preloader->prepareOutput($path . '.tmp');

        foreach ($this->getClassFiles() as $file) {
            try {
                fwrite($handle, $preloader->getCode($file, false) . "\n");
            } catch (SkipFileException $ex) {
                // Class Preloader 2.x
            } catch (VisitorExceptionInterface $e) {
                // Class Preloader 3.x
            } catch (RuntimeException $e) {
                // Handle when fwrite fails.
            }
        }

        fclose($handle);

        rename($path . '.tmp', $path);
    }
560212
public function compile() {
        if ($this->isCompiled()) {
            return $this->_compiled;
        }

        $g11n = G11n::registry();

        if ($g11n->isEnabled()) {
            if (mb_substr($this->getPath(), 0, 9) !== '/<locale>') {
                $this->prepend('/<locale>');
            }

            $this->setConfig('patterns.locale', self::LOCALE);
            $this->setConfig('locale', G11n::canonicalize($g11n->getFallback()->getCode()));
        }

        return parent::compile();
    }
907980
protected function getContainerBuilder()
    {
        $container = new ContainerBuilder();
        $container->getParameterBag()->add($this->getKernelParameters());

        if ($this instanceof CompilerPassInterface) {
            $container->addCompilerPass($this, PassConfig::TYPE_BEFORE_OPTIMIZATION, -10000);
        }
        if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator')) {
            $container->setProxyInstantiator(new RuntimeInstantiator());
        }

        return $container;
    }
884320
public function getCompileDir()
    {
        if ($this->compileDir === null) {
            $this->setCompileDir(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'compiled' . DIRECTORY_SEPARATOR);
        }

        return $this->compileDir;
    }
1075905
public function getCompiler(): SQL\Compiler
    {
        if ($this->compiler === null) {
            switch ($this->getDriver()) {
                case 'mysql':
                    $this->compiler = new SQL\Compiler\MySQL();
                    break;
                case 'dblib':
                case 'mssql':
                case 'sqlsrv':
                case 'sybase':
                    $this->compiler = new SQL\Compiler\SQLServer();
                    break;
                case 'oci':
                case 'oracle':
                    $this->compiler = new SQL\Compiler\Oracle();
                    break;
                case 'firebird':
                    $this->compiler = new SQL\Compiler\Firebird();
                    break;
                case 'db2':
                case 'ibm':
                case 'odbc':
                    $this->compiler = new SQL\Compiler\DB2();
                    break;
                case 'nuodb':
                    $this->compiler = new SQL\Compiler\NuoDB();
                    break;
                default:
                    $this->compiler = new SQL\Compiler();
            }

            $this->compiler->setOptions($this->compilerOptions);
        }

        return $this->compiler;
    }
473130
public function registerBladeEngine($resolver)
    {
        // The Compiler engine requires an instance of the CompilerInterface, which in
        // this case will be the Blade compiler, so we'll first create the compiler
        // instance to pass into the engine so it can compile the views properly.
        $this->container['blade.compiler'] = function ($container) {
            return new BladeCompiler($container['config']->get('view.compiled'));
        };

        $resolver->register('blade', function () {
            return new CompilerEngine($this->container['blade.compiler']);
        });
    }
465772
public function getDefaultBlade(): ?BladeCompiler
    {
        // The blade compiler is usually only available, once
        // Laravel's view service provider has been initialised.
        // Thus, before just returning the Blade Facade's root
        // instance, we must make sure that the view facade
        // actually returns something
        $view = View::getFacadeRoot();
        if (isset($view)) {
            return Blade::getFacadeRoot();
        }
        return $view;
    }
492406
public function getProcessor()
    {
        if (null === $this->processor) {
            if (null !== $this->width) {
                return self::PROCESSOR_FIXED;
            }

            return self::PROCESSOR_DYNAMIC;
        }

        return $this->processor;
    }
1159158
public function compile()
    {
        $compiled = $this->command;

        // If callable, return the function itself
        if (is_callable($compiled)) {
            return $compiled;
        }

        // Augment with any supplied arguments
        foreach ($this->args as $key => $value) {
            $compiled .= ' ' . escapeshellarg($key);
            if ($value !== null) {
                $compiled .= ' ' . escapeshellarg($value);
            }
        }

        // Add the boilerplate to redirect the output to file/s
        if (count($this->outputTo) > 0) {
            $compiled .= ' | tee ';
            $compiled .= $this->outputMode === 'a' ? '-a ' : '';
            foreach ($this->outputTo as $file) {
                $compiled .= $file . ' ';
            }

            $compiled = trim($compiled);
        }

        // Add boilerplate to remove lockfile after execution
        if ($this->lockFile) {
            $compiled .= '; rm ' . $this->lockFile;
        }

        // Add boilerplate to run in background
        if ($this->canRunInBackground()) {
            // Parentheses are need execute the chain of commands in a subshell
            // that can then run in background
            $compiled = '(' . $compiled . ') > /dev/null 2>&1 &';
        }

        return trim($compiled);
    }
558792
protected function getEngine()
    {
        Template::addPath(dirname(__DIR__).'/templates');
        $template = new Template();
        $template->addExtension(HtmlExtension::class);
        return $template->initialize();
    }
1146081
public function getCompiledConfig()
    {
        if ($this->compiled_config === null) {
            // see if template needs compiling.
            if ($this->mustCompile()) {
                $this->compileConfigSource();
            } else {
                $this->compiled_config = file_get_contents($this->getCompiledFilepath());
            }
        }

        return $this->compiled_config;
    }
294651
public function getCompiledFilepath()
    {
        return $this->compiled_filepath === null ?
                ($this->compiled_filepath = $this->buildCompiledFilepath()) :
                $this->compiled_filepath;
    }
1007530
public function mustCompile()
    {
        return $this->mustCompile === null ?
            $this->mustCompile = ($this->smarty->force_compile || $this->getCompiledTimestamp () === false || $this->smarty->compile_check && $this->getCompiledTimestamp () < $this->source->timestamp):
            $this->mustCompile;
    }
1319670
public function getCompiled()
    {
        if ($this->compiled === null) {
            $regexp = "/^";

            // Method(s)
            $methodIdx = 0;
            foreach($this->methods as $method) {
                $regexp .= "(?:" . strtoupper($method) . ")";
                if (($methodIdx + 1) < count($this->methods)) {
                    $regexp .= "|";
                }
                $methodIdx++;
            }

            // Separator
            $regexp .= "~";

            // Url
            $regexp .= str_replace('/', '\/', $this->match);

            $regexp .= "$/";

            $this->compiled = $regexp;
        }
        return $this->compiled;
    }
653190
protected function getOrMakeTargetInstance()
    {
        if ($this->target) {
            return $this->target;
        }

        $this->target = new InterpolatingTarget(
            $this->interpolator,
            $this,
            $this->config->path(),
            $this->config->variantPath()
        );

        $this->target->setVariantFilenames($this->variantFilenames());
        $this->target->setVariantExtensions($this->variantExtensions());

        return $this->target;
    }