diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-02-11 09:53:54 -0500 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-02-11 09:53:54 -0500 |
commit | 880d0b477b254d62f68b2a894ff558448693e37a (patch) | |
tree | 065d3ded9f2f83268dbed6ce667ac144690c79e0 /extlib/Net/URL/Mapper/Part/Fixed.php | |
parent | d345c746b9021266a2ed100329affe49c5ae8fc3 (diff) | |
parent | bba1dbdb403aac067ae97c44531f6886f90fec35 (diff) |
Merge branch 'urlroute' into 0.7.x
Diffstat (limited to 'extlib/Net/URL/Mapper/Part/Fixed.php')
-rw-r--r-- | extlib/Net/URL/Mapper/Part/Fixed.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/extlib/Net/URL/Mapper/Part/Fixed.php b/extlib/Net/URL/Mapper/Part/Fixed.php new file mode 100644 index 000000000..b315b442d --- /dev/null +++ b/extlib/Net/URL/Mapper/Part/Fixed.php @@ -0,0 +1,70 @@ +<?php +/** + * URL parser and mapper + * + * PHP version 5 + * + * LICENSE: + * + * Copyright (c) 2006, Bertrand Mansion <golgote@mamasam.com> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category Net + * @package Net_URL_Mapper + * @author Bertrand Mansion <golgote@mamasam.com> + * @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 $ + * @link http://pear.php.net/package/Net_URL_Mapper + */ + +require_once 'Net/URL/Mapper/Part.php'; + +class Net_URL_Mapper_Part_Fixed extends Net_URL_Mapper_Part +{ + + public function __construct($content, $path) + { + $this->type = Net_URL_Mapper_Part::FIXED; + parent::__construct($content, $path); + } + + public function getFormat() + { + return $this->getRule(); + } + + public function getRule() + { + return preg_quote($this->path, '/'); + } + + public function generate($value = null) + { + return $this->path; + } +} +?>
\ No newline at end of file |