]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/NoCache.php
function run: @return mixed
[SourceForge/phpwiki.git] / lib / plugin / NoCache.php
1 <?php
2
3 /*
4  * Copyright 2004 $ThePhpWikiProgrammingTeam
5  * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
6  *
7  * This file is part of PhpWiki.
8  *
9  * PhpWiki is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * PhpWiki is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 /**
25  * Don't cache the following page. Mostly used for plugins, which
26  * display dynamic content.
27  *
28  * Usage:
29  *   <<NoCache >>
30  * or to delete the whole cache for this page:
31  *   <<NoCache nocache||=purge >>
32  *
33  * Author:  Reini Urban <rurban@x-ray.at>
34  *
35  */
36 class WikiPlugin_NoCache
37     extends WikiPlugin
38 {
39     function getDescription()
40     {
41         return _("Don't cache this page.");
42     }
43
44     function getDefaultArguments()
45     {
46         return array('nocache' => 1);
47     }
48
49     /**
50      * @param WikiDB $dbi
51      * @param string $argstr
52      * @param WikiRequest $request
53      * @param string $basepage
54      * @return mixed
55      */
56     function run($dbi, $argstr, &$request, $basepage)
57     {
58         $args = $this->getArgs($argstr, $request);
59         // works regardless of WIKIDB_NOCACHE_MARKUP
60         // if WIKIDB_NOCACHE_MARKUP is false it doesn't hurt
61         $request->setArg('nocache', $args['nocache']);
62         return HTML::raw('');
63     }
64 }
65
66 // Local Variables:
67 // mode: php
68 // tab-width: 8
69 // c-basic-offset: 4
70 // c-hanging-comment-ender-p: nil
71 // indent-tabs-mode: nil
72 // End: