From: Elan Ruusamäe Date: Sat, 18 Aug 2012 06:23:35 +0000 (+0300) Subject: enable cache in table.php X-Git-Tag: auto/th/dokuwiki-plugin-data-20180409-1~8 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdokuwiki-plugin-data.git;a=commitdiff_plain;h=147d6c0c61088c81ba07cc267cb9f3245a95d20c 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) --- 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; 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