Latte engine settings.
@return LatteEngine\Engine
420326
private function createLatteEngine()
	{
		$latte = new LatteEngine\Engine;
		$latte->setTempDirectory($this->temp);

		// Form macro.
		$latte->onCompile[] = function($latte) {
			Bridges\FormsLatte\FormMacros::install($latte->getCompiler());
		};
		return $latte;
	}
73480
public function getEngine()
    {
        if (is_null($this->_engine)) {
            $template = new Template($this->engineOptions);
            $this->_engine = $template->initialize();
        }
        return $this->_engine;
    }
715108
private function CreateSettings()
    {
        $this->settings = new Settings();
        $this->settings->SetLogLifetime(90);
        $this->settings->SetChangeRequestLifetime(30);
        $this->settings->SetSmtpSecurity((string)Enums\SmtpSecurity::None());
        $admin = $this->FirstAdmin();
        if ($admin)
        {
            $this->settings->SetMailFromEMail($admin->GetEMail());
            if ($admin->GetFirstName() &&  $admin->GetLastName())
            {
                $this->settings->SetMailFromName($admin->GetFirstName() . ' ' . $admin->GetLastName());
            }
        }
        $this->settings->Save();
    }
94884
public function getEngine() {
        if (!$this->_engine) {
            $engine = new \Decoda\Engine\PhpEngine();
            $engine->addPath(dirname(__DIR__) . '/templates/');

            $this->setEngine($engine);
        }

        return $this->_engine;
    }
1164695
public function settings(){
        if (is_file($this->path.'/.markdb')){

            $attributes = \Symfony\Component\Yaml\Yaml::parse(file_get_contents($this->path.'/.markdb'));
            $this->attributes = $attributes;

            foreach($attributes as $key=>$value){
                if (empty($this->{$key})) {
                    $this->{$key} = $value;
                }
            }
        }

        if (!isset($this->slug)){
            $this->slug = $this->name;
        }

        $this->base = empty($this->base) ? ($this->parent() ? $this->parent()->base : false) : $this->base;
        $this->slug = new Slug(MarkDb::sluggify(implode('/',array_filter([($this->parent ? $this->parent->slug : null),$this->slug]))), $this->base);

        if (!empty($this->date)){
            $this->date = \Carbon\Carbon::createFromTimestamp(strtotime($this->date));
        }

    }
1101501
public function configure()
    {
        if (!$this->getSchemaKey()) {
            throw new BadMethodCallException(sprintf(
                'Attempted to run configure() on a %s instance without a schema key set. See setSchemaKey(),
                or specify one in the constructor.',
                __CLASS__
            ));
        }

        $schemas = $this->config()->get('schemas');
        $config = isset($schemas[$this->getSchemaKey()]) ? $schemas[$this->getSchemaKey()] : [];

        return $this->applyConfig($config);
    }
411336
public function getPanel()
    {
        $params = [
            'class'           => get_class($this->locale),
            'locales'         => $this->locale->getLocales(),
            'localeIdDefault' => $this->locale->getIdDefault(),
            'localeId'        => $this->locale->getId(),
        ];
        $latte = new Engine;
        return $latte->renderToString(__DIR__ . '/PanelTemplate.latte', $params);
    }
244830
public static function generate()
    {
        $oDb              = Factory::service('PDODatabase');
        $oSettingsService = Factory::service('AppSetting');
        $oModel           = Factory::model('Blog', 'nails/module-blog');
        $aRoutes          = [];

        $oRows = $oDb->query('SELECT id FROM ' . $oModel->getTableName());
        if (!$oRows->rowCount()) {
            return [];
        }

        while ($oRow = $oRows->fetch(\PDO::FETCH_OBJ)) {

            //  Look up the setting
            $oSettings = $oDb->query('
              SELECT * FROM ' . $oSettingsService->getTableName() . '
              WHERE `grouping` = "blog-' . $oRow->id . '"
              AND `key` = "url"

            ');

            $sUrl = json_decode($oSettings->fetch(\PDO::FETCH_OBJ)->value) ?: 'blog';
            $sUrl = preg_replace('/^\//', '', $sUrl);
            $sUrl = preg_replace('/\/$/', '', $sUrl);

            $aRoutes[$sUrl . '(/(.+))?'] = 'blog/' . $oRow->id . '/$2';
        }

        return $aRoutes;
    }
240128
public function getBlockCacheSettingsObject()
    {
        if ($this->cacheSettings === null) {
            $this->cacheSettings = CacheSettings::get($this);
        }

        return $this->cacheSettings;
    }
726114
public function build(): SetTouchEmulationEnabledRequest
	{
		$instance = new SetTouchEmulationEnabledRequest();
		if ($this->enabled === null) {
			throw new BuilderException('Property [enabled] is required.');
		}
		$instance->enabled = $this->enabled;
		$instance->configuration = $this->configuration;
		return $instance;
	}
1129025
function _setEngine()
    {
        $this->engine = null;

        $candidateEngines = array(
            $this->preferredEngine,
            CRYPT_ENGINE_OPENSSL,
            CRYPT_ENGINE_MCRYPT
        );
        foreach ($candidateEngines as $engine) {
            if ($this->isValidEngine($engine)) {
                $this->engine = $engine;
                break;
            }
        }
        if (!$this->engine) {
            $this->engine = CRYPT_ENGINE_INTERNAL;
        }

        if ($this->engine != CRYPT_ENGINE_MCRYPT && $this->enmcrypt) {
            // Closing the current mcrypt resource(s). _mcryptSetup() will, if needed,
            // (re)open them with the module named in $this->cipher_name_mcrypt
            @mcrypt_module_close($this->enmcrypt);
            @mcrypt_module_close($this->demcrypt);
            $this->enmcrypt = null;
            $this->demcrypt = null;

            if ($this->ecb) {
                @mcrypt_module_close($this->ecb);
                $this->ecb = null;
            }
        }

        $this->changed = true;
    }
865022
public function engineRestart()
    {
        $this->executeCommandHook(__FUNCTION__, 'before');
        $this->executeExistingCommand('env:restart');
        $this->executeCommandHook(__FUNCTION__, 'after');

        return $this;
    }
1322282
protected function getSettings() {
        if (!$this->_settings) {
            $this->_settings = new SettingsList($this->version);
        }

        return $this->_settings;
    }
933190
protected function setEngineServiceOptions()
    {
        $project = ProjectX::getProjectType();

        if ($project instanceof EngineServiceInterface) {
            $engine = ProjectX::getEngineType();

            $classname = get_class($engine);
            $this->options[$classname::getTypeId()] = [
                'services' => $project->defaultServices()
            ];
        }

        return $this;
    }
449064
public function setEngine($table, $engine)
	{
		$supported = ['innodb', 'myisam', 'archive', 'merge', 'memory', 'csv', 'federated'];

		if (!in_array(strtolower($engine), $supported))
		{
			throw new UnsupportedEngineException(sprintf(
				'Unsupported engine type of "%s" specified. Engine type must be one of %s',
				$engine,
				implode(', ', $supported)
			));
		}

		$this->setQuery('ALTER TABLE ' . str_replace('#__', $this->tablePrefix, $this->quote($table, false)) . " ENGINE = " . $this->quote($engine));

		return $this->db->query();
	}
911163
protected function registerEngineResolver()
    {
        $mySelf = $this;

        $this->container->bindShared('view.engine.resolver', function ($app) use ($mySelf) {
            $resolver = new EngineResolver();

            $mySelf->registerPhpEngine($resolver);
            $mySelf->registerBladeEngine($resolver);

            return $resolver;
        });
    }
695449
public static function getEngine()
    {
        if (!static::$engine) {
            $loader = new \Twig_Loader_Filesystem();
            $loader->setPaths(__DIR__ . '/../../views');
            foreach (app('extension')->getExtensions() as $extension) {
                $path = $extension->getPath() . '/views';
                if (file_exists($path)) {
                    $loader->setPaths($path, $extension->getPackage());
                }
            }
            static::$engine = new \Twig_Environment($loader);
            static::$engine->addGlobal('assets', static::getAssetManager());
            static::$engine->addGlobal('config', Config::get());
        }
        return static::$engine;
    }