ob_start crashes G2

Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-08-29 22:58

Hi.

Picked up on the JoomG2 Module and in trying to extend support to V1.6+, I have hit a strange problem.
Basically, right in the middle of Joomla related code, the Joomla flow hits an "ob_start" line which for some reason triggers a "Call to a member function getLockSystem() on a non-object" error.

function getLockSystem() is in GalleryStorage.class and nothing from G2 should be in play in the bit of code here as it is while fetching stuff from Joomla.

Any ideas anyone? Why would a simple ob_start bring the process to a halt? Funny thing is that the 1.5 code is essentially the same here and causes no issues.
Tearing my hair out.

Probably needs core dev input which more or less suggests the process stops here.

--
dakanji.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2011-08-29 23:10
Quote:
Probably needs core dev input which more or less suggests the process stops here.

Maybe, maybe not. I'd try hoping on IRC and just asking the question. Bharat or Valiant might have an idea.

Could you be getting hit by to many or not enough ob_end_flush() calls being made?
http://php.net/manual/en/function.ob-start.php

Quote:
Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active. Just make sure that you call ob_end_flush() the appropriate number of times. If multiple output callback functions are active, output is being filtered sequentially through each of them in nesting order.

Is there an ob_end_clean() that happens to be getting called (not that I know or not if that would cause this as I'm just taking some stabs here)

____________________________________________
Like Gallery? Like the support? Donate now!

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-08-29 23:32

Thanks. I had tried IRC before here but it seems the players aren't around.

It falls over at the ob_start line it self so not chance of getting to the flush. Basically flips from Joomla to an unrelated G2 Class. Funny thing is that the 1.5 code is exactly the same but it works with no issues.

There is a way around it which is to pull the Joomla code into the module and use curl or file get contents to grab the data (instead of the clean, native ob_start, ob_get_contents) and then run regexes on it but to clean it up but will rather not do this if possible as it will mean having to maintain and duplicate the code for future versions, will be noticeably slower as well.

I'll take a break and try the alternative later if there is no joy otherwise.

--
dakanji.com