Heim  >  Artikel  >  Backend-Entwicklung  >  jpgraph cache问题,错误提示25113

jpgraph cache问题,错误提示25113

WBOY
WBOYOriginal
2016-06-23 14:10:501015Durchsuche

jpg-config.inc.php配置如下:

define('USE_CACHE',TRUE);

define('READ_CACHE',true);

define('CACHE_DIR','C:/Program Files/www/oa/ywtj/tmp/jpgraph_cache/');

脚本如下:
include ("../Examples/jpgraph/jpgraph.php");
include ("../Examples/jpgraph/jpgraph_bar.php");
$datay=array(1,2,3,4);//纵坐标数据
$datax=array(a,b,c,d);//横坐标数据
foreach ($usernums as $key => $value){
$datay[] = $value;
$datax[] = $userids[$key];
}
$graph = new Graph(800,600,'auto',1); //********缓存时间为1分钟************
$graph->SetScale("textlin");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->xaxis->SetLabelAngle(30);
$graph->yaxis->scale->SetGrace(20);
$graph->xaxis->scale->SetGrace(20);
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
$bplot = new BarPlot($datay);
$bplot->SetFillColor('orange');
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat('%d');
$graph->Add($bplot);
$graph->title->Set("光缆利用率统计表");
$graph->xaxis->title->Set("经营部名称");
$graph->yaxis->title->Set("经营部占用情况");
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->Stroke();

第一次访问时,cache文件夹内生成一个copy图片,第2次访问时,生成的copy图片字节为0,第3次访问时就出现错误提示


回复讨论(解决方案)

无法删除缓存图像?
文件名都是空的,如何能删除?

这个玩意很不稳定嘛,慎用

谢谢版主,它提示无法删除缓存图像,缓存实际应用的原理应该是第一次向浏览器返回图片的同时也向缓存中生成COPY,第2次访问时就应该访问缓存并判断了,根据缓存中copy的时间长短来确定是返回浏览器还是更新缓存,但我在应用中感觉无论在任何时间访问程序,都向缓存中写入,第一次生成图片copy,但第2次就将图片copy更新成了0字节,比较纳闷。

还是不行,结贴了

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn