]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/NoCache.php
rcs_id no longer makes sense with Subversion global version number
[SourceForge/phpwiki.git] / lib / plugin / NoCache.php
1 <?php // -*-php-*-
2 // rcs_id('$Id$');
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
20  * along with PhpWiki; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23
24 /**
25  * Don't cache the following page. Mostly used for plugins, which
26  * display dynamic content.
27  *
28  * Usage:
29  *   <?plugin NoCache ?>
30  * or to delete the whole cache for this page:
31  *   <?plugin NoCache nocache||=purge ?>
32  *
33  * Author:  Reini Urban <rurban@x-ray.at>
34  *
35  */
36 class WikiPlugin_NoCache
37 extends WikiPlugin
38 {
39     function getName() {
40         return _("NoCache");
41     }
42
43     function getDescription() {
44         return _("Don't cache this page.");
45     }
46
47     function getDefaultArguments() {
48         return array( 'nocache' => 1 );
49     }
50
51     function run($dbi, $argstr, &$request, $basepage) {
52         $args = $this->getArgs($argstr, $request);
53         // works regardless of WIKIDB_NOCACHE_MARKUP
54         // if WIKIDB_NOCACHE_MARKUP is false it doesn't hurt
55         $request->setArg('nocache', $args['nocache']);
56         return HTML::raw('');
57     }
58 };
59
60 // For emacs users
61 // Local Variables:
62 // mode: php
63 // tab-width: 8
64 // c-basic-offset: 4
65 // c-hanging-comment-ender-p: nil
66 // indent-tabs-mode: nil
67 // End:
68 ?>