Newscoop\Installer\Services\DemositeService::copyTemplate PHP Метод

copyTemplate() публичный Метод

Copy templates
public copyTemplate ( string $templateName = 'empty' )
$templateName string Choosen template name
    public function copyTemplate($templateName = 'empty')
    {
        $phpFinder = new PhpExecutableFinder();
        $phpPath = $phpFinder->find();
        if (!$phpPath) {
            throw new \RuntimeException('The php executable could not be found, add it to your PATH environment variable and try again');
        }
        $php = escapeshellarg($phpPath);
        $newscoopConsole = escapeshellarg($this->newscoopDir . '/application/console');
        $clearCache = new Process("{$php} {$newscoopConsole} cache:clear", null, null, null, 300);
        $clearCache->run();
        if (!$clearCache->isSuccessful()) {
            throw new \RuntimeException($clearCache->getErrorOutput());
        }
        $availablePublications = new Process("{$php} {$newscoopConsole} themes:assign {$templateName}", null, null, null, 300);
        $availablePublications->run();
        if (!$availablePublications->isSuccessful()) {
            throw new \RuntimeException($availablePublications->getErrorOutput());
        }
    }