SF.net SVN: phpwiki:[10787] trunk

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10787
          http://sourceforge.net/p/phpwiki/code/10787
Author:   vargenau
Date:     2021-12-15 17:49:09 +0000 (Wed, 15 Dec 2021)
Log Message:
-----------
Remove USECACHE, always true

Modified Paths:
--------------
    trunk/config/config-default.ini
    trunk/config/config-dist.ini
    trunk/configurator.php
    trunk/lib/IniConfig.php
    trunk/lib/Request.php
    trunk/lib/WikiDB/backend/flatfile.php
    trunk/lib/WikiDB.php
    trunk/lib/loadsave.php
    trunk/lib/plugin/SystemInfo.php
    trunk/locale/it/pgsrc/NoteDiRilascio
    trunk/pgsrc/ReleaseNotes
    trunk/themes/MonoBook/templates/actionbar.tmpl
    trunk/themes/Sidebar/templates/actionbar.tmpl
    trunk/themes/default/templates/actionbar.tmpl

Modified: trunk/config/config-default.ini
===================================================================
--- trunk/config/config-default.ini	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/config/config-default.ini	2021-12-15 17:49:09 UTC (rev 10787)
@@ -7,7 +7,6 @@
 JS_SEARCHREPLACE = true
 ENABLE_DOUBLECLICKEDIT = false
 ENABLE_OPEN_GRAPH = false
-USECACHE = true
 ISREADONLY = false
 
 ; calculated dynamically, but need a default

Modified: trunk/config/config-dist.ini
===================================================================
--- trunk/config/config-dist.ini	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/config/config-dist.ini	2021-12-15 17:49:09 UTC (rev 10787)
@@ -465,12 +465,6 @@
 ; to set this parameter to 0 (disabled).
 ;DATABASE_OPTIMISE_FREQUENCY = 50
 
-; Store DB query results (esp. for page lists) in memory to avoid duplicate queries.
-; Disable only for old php's with low memory or memory_limit=8MB.
-; Requires at least memory_limit=16MB
-; Default: true
-;USECACHE = false
-
 ;========================================================================
 ; Part Three: User Authentication
 ;========================================================================

Modified: trunk/configurator.php
===================================================================
--- trunk/configurator.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/configurator.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -805,9 +805,6 @@
 $properties["DATABASE_OPTIMISE_FREQUENCY"] =
     new numeric_define_optional('DATABASE_OPTIMISE_FREQUENCY', DATABASE_OPTIMISE_FREQUENCY);
 
-$properties["USECACHE"] =
-    new boolean_define_commented_optional('USECACHE');
-
 /////////////////////////////////////////////////////////////////////
 
 $properties["Part Three"] =

Modified: trunk/lib/IniConfig.php
===================================================================
--- trunk/lib/IniConfig.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/IniConfig.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -129,7 +129,7 @@
     $_IC_VALID_BOOL = array
     ('ENABLE_PAGEPERM', 'ENABLE_EDIT_TOOLBAR', 'JS_SEARCHREPLACE',
         'ENABLE_DOUBLECLICKEDIT',
-        'USECACHE', 'WIKIDB_NOCACHE_MARKUP',
+        'WIKIDB_NOCACHE_MARKUP',
         'ENABLE_REVERSE_DNS', 'ENCRYPTED_PASSWD', 'ZIPDUMP_AUTH',
         'ENABLE_RAW_HTML', 'ENABLE_RAW_HTML_LOCKEDONLY', 'ENABLE_RAW_HTML_SAFE',
         'STRICT_MAILABLE_PAGEDUMPS', 'COMPRESS_OUTPUT',

Modified: trunk/lib/Request.php
===================================================================
--- trunk/lib/Request.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/Request.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -334,11 +334,6 @@
 
     function buffer_output($compress = true)
     {
-        // FIXME: disables sessions (some byte before all headers_sent())
-        /*if (defined('USECACHE') and !USECACHE) {
-            $this->_is_buffering_output = false;
-            return;
-        }*/
         if (defined('COMPRESS_OUTPUT')) {
             if (!COMPRESS_OUTPUT)
                 $compress = false;

Modified: trunk/lib/WikiDB/backend/flatfile.php
===================================================================
--- trunk/lib/WikiDB/backend/flatfile.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/WikiDB/backend/flatfile.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -125,7 +125,7 @@
         // Construct a dummy page_revision object
         $page = new WikiDB_Page($this->_wikidb, $pagename);
         // data may be pagedate or versiondata updates
-        if (USECACHE and empty($data['pagedata'])) {
+        if (empty($data['pagedata'])) {
             $cache =& $this->_wikidb->_cache;
             if (!empty($cache->_pagedata_cache[$pagename])
                 and is_array($cache->_pagedata_cache[$pagename])

Modified: trunk/lib/WikiDB.php
===================================================================
--- trunk/lib/WikiDB.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/WikiDB.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -529,11 +529,6 @@
      */
     public function renamePage($from, $to, $updateWikiLinks = false)
     {
-        /**
-         * @var WikiRequest $request
-         */
-        global $request;
-
         if (!empty($this->readonly)) {
             if ((int)DEBUG) {
                 trigger_error("readonly database", E_USER_WARNING);
@@ -1666,14 +1661,14 @@
 
         $possibly_cache_results = true;
 
-        if (!USECACHE or WIKIDB_NOCACHE_MARKUP) {
+        if (WIKIDB_NOCACHE_MARKUP) {
             if (WIKIDB_NOCACHE_MARKUP == 'purge') {
                 // flush cache for this page.
                 $page = $this->getPage();
-                $page->set('_cached_html', ''); // ignored with !USECACHE
+                $page->set('_cached_html', '');
             }
             $possibly_cache_results = false;
-        } elseif (USECACHE and !$this->_transformedContent) {
+        } elseif (!$this->_transformedContent) {
             //$backend->lock();
             if ($this->isCurrent()) {
                 $page = $this->getPage();
@@ -2196,17 +2191,13 @@
     public function get_pagedata($pagename)
     {
         assert(is_string($pagename) && $pagename != '');
-        if (USECACHE) {
-            $cache = &$this->_pagedata_cache;
-            if (!isset($cache[$pagename]) || !is_array($cache[$pagename])) {
-                $cache[$pagename] = $this->_backend->get_pagedata($pagename);
-                if (empty($cache[$pagename]))
-                    $cache[$pagename] = array();
-            }
-            return $cache[$pagename];
-        } else {
-            return $this->_backend->get_pagedata($pagename);
+        $cache = &$this->_pagedata_cache;
+        if (!isset($cache[$pagename]) || !is_array($cache[$pagename])) {
+            $cache[$pagename] = $this->_backend->get_pagedata($pagename);
+            if (empty($cache[$pagename]))
+                $cache[$pagename] = array();
         }
+        return $cache[$pagename];
     }
 
     public function update_pagedata($pagename, $newdata)
@@ -2221,16 +2212,14 @@
 
         $this->_backend->update_pagedata($pagename, $newdata);
 
-        if (USECACHE) {
-            if (!empty($this->_pagedata_cache[$pagename])
-                and is_array($this->_pagedata_cache[$pagename])
-            ) {
-                $cachedata = &$this->_pagedata_cache[$pagename];
-                foreach ($newdata as $key => $val)
-                    $cachedata[$key] = $val;
-            } else
-                $this->_pagedata_cache[$pagename] = $newdata;
-        }
+        if (!empty($this->_pagedata_cache[$pagename])
+            and is_array($this->_pagedata_cache[$pagename])
+        ) {
+            $cachedata = &$this->_pagedata_cache[$pagename];
+            foreach ($newdata as $key => $val)
+                $cachedata[$key] = $val;
+        } else
+            $this->_pagedata_cache[$pagename] = $newdata;
     }
 
     public function invalidate_cache($pagename)
@@ -2279,7 +2268,6 @@
     {
         //  FIXME: Seriously ugly hackage
         $readdata = false;
-        if (USECACHE) { //temporary - for debugging
             assert(is_string($pagename) && $pagename != '');
             $nc = $need_content ? '1' : '0';
             $cache = &$this->_versiondata_cache;
@@ -2297,14 +2285,10 @@
                 }
             }
             $vdata = $cache[$pagename][$version][$nc];
-        } else {
-            $vdata = $this->_backend->get_versiondata($pagename, $version, $need_content);
-            $readdata = true;
-        }
+
         if ($readdata && is_array($vdata) && !empty($vdata['%pagedata'])) {
             if (empty($this->_pagedata_cache))
                 $this->_pagedata_cache = array();
-            /* PHP Fatal error:  Cannot create references to/from string offsets nor overloaded objects in /var/www/html/phpwiki/lib/WikiDB.php on line 2180, referer: wiki/TitleSearch?s=and&auto_redirect=1 */
             $this->_pagedata_cache[$pagename] = $vdata['%pagedata'];
         }
         return $vdata;
@@ -2363,17 +2347,13 @@
 
     public function get_latest_version($pagename)
     {
-        if (USECACHE) {
-            assert(is_string($pagename) && $pagename != '');
-            $cache = &$this->_glv_cache;
-            if (!isset($cache[$pagename])) {
-                $cache[$pagename] = $this->_backend->get_latest_version($pagename);
-                if (empty($cache[$pagename]))
-                    $cache[$pagename] = 0;
-            }
-            return $cache[$pagename];
-        } else {
-            return $this->_backend->get_latest_version($pagename);
+        assert(is_string($pagename) && $pagename != '');
+        $cache = &$this->_glv_cache;
+        if (!isset($cache[$pagename])) {
+            $cache[$pagename] = $this->_backend->get_latest_version($pagename);
+            if (empty($cache[$pagename]))
+                $cache[$pagename] = 0;
         }
+        return $cache[$pagename];
     }
 }

Modified: trunk/lib/loadsave.php
===================================================================
--- trunk/lib/loadsave.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/loadsave.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -730,12 +730,10 @@
             $zip->addFromString($filename, $data);
         }
 
-        if (USECACHE) {
-            $request->_dbi->_cache->invalidate_cache($pagename);
-            unset ($request->_dbi->_cache->_pagedata_cache);
-            unset ($request->_dbi->_cache->_versiondata_cache);
-            unset ($request->_dbi->_cache->_glv_cache);
-        }
+        $request->_dbi->_cache->invalidate_cache($pagename);
+        unset ($request->_dbi->_cache->_pagedata_cache);
+        unset ($request->_dbi->_cache->_versiondata_cache);
+        unset ($request->_dbi->_cache->_glv_cache);
         unset ($request->_dbi->_cache->_backend->_page_data);
 
         unset($msg);

Modified: trunk/lib/plugin/SystemInfo.php
===================================================================
--- trunk/lib/plugin/SystemInfo.php	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/lib/plugin/SystemInfo.php	2021-12-15 17:49:09 UTC (rev 10787)
@@ -137,8 +137,6 @@
 
     function cachestats()
     {
-        if (!defined('USECACHE') or !USECACHE)
-            return _("no cache used");
         $dbi =& $this->_dbi;
         $cache = $dbi->_cache;
         $s = _("cached pagedata:") . " " . count($cache->_pagedata_cache);

Modified: trunk/locale/it/pgsrc/NoteDiRilascio
===================================================================
--- trunk/locale/it/pgsrc/NoteDiRilascio	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/locale/it/pgsrc/NoteDiRilascio	2021-12-15 17:49:09 UTC (rev 10787)
@@ -1,4 +1,4 @@
-Date: Wed, 15 Dec 2021 10:20:21 +0000
+Date: Wed, 15 Dec 2021 18:48:29 +0000
 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0)
 Content-Type: application/x-phpwiki;
   pagename=NoteDiRilascio;
@@ -15,6 +15,7 @@
 
 === Fixes ===
 * Make list of pages work with PDO (~AllPages, ~MostPopular...)
+* blog theme improved
 
 === Changes ===
 * Remove ADODB DATABASE_TYPE. Use SQL (Pear) or PDO.
@@ -22,6 +23,7 @@
 * Add sample images for ~PhotoAlbum in blog theme
 * Remove EDITING_POLICY
 * Remove ENABLE_XHTML_XML
+* Remove USECACHE, always true
 * More translations
 
 === Plugins ===

Modified: trunk/pgsrc/ReleaseNotes
===================================================================
--- trunk/pgsrc/ReleaseNotes	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/pgsrc/ReleaseNotes	2021-12-15 17:49:09 UTC (rev 10787)
@@ -1,4 +1,4 @@
-Date: Wed, 15 Dec 2021 10:20:21 +0000
+Date: Wed, 15 Dec 2021 18:48:29 +0000
 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0)
 Content-Type: application/x-phpwiki;
   pagename=ReleaseNotes;
@@ -15,6 +15,7 @@
 
 === Fixes ===
 * Make list of pages work with PDO (~AllPages, ~MostPopular...)
+* blog theme improved
 
 === Changes ===
 * Remove ADODB DATABASE_TYPE. Use SQL (Pear) or PDO.
@@ -22,6 +23,7 @@
 * Add sample images for ~PhotoAlbum in blog theme
 * Remove EDITING_POLICY
 * Remove ENABLE_XHTML_XML
+* Remove USECACHE, always true
 * More translations
 
 === Plugins ===

Modified: trunk/themes/MonoBook/templates/actionbar.tmpl
===================================================================
--- trunk/themes/MonoBook/templates/actionbar.tmpl	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/themes/MonoBook/templates/actionbar.tmpl	2021-12-15 17:49:09 UTC (rev 10787)
@@ -76,7 +76,7 @@
     <?php echo ActionButton(array('action'=>__("AuthorHistory")), _("Author History"), $pagename) ?>
     <?php echo ActionButton("diff") ?>
     <?php echo ActionButton(array('action'=>__("PageDump")), _("Page Dump"), $pagename) ?>
-    <?php if (DEBUG and USECACHE) {
+    <?php if (DEBUG) {
       $PurgeCache = ActionButton(array('nocache' => 'purge'),
                      _("Purge HTML cache"), $pagename);
       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed.")); ?>

Modified: trunk/themes/Sidebar/templates/actionbar.tmpl
===================================================================
--- trunk/themes/Sidebar/templates/actionbar.tmpl	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/themes/Sidebar/templates/actionbar.tmpl	2021-12-15 17:49:09 UTC (rev 10787)
@@ -62,10 +62,9 @@
      <?php echo ActionButton("diff") ?>
      <?php if ($isAdmin) { ?>
       <?php echo ActionButton(__("PageDump"), _("Page Dump")) ?>
-      <?php if (USECACHE) { ?>
        <?php echo ActionButton(array('nocache' => 'purge'), _("Purge HTML cache"), $pagename,
                array('title'=>_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."))) ?>
-     <?php }} ?>
+     <?php } ?>
   </ul>
   </div>
 </div>

Modified: trunk/themes/default/templates/actionbar.tmpl
===================================================================
--- trunk/themes/default/templates/actionbar.tmpl	2021-12-15 15:46:35 UTC (rev 10786)
+++ trunk/themes/default/templates/actionbar.tmpl	2021-12-15 17:49:09 UTC (rev 10787)
@@ -31,7 +31,7 @@
     <?php echo $SEP?><?php echo Button(__("DebugBackendInfo"), _("Debug Backend Info")) ?>
     <?php echo $SEP?><?php echo Button(__("PageDump"), _("Page Dump")) ?>
 <?php
-    if (DEBUG & _DEBUG_SQL and USECACHE) {
+    if (DEBUG & _DEBUG_SQL) {
       $PurgeCache = Button(array('nocache' => 'purge'),
                      _("Purge HTML cache"), $page->getName());
       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.