equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Controller |
16 * @package Zend_Controller |
17 * @subpackage Router |
17 * @subpackage Router |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @version $Id: Regex.php 20096 2010-01-06 02:05:09Z bkarwin $ |
19 * @version $Id: Regex.php 24593 2012-01-05 20:35:02Z matthew $ |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
21 */ |
21 */ |
22 |
22 |
23 /** Zend_Controller_Router_Route_Abstract */ |
23 /** Zend_Controller_Router_Route_Abstract */ |
24 require_once 'Zend/Controller/Router/Route/Abstract.php'; |
24 require_once 'Zend/Controller/Router/Route/Abstract.php'; |
26 /** |
26 /** |
27 * Regex Route |
27 * Regex Route |
28 * |
28 * |
29 * @package Zend_Controller |
29 * @package Zend_Controller |
30 * @subpackage Router |
30 * @subpackage Router |
31 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
31 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
32 * @license http://framework.zend.com/license/new-bsd New BSD License |
32 * @license http://framework.zend.com/license/new-bsd New BSD License |
33 */ |
33 */ |
34 class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract |
34 class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract |
35 { |
35 { |
36 protected $_regex = null; |
36 protected $_regex = null; |
72 * @return array|false An array of assigned values or a false on a mismatch |
72 * @return array|false An array of assigned values or a false on a mismatch |
73 */ |
73 */ |
74 public function match($path, $partial = false) |
74 public function match($path, $partial = false) |
75 { |
75 { |
76 if (!$partial) { |
76 if (!$partial) { |
77 $path = trim(urldecode($path), '/'); |
77 $path = trim(urldecode($path), self::URI_DELIMITER); |
78 $regex = '#^' . $this->_regex . '$#i'; |
78 $regex = '#^' . $this->_regex . '$#i'; |
79 } else { |
79 } else { |
80 $regex = '#^' . $this->_regex . '#i'; |
80 $regex = '#^' . $this->_regex . '#i'; |
81 } |
81 } |
82 |
82 |