ZF1 Registry - large objects?

For programming and general questions on Zend Framework

ZF1 Registry - large objects?

Postby infamy on Tue Jan 08, 2013 7:49 pm

Hi there,

I'm having an odd looking issue with the registry. I'm attempting to store a router object in it, but for some reason it appears to be lost into invalid memory or something.

When I attempt to store an object of type Zend_Controller_Router_Rewrite, it succeeds, but attempting to access that variable, even for a var_dump, from another page (works fine ont he same page it's set in) crashes ZF (or quite possibly PHP - nothing is output).

I can put other values and objects into it no problem; so I'm wondering if there are size restrictions on Zend_Registry, or I perhaps I need to increase some cache length?

Cheers for any help :)
infamy
 
Posts: 3
Joined: Tue Jan 08, 2013 7:26 pm

Re: ZF1 Registry - large objects?

Postby infamy on Tue Jan 08, 2013 8:06 pm

On further investigation, I managed to get the error

Something is attempting to allocate approximately 300 meg which is killing off PHP - I will look into the cause further when I can and raise a bug if apt.
infamy
 
Posts: 3
Joined: Tue Jan 08, 2013 7:26 pm

Re: ZF1 Registry - objects with circular references?

Postby infamy on Wed Jan 09, 2013 12:31 am

It turns out serializing the object fixes this. I suspect that Zend_Registry cannot handle the Front Controller's circular self-reference and tries to re-build an infinite number of them.

Noted on the help page @ http:// framework[dot]zend[dot]com/manual/1.12/en/zend.registry.using.html#comment-760505287 to consider serialization when dealing with circulars.

Thanks.
infamy
 
Posts: 3
Joined: Tue Jan 08, 2013 7:26 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 10 guests