-- Jake McGraw <[EMAIL PROTECTED]> wrote
(on Friday, 15 August 2008, 11:42 AM -0400):
> > Do you have ext/json installed?
> 
> According to phpinfo():
> 
> json
> json support enabled
> json version 1.2.1
> 
> and grepping our ini file:
> 
> ;extension=json.so
> 
> So, I assume we're using the built-in version of json_(encode|decode)
> 
> > This is (I hope) unlikely, but if you somehow have Xdebug installed on this 
> > production server, Zend_Json can trigger xdebug.max_nesting_level in 
> > certain situations.  You would probably see an error in this case, but I'm 
> > including this just to be on the safe side.
> 
> Grepping out ini file:
> 
> ;extension=xdebug.so
> zend_extension_ts="/usr/local/lib/php/extensions/no-debug-non-zts-20050922/xdebug.so"

Comment out the above line and see what happens -- this is what the
previous comment was getting at.


> Again, nothing in error reporting, logging, etc. Just a blank screen.
> Also, this works fine (same JSON) outside of Zend_Controller_Action.
> 
> > -Matt
> >
> > On Fri, Aug 15, 2008 at 8:20 AM, Jake McGraw <[EMAIL PROTECTED]> wrote:
> >>
> >> I've spent the last two days struggling with this error:
> >>
> >> We've been utilizing REST-ful JSON server for a couple of months now to 
> >> host our data api (it's written using Zend Framework). Our client apps 
> >> access this API, and decode the JSON. Yesterday, one of our client apps 
> >> stopped working, generating no errors, no ouput, just a blank screen. 
> >> After commenting out the majority of the code, we found the following code 
> >> was causing the grief:
> >>
> >> <?php
> >>
> >> // BaseController extends Zend_Controller_Action
> >> class CustomController extends BaseController {
> >>
> >>   public function someAction() {
> >>
> >>     $result = $this->api->get('resource', array('field1' => 'value1'));
> >>
> >>     $result = Zend_Json::decode($result->getResponse()->getBody());
> >>
> >>     var_dump($result);
> >>
> >>     // exit;
> >>   }
> >>
> >> }
> >>
> >> Now, we only get the blank screen when we allow our dispatcher to render 
> >> our Zend_Layout, Zend_View AFTER using Zend_Json::decode, all the 
> >> following logic steps work fine:
> >>
> >> - Uncomment exit, prevent Layout, View rendering
> >> var_dump($result);
> >> exit;
> >>
> >> - Check body for valid JSON (everything OK in JSON Lint)
> >> - Layout, View render correctly
> >> var_dump($result->getResponse()->getBody());
> >>
> >> - Try another JSON string
> >> - Layout, View render correctly
> >> var_dump(Zend_Json::decode('[{"foo":"bar"}]'));
> >>
> >> The JSON looks something like this:
> >>
> >> [
> >>     {
> >>         "cm_broadcast_type": "National Broadcast Networks",
> >>         "id": "12659575",
> >>         "station_id": "12336",
> >>         "program_id": "EP010501290006",
> >>         "start_time": "20080814000000",
> >>         "end_time": "20080814010000",
> >>         "cc": "Y",
> >>         "title": "Greatest American Dog"
> >>     },
> >>     {
> >>         "cm_broadcast_type": "National Broadcast Networks",
> >>         "id": "11469048",
> >>         "station_id": "12336",
> >>         "program_id": "EP007537910036",
> >>         "start_time": "20080814010000",
> >>         "end_time": "20080814020000",
> >>         "cc": "Y",
> >>         "title": "Criminal Minds"
> >>     },
> >>     ... Continue ...
> >> ]
> >>
> >> So, as I've said, the problem only occurs when we allow the dispatcher to 
> >> continue rendering Layout, View after using Zend_Json::decode, any help 
> >> would be MUCH appreciated.
> >>
> >> - jake
> 

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to