Hprose\Swoole\Client::create PHP Method

create() public static method

public static create ( $uris )
    public static function create($uris)
    {
        if (!self::$clientFactoriesInited) {
            self::initClientFactories();
        }
        if (is_string($uris)) {
            $uris = array($uris);
        }
        $scheme = strtolower(parse_url($uris[0], PHP_URL_SCHEME));
        $n = count($uris);
        for ($i = 1; $i < $n; ++$i) {
            if (strtolower(parse_url($uris[$i], PHP_URL_SCHEME)) != $scheme) {
                throw new Exception("Not support multiple protocol.");
            }
        }
        $clientFactory = self::$clientFactories[$scheme];
        if (empty($clientFactory)) {
            throw new Exception("This client doesn't support {$scheme} scheme.");
        }
        return new $clientFactory($uris);
    }