This has been resolved. I would have replied earlier but google wasn't
showing the message anywhere for me to reply to.
I should have added that, because there was a ~1kb difference in file
size, I was confident that the problem wasn't extra spaces outside the
PHP tags. What was weird, though, was that I wasn't seeing any obvious
strings inside the data that looked like something Cake might produce.
HOWEVER, I was assuming that the old script was still pointing to the
database the Cake site is using when I compared file sizes (I'd
switched it a couple of times while debugging). So, pointing the old
script to the new DB and using wget again, I found that the old script
was producing a file exactly 2 bytes smaller then the Cake one.
Obviously, the suggestion being that it is, in fact, a couple of
spaces. So, I went back to the scripts and again looked through
everything that could conceivably be included, eventually tracking
down 2 spaces after the closing tag in the AutofieldBehavior class.. I
hadn't thought to looks through the behaviors before that.
So, yeah, i'm pretty embarrassed about this, in case anyone's wondering.
On Thu, Apr 3, 2008 at 5:18 PM, francky06l <[EMAIL PROTECTED]> wrote:
>
> What is the name of your ctp ? graph_sales.ctp or graphSales.ctp ?
>
>
>
> On Apr 3, 6:31 am, "b logica" <[EMAIL PROTECTED]> wrote:
> > I have a controller method that gathers stats to be used to create a
> > graph image. I'm trying to track down whatever is corrupting it,
> > though, because I can't get it to show up.The very same code works for
> > the old site (same server). When I compare the wget output of two, I
> > see that the Cake version (linux file utility says it's simply "data")
> > is about 1K larger. So, it seems that Cake is doing something to it.
> > But I can't figure out what else I can doi besides setting the $layout
> > to null and debug to 0.
> > My view has:
> >
> > <img src="/panels/graphSales.png"
> > style="display: block;width: 700px; height: 300px; margin: 40px
> auto;"
> > alt="graph of sales" />
> >
> > The controller:
> >
> > var $helpers = Array('Graph');
> >
> > function graphSales()
> > {
> > $this->layout = null;
> > $this->autoLayout = false;
> > Configure::write('debug', 0);
> >
> > // stuff to get the data ...
> >
> > $this->set('data', $data);
> >
> > }
> >
> > The view:
> >
> > <?= $graph->makeLineGraph($data) ?>
> >
> > The $graph helper's makeLineGraph() is precisely the same code used
> > for the old site. It finishes by setting the proper headers and
> > calling ImagePNG().
> >
> > The headers I'm seeing are:
> > -- snip --
> > Date: Thu, 03 Apr 2008 04:08:21 GMT
> > Server: Apache/2.2.6 (Fedora)
> > X-Powered-By: PHP/5.2.4
> > P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
> > Expires: Tue, 2 Jul 1974 17:41:00 GMT
> > Last-Modified: Thu, 03 Apr 2008 04:08:22 GMT
> > Cache-Control: no-cache, must-revalidate
> > Pragma: no-cache
> > content-disposition: inline; filename = "index.png"
> > Connection: close
> > Transfer-Encoding: chunked
> > Content-Type: image/png
> >
> > 200 OK
> > -- snip --
> >
> > Note the filename. The script on the old site emits "graph_sales.png".
> > This appears to validate my presumption that the fact that everything
> > is dispatched through webroot/index.php is causing this problem. But I
> > obviously can't go around all that and hit the controller directly.
> >
> > I've been trawling the net, looking at what few examples I could find
> > (outputing CAPTCHAs, thumbnails, etc.) but nothing's jumped out at me.
> > I can't figure out what else to do to have cake simply let the data go
> > out without touching it.
> >
> > I'm stymied by this. Anyone have any ideas?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---