[fw-general] Zend Registry
Hi, It says in the manual that Zend_Registry when used as an introspective object has buggy behaviour is some versions of PHP, but it doesn't state which versions. If it's like 5.1.* then it doesn't matter, but some clarification would be good. $glob = new Zend_Registry( array(), ArrayObject::ARRAY_AS_PROPS ) ; Regards, Alex -- --- Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps -- http://shelter.nu/blog/
Re: [fw-general] Zend Registry
-- Alexander Johannesen alexander.johanne...@gmail.com wrote (on Friday, 03 April 2009, 07:43 PM +1100): It says in the manual that Zend_Registry when used as an introspective object has buggy behaviour is some versions of PHP, but it doesn't state which versions. If it's like 5.1.* then it doesn't matter, but some clarification would be good. $glob = new Zend_Registry( array(), ArrayObject::ARRAY_AS_PROPS ) ; PHP 5.2.0 specifically. That particular version shipped a broken version of ArrayObject; releases prior and following work fine. -- Matthew Weier O'Phinney Software Architect | matt...@zend.com Zend Framework | http://framework.zend.com/
Re: [fw-general] zend registry problem
Thanks a lot :) i am using Zend_Session to do the job, i dunno how i forgot this :D thanks a lot for those who helped i really appreciate it. On Fri, Aug 8, 2008 at 1:13 PM, Carlos Medina [EMAIL PROTECTED]wrote: Ahmed Abdel-Aliem schrieb: Dear All, i have a problem setting a value in Zend_Registry and retrieving it back in another page *here is the scenario, when a user log in i set his last login from the database in a variable :* Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row[user_last_login]); *and in the page he is redirected to i try to retrieve this variable like this :* Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); *the page return the following error :* The following error occurred: exception 'Zend_Exception' with message 'No entry is registered for key 'user_last_login'' in /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace: #0 /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46): Zend_Registry::get('user_last_login') #1 /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502): IndexController-indexAction() #2 /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action-dispatch('indexAction') #3 /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Library/WebServer/Documents/cha/admin/index.php(53): Zend_Controller_Front-dispatch() #5 {main} i dunno why it is not working while i can easily retrieve any variable i set in the registry in my bootstrap here is how i deal with the registry in my bootstrap $registery = Zend_Registry::getInstance(); Zend_Registry::set('connection', $config-database); Zend_Registry::set('pageLimit', $dataConfig-pages-limit); Zend_Registry::set('truepath', '/cha/application/admin/'); Zend_Registry::set('urlpath', 'http://localhost/cha/admin/'http://localhost/cha/admin/%27 ); can anyone give me a hand in this please ? thanks in advance. * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com* Acting by Reacting : By not printing this e-mail I help protect the environment. Hi, i Use the Zend Registry with Zend_Registry::set( $strRegistryName, $objRegistryObject ); // use variables on the setRegistry Method anyware. and i get the Data with Zend_Registry::get( 'registry' ); Regards Carlos * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com Acting by Reacting : By not printing this e-mail I help protect the environment.*
[fw-general] zend registry problem
Dear All, i have a problem setting a value in Zend_Registry and retrieving it back in another page *here is the scenario, when a user log in i set his last login from the database in a variable :* Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row[user_last_login]); *and in the page he is redirected to i try to retrieve this variable like this :* Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); *the page return the following error :* The following error occurred: exception 'Zend_Exception' with message 'No entry is registered for key 'user_last_login'' in /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace: #0 /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46): Zend_Registry::get('user_last_login') #1 /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502): IndexController-indexAction() #2 /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action-dispatch('indexAction') #3 /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Library/WebServer/Documents/cha/admin/index.php(53): Zend_Controller_Front-dispatch() #5 {main} i dunno why it is not working while i can easily retrieve any variable i set in the registry in my bootstrap here is how i deal with the registry in my bootstrap $registery = Zend_Registry::getInstance(); Zend_Registry::set('connection', $config-database); Zend_Registry::set('pageLimit', $dataConfig-pages-limit); Zend_Registry::set('truepath', '/cha/application/admin/'); Zend_Registry::set('urlpath', 'http://localhost/cha/admin/'); can anyone give me a hand in this please ? thanks in advance. * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com* Acting by Reacting : By not printing this e-mail I help protect the environment.
Re: [fw-general] zend registry problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 can anyone give me a hand in this please ? You need to persist your Zend_Registry instance in a session, or use Zend_Session instead of Zend_Registry for storing the last login data. David. - -- David Goodwin Pale Purple Limited Office: 0845 0046746 Mobile: 07792380669 http://www.palepurple.co.ukCompany No: 5580814 'Business Web Application Development and Training in PHP' -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFInBXw/ISo3RF5V6YRAploAKCzRHvGMreFufmvwJquObSUDBu2LwCgy2Yk fgaMiQTmZqrewET7bz4ALPo= =FrRE -END PGP SIGNATURE-
Re: [fw-general] zend registry problem
On 8 Aug 2008, at 10:34, Ahmed Abdel-Aliem wrote: here is the scenario, when a user log in i set his last login from the database in a variable : Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row [user_last_login]); and in the page he is redirected to i try to retrieve this variable like this : Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); Hi, If you are using a **redirect** then you are starting a new request. You would need to store the last login data in a session (rather than the registry) in order to access it. Try: $session = new Zend_Session_Namespace('login'); $session-user_last_login = $user_row[user_last_login]; And $session = new Zend_Session_Namespace('login'); echo session-user_last_login; Regards, Carlton
Re: [fw-general] zend registry problem
Ahmed Abdel-Aliem schrieb: Dear All, i have a problem setting a value in Zend_Registry and retrieving it back in another page *here is the scenario, when a user log in i set his last login from the database in a variable :* Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row[user_last_login]); *and in the page he is redirected to i try to retrieve this variable like this :* Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); *the page return the following error :* The following error occurred: exception 'Zend_Exception' with message 'No entry is registered for key 'user_last_login'' in /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace: #0 /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46): Zend_Registry::get('user_last_login') #1 /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502): IndexController-indexAction() #2 /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action-dispatch('indexAction') #3 /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Library/WebServer/Documents/cha/admin/index.php(53): Zend_Controller_Front-dispatch() #5 {main} i dunno why it is not working while i can easily retrieve any variable i set in the registry in my bootstrap here is how i deal with the registry in my bootstrap $registery = Zend_Registry::getInstance(); Zend_Registry::set('connection', $config-database); Zend_Registry::set('pageLimit', $dataConfig-pages-limit); Zend_Registry::set('truepath', '/cha/application/admin/'); Zend_Registry::set('urlpath', 'http://localhost/cha/admin/'); can anyone give me a hand in this please ? thanks in advance. * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com* Acting by Reacting : By not printing this e-mail I help protect the environment. Hi, i Use the Zend Registry with Zend_Registry::set( $strRegistryName, $objRegistryObject ); // use variables on the setRegistry Method anyware. and i get the Data with Zend_Registry::get( 'registry' ); Regards Carlos