From: Franky <lie...@pa...> - 2004-04-30 08:38:05
|
Franky wrote: > I found another "small" thing I leave up to Karsten to fix: > > include/jpgraph/jpgraph.php: > ==> USE_CACHE is set to false > ==> further down, because USE_CACHE==false: > CACHE_DIR is defined as '' > > now in some modules (modules/calendar2/month_gantt.php, > modules/calendar2/year_gantt.php, modules/projects/index.php, > modules/tts/mygantt.php) CACHE_DIR is already defined: > define('CACHE_DIR',CACHE_FOLDER); > > ==> this results in a php notice warning: > Notice: Constant CACHE_DIR already defined in > /var/www/html/mgw/include/jpgraph/jpgraph.php on line 212 > > What to do? Remove from all the mentioned files the definition of > CACHE_DIR and put it in the correct place in include/jpgraph/jpgraph.php > (if USE_CACHE is true) > It's getting deeper than that: all mentioned files above use $graph->Stroke($filename) which results in a file in the CACHE_FOLDER directory ($filename is defined like that), but they never get cleaned up ... So if somebody uses this a lot, the CACHE_FOLDER dir gets polluted quite quickly ... The best solution is to create php files that do the graph calculations (btw, calendar2 code is really ugly), and call it from within the template. Eg. <img src="mygraph.php?parameters..."> and in mygraph.php, end with a call to Stroke without filename, so it gets streamed to the screen directly: $graph->Stroke(); This is a cleanup task waiting to happen ... I'll create a feature request for this ... Franky |