public function compileCommand(bool $force = false)
    {
        /** @var VariableFrontend $objectConfigurationCache */
        $objectConfigurationCache = $this->cacheManager->getCache('Flow_Object_Configuration');
        if ($force === false) {
            if ($objectConfigurationCache->has('allCompiledCodeUpToDate')) {
                return;
            }
        }

        /** @var PhpFrontend $classesCache */
        $classesCache = $this->cacheManager->getCache('Flow_Object_Classes');
        $logger = $this->objectManager->get(PsrLoggerFactoryInterface::class)->get('systemLogger');

        $this->proxyClassCompiler->injectClassesCache($classesCache);

        $this->aopProxyClassBuilder->injectObjectConfigurationCache($objectConfigurationCache);
        $this->aopProxyClassBuilder->injectLogger($logger);
        $this->dependencyInjectionProxyClassBuilder->injectLogger($logger);
        $this->aopProxyClassBuilder->build();
        $this->dependencyInjectionProxyClassBuilder->build();

        $classCount = $this->proxyClassCompiler->compile();

        $dataTemporaryPath = $this->environment->getPathToTemporaryDirectory();
        Files::createDirectoryRecursively($dataTemporaryPath);
        file_put_contents($dataTemporaryPath . 'AvailableProxyClasses.php', $this->proxyClassCompiler->getStoredProxyClassMap());

        $objectConfigurationCache->set('allCompiledCodeUpToDate', true);

        $classesCacheBackend = $classesCache->getBackend();
        if ($this->bootstrap->getContext()->isProduction() && $classesCacheBackend instanceof FreezableBackendInterface) {
            /** @var FreezableBackendInterface $backend */
            $backend = $classesCache->getBackend();
            $backend->freeze();
        }

        $this->emitFinishedCompilationRun($classCount);
    }
public function compileCommand(bool $force = false)
    {
        /** @var VariableFrontend $objectConfigurationCache */
        $objectConfigurationCache = $this->cacheManager->getCache('Flow_Object_Configuration');
        if ($force === false) {
            if ($objectConfigurationCache->has('allCompiledCodeUpToDate')) {
                return;
            }
        }

        /** @var PhpFrontend $classesCache */
        $classesCache = $this->cacheManager->getCache('Flow_Object_Classes');
        $logger = $this->objectManager->get(PsrLoggerFactoryInterface::class)->get('systemLogger');

        $this->proxyClassCompiler->injectClassesCache($classesCache);

        $this->aopProxyClassBuilder->injectObjectConfigurationCache($objectConfigurationCache);
        $this->aopProxyClassBuilder->injectLogger($logger);
        $this->dependencyInjectionProxyClassBuilder->injectLogger($logger);
        $this->aopProxyClassBuilder->build();
        $this->dependencyInjectionProxyClassBuilder->build();

        $classCount = $this->proxyClassCompiler->compile();

        $dataTemporaryPath = $this->environment->getPathToTemporaryDirectory();
        Files::createDirectoryRecursively($dataTemporaryPath);
        file_put_contents($dataTemporaryPath . 'AvailableProxyClasses.php', $this->proxyClassCompiler->getStoredProxyClassMap());

        $objectConfigurationCache->set('allCompiledCodeUpToDate', true);

        $classesCacheBackend = $classesCache->getBackend();
        if ($this->bootstrap->getContext()->isProduction() && $classesCacheBackend instanceof FreezableBackendInterface) {
            /** @var FreezableBackendInterface $backend */
            $backend = $classesCache->getBackend();
            $backend->freeze();
        }

        $this->emitFinishedCompilationRun($classCount);
    }
public function compileCommand ( bool $ force = false ) { /** @var VariableFrontend $objectConfigurationCache */ $ objectConfigurationCache = $ this -> cacheManager -> getCache ( 'Flow_Object_Configuration' ) ; if ( $ force === false ) { if ( $ objectConfigurationCache -> has ( 'allCompiledCodeUpToDate' ) ) { return ; } } /** @var PhpFrontend $classesCache */ $ classesCache = $ this -> cacheManager -> getCache ( 'Flow_Object_Classes' ) ; $ logger = $ this -> objectManager -> get ( PsrLoggerFactoryInterface :: class ) -> get ( 'systemLogger' ) ; $ this -> proxyClassCompiler -> injectClassesCache ( $ classesCache ) ; $ this -> aopProxyClassBuilder -> injectObjectConfigurationCache ( $ objectConfigurationCache ) ; $ this -> aopProxyClassBuilder -> injectLogger ( $ logger ) ; $ this -> dependencyInjectionProxyClassBuilder -> injectLogger ( $ logger ) ; $ this -> aopProxyClassBuilder -> build ( ) ; $ this -> dependencyInjectionProxyClassBuilder -> build ( ) ; $ classCount = $ this -> proxyClassCompiler -> compile ( ) ; $ dataTemporaryPath = $ this -> environment -> getPathToTemporaryDirectory ( ) ; Files :: createDirectoryRecursively ( $ dataTemporaryPath ) ; file_put_contents ( $ dataTemporaryPath . 'AvailableProxyClasses.php' , $ this -> proxyClassCompiler -> getStoredProxyClassMap ( ) ) ; $ objectConfigurationCache -> set ( 'allCompiledCodeUpToDate' , true ) ; $ classesCacheBackend = $ classesCache -> getBackend ( ) ; if ( $ this -> bootstrap -> getContext ( ) -> isProduction ( ) && $ classesCacheBackend instanceof FreezableBackendInterface ) { /** @var FreezableBackendInterface $backend */ $ backend = $ classesCache -> getBackend ( ) ; $ backend -> freeze ( ) ; } $ this -> emitFinishedCompilationRun ( $ classCount ) ; }
Explicitly compile proxy classes

The compile command triggers the proxy class compilation.
Although a compilation run is triggered automatically by Flow, there might
be cases in a production context where a manual compile run is needed.

@Flow\Internal
@param boolean $force If set, classes will be compiled even though the cache says that everything is up to date.
@return void
Explicitly compile proxy classes