/** * Build the new site pages. * * @param string $sourceDir * @param string $outputDir */ protected function runBuildTask($sourceDir, $outputDir) { $buildTime = $this->runTimedTask(function () use($sourceDir, $outputDir) { $this->builder->build($sourceDir, $outputDir); }); $this->output->writeln("<comment>PHP built in <time>{$buildTime}ms</time></comment>", OutputInterface::VERBOSITY_VERBOSE); }
/** * Run the build command. * * @return bool */ protected function build() { $container = new Container(); $container->singleton('files', Filesystem::class); $container->bind(Factory::class, function ($app) { return new Factory($app->make(EngineResolver::class), new FileViewFinder($app['files'], ['test/source']), new Dispatcher($app)); }); $container->afterResolving(function (Factory $factory, $app) { $factory->addExtension('php', 'php', function () { return new PhpEngine(); }); $factory->addExtension('blade.php', 'blade', function () use($app) { return new CompilerEngine(new BladeCompiler($app['files'], vfsStream::url('test/.cache'))); }); }); $builder = new Builder($container, [Skip::class . ':_*', Compile::class]); return $builder->build(vfsStream::url('test/source'), vfsStream::url('test/build')); }