]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/commitdiff
enable cache in table.php
authorElan Ruusamäe <glen@delfi.ee>
Sat, 18 Aug 2012 06:23:35 +0000 (09:23 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 16 Sep 2012 12:33:44 +0000 (15:33 +0300)
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 [new file with mode: 0644]
dokuwiki-plugin-data.spec

diff --git a/cache-enable.patch b/cache-enable.patch
new file mode 100644 (file)
index 0000000..b97802f
--- /dev/null
@@ -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;
index 542e0243d9e5a7f5c3c54fa5fc21f179d615b1bc..088e1f7817e630950e0cfd02be8a122e5230012d 100644 (file)
@@ -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
This page took 0.165229 seconds and 4 git commands to generate.