diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-25 13:04:09 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-25 13:04:09 -0700 |
commit | 29a25848dee2863b380779d6b8f979b66365d924 (patch) | |
tree | 91ad4832a1772614b91f03fe49c9b8a52390e271 /lib/router.php | |
parent | 7f1b852c97ff1e14eef7b42dfef42f372e22ea72 (diff) | |
parent | cd9017408e3a970d5d12433b9b81266817e0cc6f (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/router.php b/lib/router.php index a48ee875e..a9d07276f 100644 --- a/lib/router.php +++ b/lib/router.php @@ -33,6 +33,33 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { require_once 'Net/URL/Mapper.php'; +class StatusNet_URL_Mapper extends Net_URL_Mapper { + + private static $_singleton = null; + + private function __construct() + { + } + + public static function getInstance($id = '__default__') + { + if (empty(self::$_singleton)) { + self::$_singleton = new StatusNet_URL_Mapper(); + } + return self::$_singleton; + } + + public function connect($path, $defaults = array(), $rules = array()) + { + $result = null; + if (Event::handle('StartConnectPath', array(&$path, &$defaults, &$rules, &$result))) { + $result = parent::connect($path, $defaults, $rules); + Event::handle('EndConnectPath', array($path, $defaults, $rules, $result)); + } + return $result; + } +} + /** * URL Router * @@ -69,7 +96,7 @@ class Router function initialize() { - $m = Net_URL_Mapper::getInstance(); + $m = StatusNet_URL_Mapper::getInstance(); if (Event::handle('StartInitializeRouter', array(&$m))) { |