apprentice (77) [Avatar] Offline
#1
Is it dangerous to store config in registry?
When I ran this code on a view page to confirm if config was stored in registry correctly.

<pre>
$config = Zend_Registry::get('config');
Zend_Debug::dump($config);
</pre>

I realized that I've made my hostname, username and password into a global array variable sort of. Isn't this like inviting hackers to break in?
akrabat (479) [Avatar] Offline
#2
Re: Is it dangerous to store config in registry?
Personally, I don't think it's a major problem.

However, there's nothing to stop you loading a sub-key into the registry object:

[pre]
$config = new Zend_Config_Ini($filename);
Zend_Registry::set('config', $config->app);
[/pre]

And then put all the settings that you want to get at within the app hierarchy.

Regards,

Rob...
apprentice (77) [Avatar] Offline
#3
Re: Is it dangerous to store config in registry?

Personally, I don't think it's a major problem.


Thanks, now I feel more secure with my work.