Get connection

@param string $name

@return Connection
@throws Exception
348976
public static function get($name)
    {
        if (!isset(self::$connections[$name])) {
            throw new Exception(sprintf('Connection "%s" does not exist.', $name));
        }

        return self::$connections[$name];
    }
1163077
private function GetProperty($name)
	{
		$lines = explode("\n", $this->GetConfigFileContents());
		// print $this->GetConfigFileContents();
		
		foreach ($lines as $line)
		{
			$pair = explode("=",trim($line),2);
			if ($pair[0] == $name) return isset($pair[1]) ? $pair[1] : "";
		}
		
		throw new Exception("UNKNOWN PROPERTY $name");
	}
1340216
public function getConnection($name)
    {
        if (!$this->connectionSettings->has($name)) {
            throw new BadArgumentException('Connection with name ":name" not defined in configuration file ":file"', [
                'name' => $name, 'file' => ServiceLocator::instance()->getConfiguration()->getIdentity(),
            ]);
        }
        
        if (!static::$connections->has($name)) {
            static::$connections->set($name, new Connection($this->connectionSettings->get($name)));
        }
        
        return static::$connections[$name];
    }
1229918
public function getConnectionConfig($name = null) {
		if (is_null($name)) {
			$name = $this->defaultConfigName;
		}

		if (isset($this->connectionConfigs[$name])) {
			return $this->connectionConfigs[$name];
		}

		return null;
	}
404564
public function getConnection($name = null)
    {
        $name = $name ?: $this->getDefaultConnectionName();

        if (!$this->connectionExists($name)) {
            throw new InvalidArgumentException(sprintf('Doctrine Connection named "%s" does not exist.', $name));
        }

        if (isset($this->connectionsMap[$name])) {
            return $this->connectionsMap[$name];
        }

        return $this->connectionsMap[$name] = $this->getService(
            $this->getConnectionBindingName($this->connections[$name])
        );
    }
1364551
public function getConfiguration($name)
    {
        if (!isset($this->config[$name]['configuration_class'])) {
            throw new \Exception(sprintf('Configuration for "%s" not found', $name));
        }
        $class = $this->config[$name]['configuration_class'];

        return new $class();
    }
1294027
public function connection($name = null)
	{
		if (is_array($name)) return $this->multiple($name);

		return $this->resolve($name ?: $this->getDefaultConnection());
	}
74020
protected function createConnection($name)
    {
        $config = $this->getConfig($name);

        $connection = new Client($config);

        $connection->connect();

        return $connection;
    }
9869
public function serverGetByName($name)
  {
    foreach($this->serverList() as $server)
    {
      if($server["virtualserver_name"] == $name) return $server;
    }

    throw new Exception("invalid serverID", 0x400);
  }
391575
public static function connection($name = null)
    {
        if (is_null($name) || strlen($name) == 0) {
            if (is_null(static::$name)) {
                static::$name = static::$config['default'];
            }

            $name = static::$name;
        }

        if (!isset(static::$config['connection'][$name])) {
            throw new ConnectionException('The connection "' . $name . '" is not defined.');
        }

        if ($name !== static::$name) {
            static::$adapter = null;
        }

        $config = static::$config['connection'][$name];

        static::$name = $name;

        if (static::$adapter === null) {
            if ($name == 'mysql') {
                static::$adapter = new MysqlAdapter($config);
            } elseif ($name == 'sqlite') {
                static::$adapter = new SqliteAdapter($config);
            } else {
                throw new ConnectionException('This driver is not praised');
            }

            static::$adapter->setFetchMode(static::$config['fetch']);
        }

        if (static::$adapter->getConnection() instanceof PDO && $name == static::$name) {
            return static::getInstance();
        }

        return static::getInstance();
    }
964738
public function getService($name)
    {
        if (array_key_exists($name, $this->services)) {
            return $this->services[$name];
        } elseif (isset($this->serviceProviders[$name]) && $this->serviceProviders[$name] instanceof ServiceProviderInterface) {
            $service = $this->serviceProviders[$name]->instantiate();
            if (!empty($this->serviceConfiguration[$name]['persistent'])) {
                $this->setService($name, $service);
            }
            return $service;
        } else {
            throw new Exception("Requested service {$name} is not registered");
        }
    }
1227671
public function get($name) {
        $this->runCopy();
        if (in_array($name, ['css', 'js', 'style', 'script'])) {
            $return = $this->{$name};
        } else {
            throw new \Exception(" '$name' doesn't Exists is the '" . __CLASS__ . "' class. ");
        }
        return $return;
    }
459061
public static function get($name)
    {
        if (self::existe($name)) {
            return $_COOKIE[$name];
        }

        exception(CookieKeyNotFoundException::class, $name);
    }
10704
public function get(string $name): ApiConnector
    {
        return $this->apiFactory->createApiConnector($name, $this->options);
    }
623967
public function get($name, $autoConnect = true, $autoAuthenticate = true)
    {
        $connection = $this->connections[$name];

        if ($autoConnect && !$connection->isConnected()) {
            $connection->connect();
        }

        if ($autoAuthenticate && !$connection->isAuthenticated()) {
            $connection->authenticate($this->authentications[$name]);
        }

        return $connection;
    }
614346
public function getConnectionConfig(string $name = null) {

        // Lookup the connection config
        $config = $this->config->get($this->getConfigName().'.disk');

        // Add cache info the config
        if ($this->config->get($this->getConfigName().'.cache')) {
            $config['cache'] = $this->getCacheConfig();
        }

        // Use the driver as the name.
        $config['name'] = $config['driver'];

        // Return adapter config in the format GrahamCampbell/Flysystem expects
        return $config;
    }
924834
public function acquire( $name = 'db' )
	{
		try
		{
			$adapter = $this->_config->get( 'resource/' . $name . '/adapter', 'mysql' );

			if( !isset( $this->_connections[$name] ) || empty( $this->_connections[$name] ) )
			{
				if( !isset( $this->_count[$name] ) ) {
					$this->_count[$name] = 0;
				}

				$limit = $this->_config->get( 'resource/' . $name . '/limit', -1 );

				if( $limit >= 0 && $this->_count[$name] >= $limit ) {
					throw new MW_DB_Exception( sprintf( 'Maximum number of connections (%1$d) exceeded', $limit ) );
				}

				$this->_connections[$name] = array( $this->_createConnection( $name, $adapter ) );
				$this->_count[$name]++;
			}

			switch( $adapter )
			{
				case 'sqlite':
				case 'sqlite3':
					// SQLite uses page locking which prevents a second connection from
					// reading from tables which are already in use. Fortunately, it is
					// possible withing the same connection to do the update.
					return $this->_connections[$name][0];
			}

			return array_pop( $this->_connections[$name] );

		}
		catch( PDOException $e ) {
			throw new MW_DB_Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
		}
	}