]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
setting to turn off expensive queries
authorEvan Prodromou <evan@status.net>
Tue, 20 Sep 2011 01:55:11 +0000 (21:55 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 20 Sep 2011 01:55:11 +0000 (21:55 -0400)
CONFIGURE
actions/all.php
actions/attachment.php
actions/public.php
actions/showstream.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 cbd2805ca3170b94be1c2db6859318461577e7e0..2b83127f72ad5025506b399e4dec4779de084b50 100644 (file)
@@ -211,12 +211,13 @@ class AllAction extends ProfileAction
             $ibs->show();
         }
         // XXX: make this a little more convenient
-        if (common_config('site', 'private')) {
+
+        if (!common_config('performance', 'high')) {
             $pop = new PopularNoticeSection($this);
             $pop->show();
+            $pop = new InboxTagCloudSection($this, $this->user);
+            $pop->show();
         }
-        //        $pop = new InboxTagCloudSection($this, $this->user);
-        //        $pop->show();
     }
 }
 
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 0e403f5af5a209613d03964ef44517c5891333d1..4743ff24c399287a06cfa0d9687a377ebb88d9fa 100644 (file)
@@ -245,7 +245,7 @@ class PublicAction extends Action
 
         $pop = new PopularNoticeSection($this);
         $pop->show();
-        if (common_config('site', 'private')) {
+        if (common_config('performance', 'high')) {
             $cloud = new PublicTagCloudSection($this);
             $cloud->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 4020ba0e3948376e069b9a42788854cc618979d7..1fb516562192aa34bc5d91f5d8d3b921df887676 100644 (file)
@@ -274,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));
@@ -898,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));