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