]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/router.php
Merge branch 'righttoleave' into 0.9.x
[quix0rs-gnu-social.git] / lib / router.php
index b20336164fcba71aaa9b6465ae95e2242dc07ec6..c8e1c365a56a0e150ead5f55f2fa599ffb6f6654 100644 (file)
@@ -160,7 +160,16 @@ class Router
     
     static function cacheKey()
     {
-        return Cache::codeKey('router');
+        $parts = array('router');
+
+        // Many router paths depend on this setting.
+        if (common_config('singleuser', 'enabled')) {
+            $parts[] = '1user';
+        } else {
+            $parts[] = 'multi';
+        }
+
+        return Cache::codeKey(implode(':', $parts));
     }
     
     function initialize()
@@ -199,6 +208,9 @@ class Router
                           'deleteuser',
                           'geocode',
                           'version',
+                          'backupaccount',
+                          'deleteaccount',
+                          'restoreaccount',
             );
 
             foreach ($main as $a) {
@@ -515,6 +527,11 @@ class Router
                               'id' => Nickname::INPUT_FMT,
                               'format' => '(xml|json)'));
 
+            $m->connect('api/users/profile_image/:screen_name.:format',
+                        array('action' => 'ApiUserProfileImage',
+                              'screen_name' => Nickname::DISPLAY_FMT,
+                              'format' => '(xml|json)'));
+
             // direct messages
 
             $m->connect('api/direct_messages.:format',
@@ -905,8 +922,8 @@ class Router
             // AtomPub API
 
             $m->connect('api/statusnet/app/service/:id.xml',
-                        array('action' => 'ApiAtomService',
-                              'id' => Nickname::DISPLAY_FMT));
+                        array('action' => 'ApiAtomService'),
+                        array('id' => Nickname::DISPLAY_FMT));
 
             $m->connect('api/statusnet/app/service.xml',
                         array('action' => 'ApiAtomService'));
@@ -920,6 +937,24 @@ class Router
                         array('action' => 'AtomPubSubscriptionFeed'),
                         array('subscriber' => '[0-9]+'));
 
+            $m->connect('api/statusnet/app/favorites/:profile/:notice.atom',
+                        array('action' => 'AtomPubShowFavorite'),
+                        array('profile' => '[0-9]+',
+                              'notice' => '[0-9]+'));
+
+            $m->connect('api/statusnet/app/favorites/:profile.atom',
+                        array('action' => 'AtomPubFavoriteFeed'),
+                        array('profile' => '[0-9]+'));
+
+            $m->connect('api/statusnet/app/memberships/:profile/:group.atom',
+                        array('action' => 'AtomPubShowMembership'),
+                        array('profile' => '[0-9]+',
+                              'group' => '[0-9]+'));
+
+            $m->connect('api/statusnet/app/memberships/:profile.atom',
+                        array('action' => 'AtomPubMembershipFeed'),
+                        array('profile' => '[0-9]+'));
+
             // user stuff
 
             Event::handle('RouterInitialized', array($m));