Net_URL_Mapper 0.9.1

This commit is contained in:
Evan Prodromou 2010-11-27 16:48:52 -05:00
parent 8212df3e1a
commit 0a753206cb
7 changed files with 39 additions and 18 deletions

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Mapper.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Mapper.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Exception.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Exception.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Part.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Part.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Dynamic.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Dynamic.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Fixed.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Fixed.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Wildcard.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Wildcard.php 232857 2007-03-28 10:23:04Z mansion $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */

View File

@ -37,7 +37,7 @@
* @package Net_URL_Mapper * @package Net_URL_Mapper
* @author Bertrand Mansion <golgote@mamasam.com> * @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Path.php,v 1.1 2007/03/28 10:23:04 mansion Exp $ * @version CVS: $Id: Path.php 296456 2010-03-20 00:41:08Z kguest $
* @link http://pear.php.net/package/Net_URL_Mapper * @link http://pear.php.net/package/Net_URL_Mapper
*/ */
@ -84,6 +84,22 @@ class Net_URL_Mapper_Path
$this->getRequired(); $this->getRequired();
} }
/**
* Called when the object is serialized
* Make sure we do not store too much info when the object is serialized
* and call the regular expressions generator functions so that they will
* not need to be generated again on wakeup.
*
* @return array Name of properties to store when serialized
*/
public function __sleep()
{
$this->getFormat();
$this->getRule();
return array('alias', 'path', 'defaults', 'rule', 'format',
'parts', 'minKeys', 'maxKeys', 'fixed', 'required');
}
public function getPath() public function getPath()
{ {
return $this->path; return $this->path;
@ -241,7 +257,12 @@ class Net_URL_Mapper_Path
} }
$path = '/'.trim(Net_URL::resolvePath($path), '/'); $path = '/'.trim(Net_URL::resolvePath($path), '/');
if (!empty($qstring)) { if (!empty($qstring)) {
$path .= '?'.http_build_query($qstring); if(strpos($path, '?') === false) {
$path .= '?';
} else {
$path .= '&';
}
$path .= http_build_query($qstring);
} }
if (!empty($anchor)) { if (!empty($anchor)) {
$path .= '#'.ltrim($anchor, '#'); $path .= '#'.ltrim($anchor, '#');