Auto set the library to use (php extension first, symfony otherwise)
@staticvar string $engine
@return string|null
966202
protected static function getEngine(): ?string
    {
        static $engine = null;
        
        if ($engine === null) {
            if (extension_loaded('yaml')) {
                $engine = self::ENGINE_NATIVE;
            } else  {
                $engine = class_exists('\Symfony\Component\Yaml\Yaml')
                        ? self::ENGINE_SYMFONY
                        : self::ENGINE_NONE;
            }
        }
        
        return $engine;
    }
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();
	}
801136
public function getAutoIncrementString()
    {
        if ($this->isAutoIncrement() && IdMethod::NATIVE === $this->parentTable->getIdMethod()) {
            return $this->getPlatform()->getAutoIncrement();
        }

        if ($this->isAutoIncrement()) {
            throw new EngineException(sprintf(
                'You have specified autoIncrement for column "%s", but you have not specified idMethod="native" for table "%s".',
                $this->name,
                $this->parentTable->getName()
            ));
        }

        return '';
    }
1194409
function setPreferredEngine($engine)
    {
        if ($this->mode_3cbc) {
            $this->des[0]->setPreferredEngine($engine);
            $this->des[1]->setPreferredEngine($engine);
            $this->des[2]->setPreferredEngine($engine);
        }

        return parent::setPreferredEngine($engine);
    }
929645
public function register(Engine $engine)
    {
        $engine->registerFunction('getFile', [$this, 'getFile']);
        $class = new \ReflectionClass(ViewFileTrait::class);
        foreach ($class->getMethods() as $method) {
            if ($method->name === 'getFile') {
                continue;
            }
            $engine->registerFunction($method->name, [$this, $method->name]);
        }
    }
47734
public function getPhpDefaultValue()
    {
        if ($this->defaultValue === null) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException("Cannot get PHP version of default value for default value EXPRESSION.");
        }

        if ($this->propelType === PropelTypes::BOOLEAN || $this->propelType === PropelTypes::BOOLEAN_EMU) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->propelType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }
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;
    }
555458
public function get_engine($type = null)
    {
        if (!$this->engine) {
            $this->load_config();

            // Add include path for internal classes
            $include_path = $this->home . '/lib' . PATH_SEPARATOR;
            $include_path .= ini_get('include_path');
            set_include_path($include_path);

            $class_name = 'rcube_sieve_' . ($type ?: 'engine');
            $this->engine = new $class_name($this);
        }

        return $this->engine;
    }
426458
static function engineName($name){
		$segments = explode('.',$name);
		$app = 'App';
		if(count($segments) == 2){
			$app = current($segments);
		}
		return (object)[
			'app' => $app,
			'key' => end($segments)
		];
	}
678283
public static function build($engine = null, $namespace = '\Eureka\Component\Cache')
    {
        if (null === $engine) {
            $engine = static::engine();
        }

        if (empty(static::$instances[$engine])) {
            $class                 = $namespace . '\\' . 'CacheWrapper' . $engine;
            static::$instances[$engine] = new $class();
        }

        return static::$instances[$engine];
    }
388356
public static function addExtension( $extension, $engine, $resolver = null )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
1026367
public function initialize()
    {
        /** @var TemplateEngineInterface $engine */
        $engine = new $this->engine($this->options);
        $engine->setLocations(self::$paths);
        $this->applyExtensions($engine);
        return $engine;
    }
547016
public static function getEngine($engine = null)
    {
        is_null($engine) && $engine = Config::get('view_render_engine');
        return Cml::getContainer()->make('view_' . strtolower($engine));
    }
890818
protected function getAlterTableEngine($table, $engine)
    {
        $engine = $this->dba->quote($engine);

        return sprintf("%s\$this->execute(\"ALTER TABLE `%s` ENGINE=%s;\");", $this->ind2, $table, $engine);
    }
166688
protected function __init_view($engine = '')
    {

        $view = (string)__NAMESPACE__ . (string)(empty($engine) ? "\\View_{$this->default_view_engine}" : "\\View_{$engine}");

        if ($this->view instanceof $view) return true;

        try {
            $this->view = new $view();
        } catch (ViewException $e) {
            throw $e;
        }

        return true;
    }
746900
public function register(Engine $engine)
    {
        $engine->registerFunction('baseUrl', [$this, 'baseUrl']);
        $engine->registerFunction('uriFull', [$this, 'uriFull']);
        $engine->registerFunction('pathFor', [$this->router, 'pathFor']);
        $engine->registerFunction('basePath', [$this->uri, 'getBasePath']);
        $engine->registerFunction('uriScheme', [$this->uri, 'getScheme']);
        $engine->registerFunction('uriHost', [$this->uri, 'getHost']);
        $engine->registerFunction('uriPort', [$this->uri, 'getPort']);
        $engine->registerFunction('uriPath', [$this->uri, 'getPath']);
        $engine->registerFunction('uriQuery', [$this->uri, 'getQuery']);
        $engine->registerFunction('uriFragment', [$this->uri, 'getFragment']);
    }
499981
public function mapEngineVersion(?string $engineVersion): VersionInterface
    {
        if (null === $engineVersion) {
            return new Version();
        }

        switch (mb_strtolower($engineVersion)) {
            case '':
            case 'unknown':
            case 'other':
                return new Version(0);
                break;
            default:
                // nothing to do here
                break;
        }

        return (new VersionFactory())->set($engineVersion);
    }