API for compile (create file)

@param string $name
@return void
181262
public static function compile($name, $with_draft = false)
	{
		$factory = new BuildFactory(self::config($name), 'site', $with_draft);
		$buildSite = $factory->build();
		$buildSite->build();
		$site = $buildSite->getNodes();

		$parser = new Parser();
		$config = $parser->parse(file_get_contents( self::config($name) ));

		$loader = new \Twig_Loader_Filesystem( $config['dir']['layout'] );
		$twig = new \Twig_Environment($loader);

		$compiler = new CompileSite($site, $config, $twig);
		$compiler->compile();
	}
507512
public function referenceBegin($name): void
    {
        $this->client->sendBuffer .= $this->client->preparedToSendBuffer;
        $this->client->preparedToSendBuffer = null;
        $signature = sprintf('<H p="1" v="%s">', $name);
        $this->write($signature);
        $signature[6] = '2';
        $this->client->currentArgumentsFormat = $signature;
    }
122882
public function compile(): void
	{
		// Get teplate contents

		$contents = $this->fileSystem->get($this->template);

		// Compile template

		foreach($this->compileOrder as $method)
		{
			$contents = $this->$method($contents);
		}

		// Store compiled template

		$this->fileSystem->put($this->cachePath . '/' . md5($this->template) . '.php', trim($contents));
	}
45688
protected function loadGroup(string $name): void
    {
        $file = $this->container->get('config_dir').'/'.$name.'.php';
        $data = \is_file($file) ? include($file) : [];
        $this->container['config_'.$name] = $data;
    }
69564
protected function createJsonConfig($name)
    {
        if ($this->files->exists($path = $this->getJsonPath())) {
            $this->error('Widget json config already exists!');

            return;
        }

        $stub = $this->files->get($this->getJsonStubPath());
        $stub = $this->replaceNamespace($stub, $name)->replaceClass($stub, $name);
        $stub = $this->replaceFQCN($stub, $name);
        $stub = $this->replaceView($stub);

        $this->files->put($path, $stub);

        $this->info('Json config created successfully.');
    }
237387
public function register($name)
    {
        $this->hook->action($name, function () {
            if (! $this->nonceValid()) {
                wp_send_json($this->getErrorMessage());
            }

            wp_send_json($this->run());
        })->dispatch();
    }
19981
public function make($name, $data = [])
    {
        $view = $this->container->make('view');

        echo $view->make($name, $data)->render();
    }
881383
public function compile($path = null)
    {
        if ($path) {
            $this->setPath($path);
        }

        if (!is_null($this->cachePath)) {
            if (!is_file($path)) {
                throw new \RuntimeException("File does not exist at path {$path}");
            }

            file_put_contents(
                $this->getCompiledPath($path),
                $this->compileString(file_get_contents($path))
            );
        }
    }
8520
public function main(string $name = '') : void
    {
        parent::main();

        $name = $this->_camelize($name);

        $this->validate($name, (string)Configure::read('CsvMigrations.modules.path'));

        $this->bakeModuleConfig($name);
        $this->bakeDatabaseConfig($name);
        $this->bakeViewsConfig($name);
        $this->bakeController($name);
        $this->bakeApiController($name);
        $this->bakeTable($name);
        $this->bakeEntity($name);
        $this->bakeFeature($name);
    }
885761
protected function loadFile($name, $files)
    {
        // Load blueprint file.
        $blueprint = new Blueprint($files);

        $this->object->embed($name, $blueprint->load()->toArray(), '/', true);
    }
1012625
private function loadLanguageFile($name)
    {
        /** @var System $system */
        $system = $this->framework->getAdapter(System::class);
        $system->loadLanguageFile($name);
    }
651565
private function build(string $name): BuildCommand
    {
        /*
         * We prepare the application for a build, moving it to production. Then,
         * after compile all the code to a single file, we move the built file
         * to the builds folder with the correct permissions.
         */
        $this->prepare()
            ->compile($name)
            ->clear();

        $this->output->writeln(
            sprintf('    Compiled successfully: <fg=green>%s</>', $this->app->buildsPath($name))
        );

        return $this;
    }
726884
private function loadHelper(string $name): void
    {
        $class = static::class;

        // Somebody forgot to call `addHelperPath`
        if (!isset(static::$helpersPath[$class])) {
            throw new CommonException("Helper path not found for class `$class`");
        }

        // Try to find helper file
        foreach (static::$helpersPath[$class] as $path) {
            if ($helperPath = realpath($path . '/' . ucfirst($name) . '.php')) {
                $this->addHelper($name, $helperPath);
                return;
            }
        }

        throw new CommonException("Helper `$name` not found for class `$class`");
    }
108697
protected function loadFile($name, $filename)
    {
        $file = CompiledYamlFile::instance($filename);
        if (preg_match('|languages\.yaml$|', $filename)) {
            $this->object->mergeRecursive((array) $file->content());
        } else {
            $this->object->mergeRecursive([$name => $file->content()]);
        }
        $file->free();
    }
85881
public static function compileDynamic(&$context, $name) {
        if (!$context['flags']['runpart']) {
            return;
        }

        $func = static::compile($context, $context['usedPartial'][$name], $name);

        if (!isset($context['partialCode'][$name]) && $func) {
            $context['partialCode'][$name] = "'$name' => $func";
        }

        return $func;
    }
942505
public function create($name = '')
    {
        $tables = $this->argument('tables') ? $this->argument('tables') : '*';
        $return = BackupFacade::backup($tables, $name);
        if (true === $return) {
            $this->info(sprintf('%s backup file generated in %s path', $name,
                BackupLoader::generatePath($name)));
        } else {
            $this->error(sprintf('%s cant create, file already exists', $name));
        }
    }
1366674
protected function createRoutes(string $name): void
    {
        $webFile = base_path('modules/'.$name.'/Routes/service.php');
        if (! $this->files->exists($webFile)) {
            $this->files->put($webFile, $this->files->get(__DIR__.'/stubs/service-route.stub'));
        }
    }