]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/NoCache.php
php_closing_tag [PSR-2] The closing ?> tag MUST be omitted from files containing...
[SourceForge/phpwiki.git] / lib / plugin / NoCache.php
1 <?php // -*-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 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 // Local Variables:
61 // mode: php
62 // tab-width: 8
63 // c-basic-offset: 4
64 // c-hanging-comment-ender-p: nil
65 // indent-tabs-mode: nil
66 // End: