]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing'
authorEvan Prodromou <evan@status.net>
Tue, 20 Sep 2011 15:08:27 +0000 (11:08 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 20 Sep 2011 15:08:27 +0000 (11:08 -0400)
CONFIGURE
actions/all.php
actions/apitimelineretweetsofme.php
actions/attachment.php
actions/public.php
actions/showstream.php
classes/Notice.php
lib/default.php
lib/publicgroupnav.php
lib/router.php

index 3f0ae668abafbd47c30f0d4ec67bf4d627d111da..285ccd11b350bfb26c2f926c9473ba8912237383 100644 (file)
--- a/CONFIGURE
+++ b/CONFIGURE
@@ -852,3 +852,10 @@ path: Path to the plugin files. defaults to site/path + '/plugins/'. Expects tha
       each plugin will have a subdirectory at plugins/NameOfPlugin. Change this
       if you're using a CDN.
 sslpath: Path to use on the SSL server. Same as plugins/path.
+
+performance
+-----------
+
+high: if you need high performance, or if you're seeing bad
+      performance, set this to true. It will turn off some high-intensity code from
+      the site.
index a7f325e014567da447ee4b6f852809ca28d8477b..2b83127f72ad5025506b399e4dec4779de084b50 100644 (file)
@@ -210,10 +210,14 @@ class AllAction extends ProfileAction
             }
             $ibs->show();
         }
-        $pop = new PopularNoticeSection($this);
-        $pop->show();
-        //        $pop = new InboxTagCloudSection($this, $this->user);
-        //        $pop->show();
+        // XXX: make this a little more convenient
+
+        if (!common_config('performance', 'high')) {
+            $pop = new PopularNoticeSection($this);
+            $pop->show();
+            $pop = new InboxTagCloudSection($this, $this->user);
+            $pop->show();
+        }
     }
 }
 
index 03137e7a9a09d26dc4746b301d84b7a8176f9977..d01db87b937172dec45d61164633237c9960004e 100644 (file)
@@ -115,7 +115,15 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
              array('nickname' => $this->auth_user->nickname)
         );
 
-        $strm = $this->auth_user->repeatsOfMe($offset, $limit, $this->since_id, $this->max_id);
+        // This is a really bad query for some reason
+
+        if (!common_config('performance', 'high')) {
+            $strm = $this->auth_user->repeatsOfMe($offset, $limit, $this->since_id, $this->max_id);
+        } else {
+            $strm = new Notice();
+            $strm->whereAdd('0 = 1');
+            $strm->find();
+        }
 
         switch ($this->format) {
         case 'xml':
index 22018ab043d06e49291c549756468ceddc478e17..f149ca19d987978e4067bf6497431860e0071c74 100644 (file)
@@ -173,7 +173,9 @@ class AttachmentAction extends Action
     function showSections() {
         $ns = new AttachmentNoticeSection($this);
         $ns->show();
-        $atcs = new AttachmentTagCloudSection($this);
-        $atcs->show();
+        if (!common_config('performance', 'high')) {
+            $atcs = new AttachmentTagCloudSection($this);
+            $atcs->show();
+        }
     }
 }
index f62d032ef8ba5ee9c28cd48752d3cd0c2c37f3c2..75217cb2293965ed4394a4701bad86f590650ce0 100644 (file)
@@ -245,8 +245,10 @@ class PublicAction extends Action
 
         $pop = new PopularNoticeSection($this);
         $pop->show();
-        $cloud = new PublicTagCloudSection($this);
-        $cloud->show();
+        if (!common_config('performance', 'high')) {
+            $cloud = new PublicTagCloudSection($this);
+            $cloud->show();
+        }
         $feat = new FeaturedUsersSection($this);
         $feat->show();
     }
index ccd976a0e30fe30a2151335451b554b60241c117..6e5ba84511ff8c3161b25ee46fad3a39c2d7d4f6 100644 (file)
@@ -285,8 +285,10 @@ class ShowstreamAction extends ProfileAction
     function showSections()
     {
         parent::showSections();
-        $cloud = new PersonalTagCloudSection($this, $this->user);
-        $cloud->show();
+        if (!common_config('performance', 'high')) {
+            $cloud = new PersonalTagCloudSection($this, $this->user);
+            $cloud->show();
+        }
     }
 
     function noticeFormOptions()
index ce6464c1579ac48e09703e91185788fc8a3d6b93..adcc25973c5a093b8a24462f0d61bd97181a4945 100644 (file)
@@ -507,7 +507,7 @@ class Notice extends Managed_DataObject
         if (empty($verb)) {
             if (!empty($notice->repeat_of)) {
                 $notice->verb        = ActivityVerb::SHARE;
-                $notice->object_type = ActivityVerb::ACTIVITY;
+                $notice->object_type = ActivityObject::ACTIVITY;
             } else {
                 $notice->verb        = ActivityVerb::POST;
             }
index 71b2257cd5b6e1107bf8e57b678c1b9f42435f18..8748b645804f282f6c607fe2acb0c65b386b131e 100644 (file)
@@ -351,5 +351,6 @@ $default =
         'router' =>
         array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
         'discovery' =>
-        array('cors' => false) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
+          array('cors' => false), // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
+        'performance' => array('high' => false) // disable some features for higher performance; default false
     );
index 2b9c418440e90faffd65a5f2f02ab1068ce69542..79190a11f05edb4c379e3419b1dc3dbffeb7b43d 100644 (file)
@@ -74,10 +74,12 @@ class PublicGroupNav extends Menu
                 // TRANS: Menu item title in search group navigation panel.
                 _('User groups'), $this->actionName == 'groups', 'nav_groups');
 
-            // TRANS: Menu item in search group navigation panel.
-            $this->out->menuItem(common_local_url('publictagcloud'), _m('MENU','Recent tags'),
-                // TRANS: Menu item title in search group navigation panel.
-                _('Recent tags'), $this->actionName == 'publictagcloud', 'nav_recent-tags');
+            if (!common_config('performance', 'high')) {
+                // TRANS: Menu item in search group navigation panel.
+                $this->out->menuItem(common_local_url('publictagcloud'), _m('MENU','Recent tags'),
+                                     // TRANS: Menu item title in search group navigation panel.
+                                     _('Recent tags'), $this->actionName == 'publictagcloud', 'nav_recent-tags');
+            }
 
             if (count(common_config('nickname', 'featured')) > 0) {
                 // TRANS: Menu item in search group navigation panel.
index fa34b17537f335e50b9c4ab21d73ff318e7ee58e..1fb516562192aa34bc5d91f5d8d3b921df887676 100644 (file)
@@ -124,6 +124,20 @@ class Router
                         array('user_id' => '[0-9]+',
                               'token' => '.+'));
 
+            // these take a code; before the main part
+
+            foreach (array('register', 'confirmaddress', 'recoverpassword') as $c) {
+                $m->connect('main/'.$c.'/:code', array('action' => $c));
+            }
+
+            // Also need a block variant accepting ID on URL for mail links
+            $m->connect('main/block/:profileid',
+                        array('action' => 'block'),
+                        array('profileid' => '[0-9]+'));
+
+            $m->connect('main/sup/:seconds', array('action' => 'sup'),
+                        array('seconds' => '[0-9]+'));
+
             // main stuff is repetitive
 
             $main = array('login', 'logout', 'register', 'subscribe',
@@ -148,18 +162,11 @@ class Router
                 $m->connect('main/'.$a, array('action' => $a));
             }
 
-            // Also need a block variant accepting ID on URL for mail links
-            $m->connect('main/block/:profileid',
-                        array('action' => 'block'),
-                        array('profileid' => '[0-9]+'));
-
-            $m->connect('main/sup/:seconds', array('action' => 'sup'),
-                        array('seconds' => '[0-9]+'));
-
-            $m->connect('main/tagprofile', array('action' => 'tagprofile'));
             $m->connect('main/tagprofile/:id', array('action' => 'tagprofile'),
                                                array('id' => '[0-9]+'));
 
+            $m->connect('main/tagprofile', array('action' => 'tagprofile'));
+
             $m->connect('main/oembed',
                         array('action' => 'oembed'));
 
@@ -170,12 +177,6 @@ class Router
             $m->connect('main/xrd',
                         array('action' => 'userxrd'));
 
-            // these take a code
-
-            foreach (array('register', 'confirmaddress', 'recoverpassword') as $c) {
-                $m->connect('main/'.$c.'/:code', array('action' => $c));
-            }
-
             // settings
 
             foreach (array('profile', 'avatar', 'password', 'im', 'oauthconnections',
@@ -202,18 +203,18 @@ class Router
             // search
 
             foreach (array('group', 'people', 'notice') as $s) {
-                $m->connect('search/'.$s, array('action' => $s.'search'));
                 $m->connect('search/'.$s.'?q=:q',
                             array('action' => $s.'search'),
                             array('q' => '.+'));
+                $m->connect('search/'.$s, array('action' => $s.'search'));
             }
 
             // The second of these is needed to make the link work correctly
             // when inserted into the page. The first is needed to match the
             // route on the way in. Seems to be another Net_URL_Mapper bug to me.
-            $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
             $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),
                         array('q' => '.+'));
+            $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
 
             $m->connect('attachment/:attachment',
                         array('action' => 'attachment'),
@@ -273,10 +274,12 @@ class Router
                         array('action' => 'userbyid'),
                         array('id' => '[0-9]+'));
 
-            $m->connect('tags/', array('action' => 'publictagcloud'));
-            $m->connect('tag/', array('action' => 'publictagcloud'));
-            $m->connect('tags', array('action' => 'publictagcloud'));
-            $m->connect('tag', array('action' => 'publictagcloud'));
+            if (!common_config('performance', 'high')) {
+                $m->connect('tags/', array('action' => 'publictagcloud'));
+                $m->connect('tag/', array('action' => 'publictagcloud'));
+                $m->connect('tags', array('action' => 'publictagcloud'));
+                $m->connect('tag', array('action' => 'publictagcloud'));
+            }
             $m->connect('tag/:tag/rss',
                         array('action' => 'tagrss'),
                         array('tag' => self::REGEX_TAG));
@@ -897,7 +900,9 @@ class Router
 
                 // people tags
 
-                $m->connect('peopletags', array('action' => 'publicpeopletagcloud'));
+                if (!common_config('performance', 'high')) {
+                    $m->connect('peopletags', array('action' => 'publicpeopletagcloud'));
+                }
 
                 $m->connect('peopletag/:tag', array('action' => 'peopletag',
                                                     'tag'    => self::REGEX_TAG));