[limb-svn] r7115 - 3.x/trunk/limb/net/src
svn at limb-project.com
svn at limb-project.com
Sat Jul 12 21:29:28 MSD 2008
Author: pachanga
Date: 2008-07-12 21:29:27 +0400 (Sat, 12 Jul 2008)
New Revision: 7115
URL: http://fisheye.limb-project.com/changelog/limb/?cs=7115
Modified:
3.x/trunk/limb/net/src/lmbUri.class.php
Log:
-- moving stuff from deprecated lmbUri::parse(..) to reset(..) method
Modified: 3.x/trunk/limb/net/src/lmbUri.class.php
===================================================================
--- 3.x/trunk/limb/net/src/lmbUri.class.php 2008-07-12 14:59:47 UTC (rev 7114)
+++ 3.x/trunk/limb/net/src/lmbUri.class.php 2008-07-12 17:29:27 UTC (rev 7115)
@@ -30,7 +30,7 @@
function __construct($str='')
{
if($str)
- $this->parse($str);
+ $this->reset($str);
}
static function addQueryItems($url, $items=array())
@@ -57,25 +57,6 @@
return $url . implode('&', $str_params_arr) . $fragment;
}
- /**
- * @deprecated
- */
- function parse($uri)
- {
- if('file' == substr($uri, 0, 4))
- $uri = $this->_fixFileProtocol($uri);
-
- $this->reset($uri);
- }
-
- protected function _fixFileProtocol($url)
- {
- $matches = array();
- if(preg_match('/^file:\/\/([a-zA-Z]?:[\/].*)/', $url, $matches))
- $url = 'file:///' . $matches[1];
- return $url;
- }
-
function reset($str = null)
{
$this->user = '';
@@ -90,6 +71,9 @@
if(!$str)
return;
+ if('file' == substr($str, 0, 4))
+ $str = $this->_fixFileProtocol($str);
+
if(!$urlinfo = @parse_url($str))
throw new lmbException("URI '$str' is not valid");
@@ -132,6 +116,22 @@
}
}
+ /**
+ * @deprecated
+ */
+ function parse($uri)
+ {
+ $this->reset($uri);
+ }
+
+ protected function _fixFileProtocol($url)
+ {
+ $matches = array();
+ if(preg_match('/^file:\/\/([a-zA-Z]?:[\/].*)/', $url, $matches))
+ $url = 'file:///' . $matches[1];
+ return $url;
+ }
+
function getProtocol()
{
return $this->protocol;
More information about the limb-svn
mailing list