UrlInfo::__construct PHP Method

__construct() public method

public __construct ( )
    public function __construct()
    {
        $na = func_num_args();
        if ($na == 2) {
            $fhost = func_get_arg(0);
            if (!is_null($fhost) && $fhost != 'unknown') {
                $this->host = $fhost;
            }
            $fproto = func_get_arg(1);
            if (!is_null($fproto)) {
                $this->protocol = $fproto;
            }
        } else {
            $ffw = func_get_arg(0);
            $ffws = preg_split('/;/', $ffw, -1, PREG_SPLIT_NO_EMPTY);
            $opts = array();
            foreach ($ffws as $ffwi) {
                $ffwis = preg_split('/=/', $ffwi, -1);
                $opts[$ffwis[0]] = $ffwis[1];
            }
            if (isset($opts['by'])) {
                $this->host = $opts['by'];
            }
            if (isset($opts['proto'])) {
                $this->protocol = $opts['proto'];
            }
        }
    }