Permalink
Browse files

Add a setProtocol() method

git-svn-id: http://svn.php.net/repository/pear/packages/Net_URL/trunk@158982 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
Richard Heyes
Richard Heyes committed May 19, 2004
1 parent 968f7dd commit 2274808003a42c02922dfca0310f0ce08c8f535f
Showing with 12 additions and 0 deletions.
  1. +12 −0 URL.php
View
12 URL.php
@@ -392,6 +392,18 @@ function getStandardPort($scheme)
default: return null;
}
}
+
+ /**
+ * Forces the URL to a particular protocol
+ *
+ * @param string $protocol Protocol to force the URL to
+ * @param integer $port Optional port (standard port is used by default)
+ */
+ function setProtocol($protocol, $port = null)
+ {
+ $this->protocol = $protocol;
+ $this->port = is_null($port) ? $this->getStandardPort() : $port;
+ }
}
?>

0 comments on commit 2274808

Please sign in to comment.