[packages/dokuwiki-plugin-data] enable cache in table.php

glen glen at pld-linux.org
Sun Sep 16 14:34:22 CEST 2012


commit 147d6c0c61088c81ba07cc267cb9f3245a95d20c
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Aug 18 09:23:35 2012 +0300

    enable cache in table.php
    
    this plugin does not perform so well at all, so at least cache when data
    is likely up to date (no dynamic filters)

 cache-enable.patch        | 15 +++++++++++++++
 dokuwiki-plugin-data.spec |  2 ++
 2 files changed, 17 insertions(+)
---
diff --git a/dokuwiki-plugin-data.spec b/dokuwiki-plugin-data.spec
index 542e024..088e1f7 100644
--- a/dokuwiki-plugin-data.spec
+++ b/dokuwiki-plugin-data.spec
@@ -13,6 +13,7 @@ Source0:	https://github.com/Klap-in/dokuwiki-plugin-data/tarball/pdo#/%{plugin}-
 URL:		http://wiki.splitbrain.org/plugin:data
 Patch2:		separator-style.patch
 Patch3:		separate-rpmdb.patch
+Patch4:		cache-enable.patch
 BuildRequires:	rpm-php-pearprov
 BuildRequires:	rpmbuild(macros) >= 1.520
 Requires:	php(core) >= %{php_min_version}
@@ -51,6 +52,7 @@ different to the repository plugin.
 mv *-%{plugin}-*/* .
 %patch2 -p1
 %patch3 -p1
+%patch4 -p0
 
 version=$(awk '/date/{print $2}' plugin.info.txt)
 if [ $(echo "$version" | tr -d -) != %{version} ]; then
diff --git a/cache-enable.patch b/cache-enable.patch
new file mode 100644
index 0000000..b97802f
--- /dev/null
+++ b/cache-enable.patch
@@ -0,0 +1,15 @@
+--- syntax/table.php~	2012-08-07 18:56:10.000000000 +0300
++++ syntax/table.php	2012-08-17 01:26:46.814865996 +0300
+@@ -204,7 +204,11 @@
+     function render($format, &$R, $data) {
+         if($format != 'xhtml') return false;
+         if(is_null($data)) return false;
+-        $R->info['cache'] = false;
++
++        // disable cache only if sorting having some filters
++        if (!empty($_REQUEST['datasrt']) || !empty($_GET['dataflt']) || !empty($_REQUEST['dataofs'])) {
++            $R->info['cache'] = false;
++        }
+ 
+         $sqlite = $this->dthlp->_getDB();
+         if(!$sqlite) return false;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dokuwiki-plugin-data.git/commitdiff/7d759b68decd3a3f62056510335984096dfcb71e



More information about the pld-cvs-commit mailing list