summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-25 13:05:02 -0700
committerBrion Vibber <brion@pobox.com>2010-03-25 13:05:02 -0700
commit040b4b74ef2a2c86da039a93612266a67bb260d8 (patch)
tree2080e36acf80894c55fce95d29ab0b6a9b9d16b3 /lib/router.php
parentabf2ce873b23f238041c4b4190dc709b2d40774d (diff)
parent29a25848dee2863b380779d6b8f979b66365d924 (diff)
Merge commit 'origin'; branch '0.9.x' into 1.0.x
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/router.php b/lib/router.php
index 9fe2f60ae..a040abb83 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))) {