]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/VisualWiki.php
use getUploadxxxPath
[SourceForge/phpwiki.git] / lib / plugin / VisualWiki.php
1 <?php // -*-php-*-
2 rcs_id('$Id: VisualWiki.php,v 1.20 2006-12-22 17:57:10 rurban Exp $');
3 /*
4  Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)
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  * Produces graphical site map of PhpWiki
25  * Example for an image map creating plugin. It produces a graphical
26  * sitemap of PhpWiki by calling the <code>dot</code> commandline tool
27  * from graphviz (http://www.graphviz.org).
28  * @author Johannes Große
29  * @version 0.9
30  */
31 define('VISUALWIKI_ALLOWOPTIONS', true);
32 if (!defined('VISUALWIKI_ALLOWOPTIONS'))
33     define('VISUALWIKI_ALLOWOPTIONS', false);
34
35 require_once "lib/plugin/GraphViz.php";
36
37 class WikiPlugin_VisualWiki
38 extends WikiPlugin_GraphViz
39 {
40     /**
41      * Sets plugin type to map production
42      */
43     function getPluginType() {
44         return ($GLOBALS['request']->getArg('debug')) ? PLUGIN_CACHED_IMG_ONDEMAND : PLUGIN_CACHED_MAP;
45     }
46
47     /**
48      * Sets the plugin's name to VisualWiki. It can be called by
49      * <code>&lt;?plugin VisualWiki?&gt;</code>, now. This
50      * name must correspond to the filename and the class name.
51      */
52     function getName() {
53         return "VisualWiki";
54     }
55
56     function getVersion() {
57         return preg_replace("/[Revision: $]/", '',
58                             "\$Revision: 1.20 $");
59     }
60
61     /**
62      * Sets textual description.
63      */
64     function getDescription() {
65         return _("Visualizes the Wiki structure in a graph using the 'dot' commandline tool from graphviz.");
66     }
67
68     /**
69      * Returns default arguments. This is put into a separate
70      * function to allow its usage by both <code>getDefaultArguments</code>
71      * and <code>checkArguments</code>
72      */
73     function defaultarguments() {
74         return array('imgtype'        => 'png',
75                      'width'          => false, // was 5, scale it automatically
76                      'height'         => false, // was 7, scale it automatically
77                      'colorby'        => 'age', // sort by 'age' or 'revtime'
78                      'fillnodes'      => 'off',
79                      'label'          => 'name',
80                      'shape'          => 'ellipse',
81                      'large_nb'       => 5,
82                      'recent_nb'      => 5,
83                      'refined_nb'     => 15,
84                      'backlink_nb'    => 5,
85                      'neighbour_list' => '',
86                      'exclude_list'   => '',
87                      'include_list'   => '',
88                      'fontsize'       => 9,
89                      'debug'          => false,
90                      'help'           => false );
91     }
92
93     /**
94      * Sets the default arguments. WikiPlugin also regards these as
95      * the allowed arguments. Since WikiPluginCached stores an image
96      * for each different set of parameters, there can be a lot of
97      * these (large) graphs if you allow different parameters.
98      * Set <code>VISUALWIKI_ALLOWOPTIONS</code> to <code>false</code>
99      * to allow no options to be set and use only the default parameters.
100      * This will need an disk space of about 20 Kbyte all the time.
101      */
102     function getDefaultArguments() {
103         if (VISUALWIKI_ALLOWOPTIONS)
104             return $this->defaultarguments();
105         else
106             return array();
107     }
108
109     /**
110      * Substitutes each forbidden parameter value by the default value
111      * defined in <code>defaultarguments</code>.
112      */
113     function checkArguments(&$arg) {
114         extract($arg);
115         $def = $this->defaultarguments();
116         if (($width < 3) || ($width > 15))
117             $arg['width'] = $def['width'];
118         if (($height < 3) || ($height > 20))
119             $arg['height'] = $def['height'];
120         if (($fontsize < 8) || ($fontsize > 24))
121             $arg['fontsize'] = $def['fontsize'];
122         if (!in_array($label, array('name', 'number')))
123             $arg['label'] = $def['label'];
124
125         if (!in_array($shape, array('ellipse', 'box', 'point', 'circle',
126                                     'plaintext')))
127             $arg['shape'] = $def['shape'];
128         if (!in_array($colorby, array('age', 'revtime')))
129             $arg['colorby'] = $def['colorby'];
130         if (!in_array($fillnodes, array('on', 'off')))
131             $arg['fillnodes'] = $def['fillnodes'];
132         if (($large_nb < 0) || ($large_nb > 50))
133             $arg['large_nb'] = $def['large_nb'];
134         if (($recent_nb < 0)  || ($recent_nb > 50))
135             $arg['recent_nb'] = $def['recent_nb'];
136         if (($refined_nb < 0 ) || ( $refined_nb > 50))
137             $arg['refined_nb'] = $def['refined_nb'];
138         if (($backlink_nb < 0) || ($backlink_nb > 50))
139             $arg['backlink_nb'] = $def['backlink_nb'];
140         // ToDo: check if "ImageCreateFrom$imgtype"() exists.
141         if (!in_array($imgtype, $GLOBALS['PLUGIN_CACHED_IMGTYPES']))
142             $arg['imgtype'] = $def['imgtype'];
143         if (empty($fontname))
144             $arg['fontname'] = VISUALWIKIFONT;
145     }
146
147     /**
148      * Checks options, creates help page if necessary, calls both
149      * database access and image map production functions.
150      * @return array($map,$html)
151      */
152     function getMap($dbi, $argarray, $request) {
153         if (!VISUALWIKI_ALLOWOPTIONS)
154             $argarray = $this->defaultarguments();
155         $this->checkArguments($argarray);
156         $request->setArg('debug',$argarray['debug']);
157         //extract($argarray);
158         if ($argarray['help'])
159             return array($this->helpImage(), ' '); // FIXME
160         $this->createColors();
161         $this->extract_wikipages($dbi, $argarray);
162         /* ($dbi,  $large, $recent, $refined, $backlink,
163             $neighbour, $excludelist, $includelist, $color); */
164         $result = $this->invokeDot($argarray);
165         if (isa($result, 'HtmlElement'))
166             return array(false, $result);
167         else
168             return $result;
169         /* => ($width, $height, $color, $shape, $text); */
170     }
171
172     // ------------------------------------------------------------------------------------------
173
174     /**
175      * Returns an image containing a usage description of the plugin.
176      * @return string image handle
177      */
178     function helpImage() {
179         $def = $this->defaultarguments();
180         $other_imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES'];
181         unset ($other_imgtypes[$def['imgtype']]);
182         $helparr = array(
183             '<?plugin '.$this->getName() .
184             ' img'             => ' = "' . $def['imgtype'] . "(default)|" . join('|',$GLOBALS['PLUGIN_CACHED_IMGTYPES']).'"',
185             'width'            => ' = "width in inches"',
186             'height'           => ' = "height in inches"',
187             'fontname'         => ' = "font family"',
188             'fontsize'         => ' = "fontsize in points"',
189             'colorby'          => ' = "age|revtime|none"',
190             'fillnodes'        => ' = "on|off"',
191             'shape'            => ' = "ellipse(default)|box|circle|point"',
192             'label'            => ' = "name|number"',
193             'large_nb'         => ' = "number of largest pages to be selected"',
194             'recent_nb'        => ' = "number of youngest pages"',
195             'refined_nb'       => ' = "#pages with smallest time between revisions"',
196             'backlink_nb'      => ' = "number of pages with most backlinks"',
197             'neighbour_list'   => ' = "find pages linked from and to these pages"',
198             'exclude_list'     => ' = "colon separated list of pages to be excluded"',
199             'include_list'     => ' = "colon separated list"     ?>'
200             );
201         $length = 0;
202         foreach($helparr as $alignright => $alignleft) {
203             $length = max($length, strlen($alignright));
204         }
205         $helptext ='';
206         foreach($helparr as $alignright => $alignleft) {
207             $helptext .= substr('                                                        '
208                                 . $alignright, -$length).$alignleft."\n";
209         }
210         return $this->text2img($helptext, 4, array(1, 0, 0),
211                                array(255, 255, 255));
212     }
213
214
215     /**
216      * Selects the first (smallest or biggest) WikiPages in
217      * a given category.
218      *
219      * @param  number   integer  number of page names to be found
220      * @param  category string   attribute of the pages which is used
221      *                           to compare them
222      * @param  minimum  boolean  true finds smallest, false finds biggest
223      * @return array             list of page names found to be the best
224      */
225     function findbest($number, $category, $minimum ) {
226         // select the $number best in the category '$category'
227         $pages = &$this->pages;
228         $names = &$this->names;
229
230         $selected = array();
231         $i = 0;
232         foreach($names as $name) {
233             if ($i++>=$number)
234                 break;
235             $selected[$name] = $pages[$name][$category];
236         }
237         //echo "<pre>$category "; var_dump($selected); "</pre>";
238         $compareto = $minimum ? 0x79999999 : -0x79999999;
239
240         $i = 0;
241         foreach ($names as $name) {
242             if ($i++<$number)
243                 continue;
244             if ($minimum) {
245                 if (($crit = $pages[$name][$category]) < $compareto) {
246                     $selected[$name] = $crit;
247                     asort($selected, SORT_NUMERIC);
248                     array_pop($selected);
249                     $compareto = end($selected);
250                 }
251             } elseif (($crit = $pages[$name][$category]) > $compareto)  {
252                 $selected[$name] = $crit;
253                 arsort($selected, SORT_NUMERIC);
254                 array_pop($selected);
255                 $compareto = end($selected);
256             }
257         }
258         //echo "<pre>$category "; var_dump($selected); "</pre>";
259
260         return array_keys($selected);
261     }
262
263
264     /**
265     * Extracts a subset of all pages from the wiki and find their
266     * connections to other pages. Also collects some page features
267     * like size, age, revision number which are used to find the
268     * most attractive pages.
269     *
270     * @param  dbi         WikiDB   database handle to access all Wiki pages
271     * @param  LARGE       integer  number of largest pages which should
272     *                              be included
273     * @param  RECENT      integer  number of the youngest pages to be included
274     * @param  REFINED     integer  number of the pages with shortes revision
275     *                              interval
276     * @param  BACKLINK    integer  number of the pages with most backlinks
277     * @param  EXCLUDELIST string   colon ':' separated list of page names which
278     *                              should not be displayed (like PhpWiki, for
279     *                              example)
280     * @param  INCLUDELIST string   colon separated list of pages which are
281     *                              always included (for example your own
282     *                              page :)
283     * @param  COLOR       string   'age', 'revtime' or 'none'; Selects which
284     *                              page feature is used to determine the
285     *                              filling color of the nodes in the graph.
286     * @return void
287     */
288     function extract_wikipages($dbi, $argarray) {
289         // $LARGE, $RECENT, $REFINED, $BACKLINK, $NEIGHBOUR,
290         // $EXCLUDELIST, $INCLUDELIST,$COLOR
291         $now = time();
292
293         extract($argarray);
294         // FIXME: gettextify?
295         $exclude_list   = $exclude_list ? explode(':', $exclude_list) : array();
296         $include_list   = $include_list ? explode(':', $include_list) : array();
297         $neighbour_list = $neighbour_list ? explode(':', $neighbour_list) : array();
298
299         // remove INCLUDED from EXCLUDED, includes override excludes.
300         if ($exclude_list and $include_list) {
301                 $diff = array_diff($exclude_list, $include_list);
302                 if ($diff)
303                     $exclude_list = $diff;
304         }
305
306         // collect all pages
307         $allpages = $dbi->getAllPages(false, false, false, $exclude_list);
308         $pages = &$this->pages;
309         $countpages = 0;
310         while ($page = $allpages->next()) {
311             $name = $page->getName();
312
313             // skip excluded pages
314             if (in_array($name, $exclude_list)) {
315                 $page->free();  
316                 continue;
317             }
318
319             // false = get links from actual page
320             // true  = get links to actual page ("backlinks")
321             $backlinks = $page->getLinks(true);
322             unset($bconnection);
323             $bconnection = array();
324             while ($blink = $backlinks->next()) {
325                 array_push($bconnection, $blink->getName());
326             }
327             $backlinks->free();
328             unset($backlinks);
329
330             // include all neighbours of pages listed in $NEIGHBOUR
331             if (in_array($name, $neighbour_list)) {
332                 $ln = $page->getLinks(false);
333                 $con = array();
334                 while ($link = $ln->next()) {
335                     array_push($con, $link->getName());
336                 }
337                 $include_list = array_merge($include_list, $bconnection, $con);
338                 $ln->free();
339                 unset($l);
340                 unset($con);
341             }
342
343             unset($rev);
344             $rev = $page->getCurrentRevision();
345
346             $pages[$name] = array(
347                 'age'         => $now - $rev->get('mtime'),
348                 'revnr'       => $rev->getVersion(),
349                 'links'       => array(),
350                 'backlink_nb' => count($bconnection),
351                 'backlinks'   => $bconnection,
352                 'size'        => 1000 // FIXME
353                 );
354             $pages[$name]['revtime'] = $pages[$name]['age'] / ($pages[$name]['revnr']);
355
356             unset($page);
357         }
358         $allpages->free();
359         unset($allpages);
360         $this->names = array_keys($pages);
361
362         $countpages = count($pages);
363
364         // now select each page matching to given parameters
365         $all_selected = array_unique(array_merge(
366             $this->findbest($recent_nb,   'age',         true),
367             $this->findbest($refined_nb,  'revtime',     true),
368             $x = $this->findbest($backlink_nb, 'backlink_nb', false),
369 //          $this->findbest($large_nb,    'size',        false),
370             $include_list));
371
372         foreach($all_selected as $name)
373             if (isset($pages[$name]))
374                 $newpages[$name] = $pages[$name];
375         unset($this->names);
376         unset($this->pages);
377         $this->pages = $newpages;
378         $pages = &$this->pages;
379         $this->names = array_keys($pages);
380         unset($newpages);
381         unset($all_selected);
382
383         $countpages = count($pages);
384
385         // remove dead links and collect links
386         reset($pages);
387         while( list($name, $page) = each($pages) ) {
388             if (is_array($page['backlinks'])) {
389                 reset($page['backlinks']);
390                 while ( list($index, $link) = each( $page['backlinks'] ) ) {
391                     if ( !isset($pages[$link]) || $link == $name ) {
392                         unset($pages[$name]['backlinks'][$index]);
393                     } else {
394                         array_push($pages[$link]['links'],$name);
395                         //array_push($this->everylink, array($link,$name));
396                     }
397                 }
398             }
399         }
400
401         if ($colorby == 'none')
402             return;
403         list($oldestname) = $this->findbest(1, $colorby, false);
404         $this->oldest = $pages[$oldestname][$colorby];
405         foreach($this->names as $name)
406             $pages[$name]['color'] = $this->getColor($pages[$name][$colorby] / $this->oldest);
407     }
408
409     /**
410      * Creates the text file description of the graph needed to invoke
411      * <code>dot</code>.
412      *
413      * @param filename  string  name of the dot file to be created
414      * @param width     float   width of the output graph in inches
415      * @param height    float   height of the graph in inches
416      * @param colorby   string  color sceme beeing used ('age', 'revtime',
417      *                                                   'none')
418      * @param shape     string  node shape; 'ellipse', 'box', 'circle', 'point'
419      * @param label     string  'name': label by name,
420      *                          'number': label by unique number
421      * @return boolean          error status; true=ok; false=error
422      */
423     function createDotFile($filename, $argarray) {
424         extract($argarray);
425         if (!$fp = fopen($filename, 'w'))
426             return false;
427
428         $fillstring = ($fillnodes == 'on') ? 'style=filled,' : '';
429
430         $ok = true;
431         $names = &$this->names;
432         $pages = &$this->pages;
433         if ($names)
434             $nametonumber = array_flip($names);
435
436         $dot = "digraph VisualWiki {\n" // }
437             . (!empty($fontpath) ? "    fontpath=\"$fontpath\"\n" : "");
438         if ($width and $height)
439             $dot .= "    size=\"$width,$height\";\n    ";
440
441
442         switch ($shape) {
443         case 'point':
444             $dot .= "edge [arrowhead=none];\nnode [shape=$shape,fontname=$fontname,width=0.15,height=0.15,fontsize=$fontsize];\n";
445             break;
446         case 'box':
447             $dot .= "node [shape=$shape,fontname=$fontname,width=0.4,height=0.4,fontsize=$fontsize];\n";
448             break;
449         case 'circle':
450             $dot .= "node [shape=$shape,fontname=$fontname,width=0.25,height=0.25,fontsize=$fontsize];\n";
451             break;
452         default :
453             $dot .= "node [fontname=$fontname,shape=$shape,fontsize=$fontsize];\n" ;
454         }
455         $dot .= "\n";
456         $i = 0;
457         foreach ($names as $name) {
458
459             $url = rawurlencode($name);
460             // patch to allow Page/SubPage
461             $url = str_replace(urlencode(SUBPAGE_SEPARATOR), SUBPAGE_SEPARATOR, $url);
462             $nodename = ($label != 'name' ? $nametonumber[$name] + 1 : $name);
463
464             $dot .= "    \"$nodename\" [URL=\"$url\"";
465             if ($colorby != 'none') {
466                 $col = $pages[$name]['color'];
467                 $dot .= sprintf(',%scolor="#%02X%02X%02X"', $fillstring,
468                                 $col[0], $col[1], $col[2]);
469             }
470             $dot .= "];\n";
471
472             if (!empty($pages[$name]['links'])) {
473                 unset($linkarray);
474                 if ($label != 'name')
475                     foreach($pages[$name]['links'] as $linkname)
476                         $linkarray[] = $nametonumber[$linkname] + 1;
477                 else
478                     $linkarray = $pages[$name]['links'];
479                 $linkstring = join('"; "', $linkarray );
480
481                 $c = count($pages[$name]['links']);
482                 $dot .= "        \"$nodename\" -> "
483                      . ($c>1?'{':'')
484                      . "\"$linkstring\";"
485                      . ($c>1?'}':'')
486                      . "\n";
487             }
488         }
489         if ($colorby != 'none') {
490             $dot .= "\n    subgraph cluster_legend {\n"
491                  . "         node[fontname=$fontname,shape=box,width=0.4,height=0.4,fontsize=$fontsize];\n"
492                  . "         fillcolor=lightgrey;\n"
493                  . "         style=filled;\n"
494                  . "         fontname=$fontname;\n"
495                  . "         fontsize=$fontsize;\n"
496                  . "         label=\"".gettext("Legend")."\";\n";
497             $oldest= ceil($this->oldest / (24 * 3600));
498             $max = 5;
499             $legend = array();
500             for($i = 0; $i < $max; $i++) {
501                 $time = floor($i / $max * $oldest);
502                 $name = '"' . $time .' '. _("days") .'"';
503                 $col = $this->getColor($i/$max);
504                 $dot .= sprintf('       %s [%scolor="#%02X%02X%02X"];',
505                                 $name, $fillstring, $col[0], $col[1], $col[2])
506                     . "\n";
507                 $legend[] = $name;
508             }
509             $dot .= '        '. join(' -> ', $legend)
510                 . ";\n    }\n";
511         }
512
513         // {
514         $dot .= "}\n";
515         $this->source = $dot;
516         // write a temp file
517         $ok = fwrite($fp, $dot);
518         $ok = fclose($fp) && $ok;  // close anyway
519
520         return $ok;
521     }
522
523
524     /** 
525      * static workaround on broken Cache or broken dot executable, 
526      * called only if debug=static.
527      *
528      * @access private
529      * @param  url      string  url pointing to the image part of the map
530      * @param  map      string  &lt;area&gt; tags defining active
531      *                          regions in the map
532      * @param  dbi      WikiDB  database abstraction class
533      * @param  argarray array   complete (!) arguments to produce 
534      *                          image. It is not necessary to call 
535      *                          WikiPlugin->getArgs anymore.
536      * @param  request  Request ??? 
537      * @return          string  html output
538      */
539     function embedImg($url,&$dbi,$argarray,&$request) {
540         if (!VISUALWIKI_ALLOWOPTIONS)
541             $argarray = $this->defaultarguments();
542         $this->checkArguments($argarray);
543         //extract($argarray);
544         if ($argarray['help'])
545             return array($this->helpImage(), ' '); // FIXME
546         $this->createColors();
547         $this->extract_wikipages($dbi, $argarray);
548         list($imagehandle, $content['html']) = $this->invokeDot($argarray);
549         // write to uploads and produce static url
550         $file_dir = getUploadFilePath();
551         $upload_dir = getUploadDataPath();
552         $tmpfile = tempnam($file_dir,"VisualWiki").".".$argarray['imgtype'];
553         WikiPluginCached::writeImage($argarray['imgtype'], $imagehandle, $tmpfile);             
554         ImageDestroy($imagehandle);
555         return WikiPluginCached::embedMap(1,$upload_dir.basename($tmpfile),$content['html'],
556                                           $dbi,$argarray,$request);
557     }
558
559     /**
560      * Prepares some rainbow colors for the nodes of the graph
561      * and stores them in an array which may be accessed with
562      * <code>getColor</code>.
563      */
564     function createColors() {
565         $predefcolors = array(
566              array('red' => 255, 'green' =>   0, 'blue' =>   0),
567              array('red' => 255, 'green' => 255, 'blue' =>   0),
568              array('red' =>   0, 'green' => 255, 'blue' =>   0),
569              array('red' =>   0, 'green' => 255, 'blue' => 255),
570              array('red' =>   0, 'green' =>   0, 'blue' => 255),
571              array('red' => 100, 'green' => 100, 'blue' => 100)
572              );
573
574         $steps = 2;
575         $numberofcolors = count($predefcolors) * $steps;
576
577         $promille = -1;
578         foreach($predefcolors as $color) {
579             if ($promille < 0) {
580                 $oldcolor = $color;
581                 $promille = 0;
582                 continue;
583             }
584             for ($i = 0; $i < $steps; $i++)
585                 $this->ColorTab[++$promille / $numberofcolors * 1000] = array(
586                     floor(interpolate( $oldcolor['red'],   $color['red'],   $i/$steps )),
587                     floor(interpolate( $oldcolor['green'], $color['green'], $i/$steps )),
588                     floor(interpolate( $oldcolor['blue'],  $color['blue'],  $i/$steps ))
589                 );
590             $oldcolor = $color;
591         }
592 //echo"<pre>";  var_dump($this->ColorTab); echo "</pre>";
593     }
594
595     /**
596      * Translates a value from 0.0 to 1.0 into rainbow color.
597      * red -&gt; orange -&gt; green -&gt; blue -&gt; gray
598      *
599      * @param promille float value between 0.0 and 1.0
600      * @return array(red,green,blue)
601      */
602     function getColor($promille) {
603         foreach( $this->ColorTab as $pro => $col ) {
604             if ($promille*1000 < $pro)
605                 return $col;
606         }
607         $lastcol = end($this->ColorTab);
608         return $lastcol;
609     }
610 }
611
612 /**
613  * Linear interpolates a value between two point a and b
614  * at a value pos.
615  * @return float  interpolated value
616  */
617 function interpolate($a, $b, $pos) {
618     return $a + ($b - $a) * $pos;
619 }
620
621 // $Log: not supported by cvs2svn $
622 // Revision 1.19  2005/10/12 06:19:31  rurban
623 // remove INCLUDED from EXCLUDED, includes override excludes.
624 //
625 // Revision 1.18  2004/12/17 16:49:52  rurban
626 // avoid Invalid username message on Sign In button click
627 //
628 // Revision 1.17  2004/10/14 19:19:34  rurban
629 // loadsave: check if the dumped file will be accessible from outside.
630 // and some other minor fixes. (cvsclient native not yet ready)
631 //
632 // Revision 1.16  2004/10/12 15:34:47  rurban
633 // redirect stderr to display the failing msg
634 //
635 // Revision 1.15  2004/09/08 13:38:00  rurban
636 // improve loadfile stability by using markup=2 as default for undefined markup-style.
637 // use more refs for huge objects.
638 // fix debug=static issue in WikiPluginCached
639 //
640 // Revision 1.14  2004/09/07 13:26:31  rurban
641 // new WikiPluginCached option debug=static and some more sf.net defaults for VisualWiki
642 //
643 // Revision 1.13  2004/09/06 12:13:00  rurban
644 // provide sf.net default dotbin
645 //
646 // Revision 1.12  2004/09/06 12:08:50  rurban
647 // memory_limit on unix workaround
648 // VisualWiki: default autosize image
649 //
650 // Revision 1.11  2004/09/06 10:10:27  rurban
651 // fixed syntax error
652 //
653 // Revision 1.10  2004/06/19 10:06:38  rurban
654 // Moved lib/plugincache-config.php to config/*.ini
655 // use PLUGIN_CACHED_* constants instead of global $CacheParams
656 //
657 // Revision 1.9  2004/06/03 09:40:57  rurban
658 // WikiPluginCache improvements
659 //
660 // Revision 1.8  2004/01/26 09:18:00  rurban
661 // * changed stored pref representation as before.
662 //   the array of objects is 1) bigger and 2)
663 //   less portable. If we would import packed pref
664 //   objects and the object definition was changed, PHP would fail.
665 //   This doesn't happen with an simple array of non-default values.
666 // * use $prefs->retrieve and $prefs->store methods, where retrieve
667 //   understands the interim format of array of objects also.
668 // * simplified $prefs->get() and fixed $prefs->set()
669 // * added $user->_userid and class '_WikiUser' portability functions
670 // * fixed $user object ->_level upgrading, mostly using sessions.
671 //   this fixes yesterdays problems with loosing authorization level.
672 // * fixed WikiUserNew::checkPass to return the _level
673 // * fixed WikiUserNew::isSignedIn
674 // * added explodePageList to class PageList, support sortby arg
675 // * fixed UserPreferences for WikiUserNew
676 // * fixed WikiPlugin for empty defaults array
677 // * UnfoldSubpages: added pagename arg, renamed pages arg,
678 //   removed sort arg, support sortby arg
679 //
680 // Revision 1.7  2003/03/03 13:57:31  carstenklapp
681 // Added fontpath (see PhpWiki:VisualWiki), tries to be smart about which OS.
682 // (This plugin still doesn't work for me on OS X, but at least image files
683 // are actually being created now in '/tmp/cache'.)
684 //
685 // Revision 1.6  2003/01/18 22:11:45  carstenklapp
686 // Code cleanup:
687 // Reformatting & tabs to spaces;
688 // Added copyleft, getVersion, getDescription, rcs_id.
689 //
690
691 // Local Variables:
692 // mode: php
693 // tab-width: 8
694 // c-basic-offset: 4
695 // c-hanging-comment-ender-p: nil
696 // indent-tabs-mode: nil
697 // End:
698 ?>