@param string      $type
@param string|null $name
@param string|null $user
@param string|null $pass
@param string|null $host

@return AbstractDatabase
543837
public function resolveDatabase($type, $name = null, $user = null, $pass = null, $host = null)
    {
        $database = $this->resolveDatabaseType($type);

        if ($name !== null) {
            $database->name = $name;
        }
        if ($user !== null) {
            $database->user = $user;
        }
        if ($pass !== null) {
            $database->pass = $pass;
        }
        if ($host !== null) {
            $database->host = $host;
        }

        return $database;
    }
792333
public function load($domainName, $type = null)
    {
        $path = 'routing.yml';
      
        if(!$this->container['isCMS'])
        {
          
            $site = $this->container['em']->getRepository('\Aspi\Framework\Entity\Site')->getByDomain($domainName);
        }
        else
        {
          
            $site = $this->container['em']->getRepository('\Aspi\CMS\Framework\Entity\Site')->getByDomain($domainName);
            $this->container['theme'] = $site['name'];
            $this->container['hook'] = $site['hook'];
     
        }
        if(!$site)
        {
            throw new \InvalidArgumentException(sprintf('File not found for domain "%s".', $domainName));
        }
        if (null === $this->yamlParser) {
            $this->yamlParser = new YamlParser();
        }
        try {
$parsedString =<<<EOT
homepage:
    locales:  { en: "/welcome", fr: "/bienvenue", de: "/willkommen" }
    defaults: { _controller: '\Controller\Home::Index'}

page:
    locales:  { en: "/page/", fr: "/bienvenue", de: "/willkommen" }
    defaults: { _controller: '\Controller\Home::Index'}

loginpage:
    locales:  { en: "/login", fr: "/se-connecter"}    
    defaults: { _controller: '\Controller\Home::Login' }

admin:
    path:     /admin
    defaults: { _controller: 'App\Controller\DefaultController::default' }
EOT;

            $parsedString .=$site['routing'];
            $parsedConfig = $this->yamlParser->parse($parsedString);
        } catch (ParseException $e) {
            throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
        }
        $collection = new RouteCollection();
        // empty file
        if (null === $parsedConfig) {
            return $collection;
        }
        // not an array
        if (!is_array($parsedConfig)) {
            throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path));
        }
        foreach ($parsedConfig as $name => $config) {
            if (isset($config['pattern'])) {
                if (isset($config['path'])) {
                    throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
                }
                $config['path'] = $config['pattern'];
                unset($config['pattern']);
            }
            $this->validate($config, $name, $path);
            if (isset($config['resource'])) {
                $this->parseImport($collection, $config, $path, $file);
            } else {
                $this->parseRoute($collection, $name, $config, $path);
            }
        }
        return $collection;
    }
469470
public function bindParam($name, &$var, $type = PDO::PARAM_STR, $length = null)
    {
        return $this->stmt->bindParam($name, $var, $type, $length);
    }
28329
public static function setProxy($host, $user = null, $pass = null, $type = CURLPROXY_SOCKS5)
	{
		self::$proxy = array('host' => $host, 'type' => $type, 'user' => $user, 'pass' => $pass);
	}
541289
public function functionCall($name, $parameters = null, $type = CallFunctionStatement::TYPE_CALL_DIRECT)
    {
        return new CallFunctionStatement($name, $parameters, $type);
    }
470202
public static function create($type = null, array $config = []) {

	    if(!$type) {

	        if(!isset($config['dsn'])) {
	            throw new \Exception('No database type defined.');
            }

            if(preg_match('/^([a-z0-9]+):/i', trim($config['dsn']), $matches)) {
                $type = $matches[1];
            }
            else {
                throw new \Exception('No driver found in DSN.');
            }

        }

		$type = strtolower($type);

		if($type === 'propel') {

			// check whether Propel is available (assume Propel2)

            if(!class_exists('\\Propel\\Runtime\\Propel')) {
                throw new \Exception('Propel is configured as driver for vxPDO but not available in this application.');
            }

            $serviceContainer = \Propel\Runtime\Propel::getServiceContainer();

            // retrieve adapter information

            $adapterName = $serviceContainer->getAdapterClass();
            $dsnName = $serviceContainer->getDefaultDatasource();

            /* @var $connection \Propel\Runtime\Connection\ConnectionInterface */

            $connection = \Propel\Runtime\Propel::getConnection();

            if(!in_array($adapterName, ['mysql', 'pgsql'])) {

                throw new \Exception(sprintf("vxPDO accepts only mysql and pgsql as established connection drivers. The configured Propel connection '%s' uses '%s'.", $dsnName, $adapterName));

			}

			// @todo fugly like hell - perhaps some more concise solution exists

            preg_match('/dbname=([^;]+)/i', \Propel\Runtime\Propel::getConnectionManager($dsnName)->getConfiguration()['dsn'], $matches);
            $dbName = $matches[1] ?? '';

            $pdoConnection = new Propel2ConnectionWrapper($connection);
            $pdoConnection->setName($dsnName);
            $pdoConnection->setDbName($dbName);

            $className =
                __NAMESPACE__ .
                '\\Adapter\\' .
                ucfirst($adapterName);

            /* @var $vxPDO DatabaseInterface */

            $vxPDO = new $className();
            $vxPDO->setConnection($pdoConnection);

            return $vxPDO;

		}

		else {

			$className =
				__NAMESPACE__ .
				'\\Adapter\\' .
				ucfirst($type);
	
			// check whether driver is available
				
			if(!class_exists($className)) {
	
				throw new ConfigException(sprintf("No class for driver '%s' supported.", $type));
	
			}
				
			return new $className($config);

		}

	}
1108194
public function checkMysqlConnection($host, $db, $user, $pass)
    {
        $results                        = array();
        $isConnected                    = 0;
        $isDatabaseExists               = 0;
        $isDatabaseCollationNameValid   = 0;
        $isPassCorrect                  = 1;

        if($this->isDomainExists($host)) {
            $isConnected = 1;

            try {
                $dbAdapter = new DbAdapter(array(
                    'driver' =>  'Pdo',
                    'dsn'   =>   'mysql:dbname=INFORMATION_SCHEMA;host='.$host,
                    'username' => $user,
                    'password' => $pass,
                    'driver_options' => array(
                        PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
                    ),
                ));

                $sql = new Sql($dbAdapter);
                $select = $sql->select();
                $select->from('SCHEMATA');
                $select->where(array('SCHEMA_NAME' => $db));

                $statement = $sql->prepareStatementForSqlObject($select);
                $result = $statement->execute();

                $schema = $result->current();
                if(!empty($schema)) {

                    $isDatabaseExists = 1;

                    if (!empty($schema['DEFAULT_COLLATION_NAME']) && $schema['DEFAULT_COLLATION_NAME'] === 'utf8_general_ci') {
                        $isDatabaseCollationNameValid = 1;
                    }
                }
            }catch(\Exception $e) {
                $isPassCorrect = 0;
            }
        }

        $results = array(
            'isConnected' => $isConnected,
            'isDatabaseExists' => $isDatabaseExists,
            'isMysqlPasswordCorrect' => $isPassCorrect,
            'isDatabaseCollationNameValid' => $isDatabaseCollationNameValid,
        );


        return $results;
    }
459528
protected function form($type, $name = null, $value = null) {
		
		$form = new Form();
		return $form -> {$type}($name, $value);
	}
245894
protected function createColumn($name, $type, array $parameters = [])
    {
        $attributes = array_merge(compact('type', 'name'), $parameters);

        $column = new Fluent($attributes);

        return $column;
    }
553913
public function bindValue($name, $value, $type = null)
    {
        return $this->stmt->bindValue($name, $value, $type);
    }
65563
public function input($type, $name, $value = null)
    {
        $value = $this->inputs ? $this->inputs->get($name, $value) : $value;
        $form  = (new Input($type, $name))->value($value);
        return $this->setClass($form);
    }
680400
public function getQuery(string $name, string $type = null, $default = null)
    {
        $value = $this->getUserData($this->uri->getQueries(), $name);

        if ($type) {
            $value = $this->validateType($value, $type, $default);
        }

        return $value;
    }
704808
public static function input($name, $type = INPUT_SERVER)
    {
        //====================================================================//
        // Standard Safe Reading
        $result = filter_input($type, $name);
        if (null !== $result) {
            return $result;
        }
        //====================================================================//
        // Fallback Reading
        if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        if ((INPUT_GET === $type) && isset($_GET[$name])) {
            return $_GET[$name];
        }

        return null;
    }
354379
public function PhpWsdlParam($name,$type='string',$settings=null){
		PhpWsdl::Debug('New parameter '.$name);
		parent::PhpWsdlObject($name,$settings);
		$this->Type=$type;
	}
1071270
public function createFilter($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createFilterBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Filter type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createFilterBuilderForProperty($this->getDataClass(), $name, $options);
    }
868302
static function createHash( $user, $password, $site, $type, $hash = false )
    {
        $user = self::trimAuthString( $user );
        $password = self::trimAuthString( $password );

        $str = '';
        if ( $type == self::PASSWORD_HASH_MD5_PASSWORD )
        {
            $str = md5( $password );
        }
        else if ( $type == self::PASSWORD_HASH_MD5_USER )
        {
            $str = md5( "$user\n$password" );
        }
        else if ( $type == self::PASSWORD_HASH_MD5_SITE )
        {
            $str = md5( "$user\n$password\n$site" );
        }
        else if ( $type == self::PASSWORD_HASH_MYSQL )
        {
            $db = eZDB::instance();
            $hash = $db->escapeString( $password );

            $str = $db->arrayQuery( "SELECT PASSWORD( '$hash' )" );
            $hashes = array_values( $str[0] );
            $str = $hashes[0];
        }
        else if ( $type == self::PASSWORD_HASH_PLAINTEXT )
        {
            $str = $password;
        }
        else if ( ( $type == self::PASSWORD_HASH_BCRYPT ||
                    $type == self::PASSWORD_HASH_PHP_DEFAULT ) &&
                  $hash )
        {
            if ( password_verify( $password, $hash ) )
            {
                return $hash;
            }

            return false;
        }
        else if ( $type == self::PASSWORD_HASH_BCRYPT )
        {
            $str = password_hash( $password, PASSWORD_BCRYPT );
        }
        else if ( $type == self::PASSWORD_HASH_PHP_DEFAULT )
        {
            $str = password_hash( $password, PASSWORD_DEFAULT );
        }
        else
        {
            if ( $type == self::PASSWORD_HASH_EMPTY )
            {
                eZDebug::writeError( "Cannot create hash of hash type 0 (PASSWORD_HASH_EMPTY)." );
            }
            else
            {
                eZDebug::writeError( "Password hash type ID '$type' is not recognized." );
            }

            return false;
        }

        eZDebugSetting::writeDebug( 'kernel-user', $str, "ezuser($type)" );
        return $str;
    }
10253
protected static function _params($type, $name = "*") {
		if (!$name) {
			$name = '*';
		}
		$library = $namespace = $class = '*';

		if (strpos($type, '.') !== false) {
			$parts = explode('.', $type);
			$type = array_shift($parts);

			switch (count($parts)) {
				case 1:
					list($class) = $parts;
				break;
				case 2:
					list($namespace, $class) = $parts;
				break;
				default:
					$class = array_pop($parts);
					$namespace = join('\\', $parts);
				break;
			}
		}
		if (strpos($name, '.') !== false) {
			$parts = explode('.', $name);
			$library = array_shift($parts);
			$name = array_pop($parts);
			$namespace = $parts ? join('\\', $parts) : "*";
		}
		return compact('library', 'namespace', 'type', 'class', 'name');
	}