I have implemented some graphs using a chart library. Inside this library,
there are various gd calls to create and render a png file.
I have a wrapper class that requires the library class. Inside this class I
have a stroke() method that concludes with this:
$context = sfContext::getInstance();
$this->setHeaders($context);
$context->getResponse()->send();
$pPicture->out();
the out() method has various gd calls and ultimately this:
imagepng($this->Picture);
imagedestroy($this->Picture);
Here is setHeaders()
protected function setHeaders($context) {
$expireDateTime = new DateTime('tomorrow', new DateTimeZone('UTC'));
$response = $context->getResponse();
$response->setHttpHeader('Expires',
$expireDateTime->format(DATE_RFC1123));
$response->setContentType('image/png');
}
The controller code has this:
sfConfig::set('sf_web_debug', false);
$this->getController()->setRenderMode(sfView::RENDER_NONE);
$this->setLayout(false);
... model code, to fill variables, creation of graph object.
$graph->stroke();
return sfView::NONE
When I load the url for the graph controller and look at the net connections
in firebug I see the graph loaded twice.
The symfony log shows this:
....
Mar 16 10:26:44 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
Mar 16 10:26:44 symfony [info] {sfWebResponse} Send header "Expires: Thu, 17
Mar 2011 00:00:00 +0000"
Mar 16 10:26:44 symfony [info] {sfWebResponse} Send header "Content-Type:
image/png"
Mar 16 10:26:44 symfony [info] {sfWebResponse} Send content (0 o)
Mar 16 10:26:44 symfony [info] {sfWebResponse} Send content (0 o)
I have tried a lot of different variations on the code, but I still seem to
have this unexplained issue with the 2x "Send Content" calls, and the 2x
requests for graph.png.
What can I do to remedy this issue?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en