I have these lines in my application.ini
how can I read user in my contrroler
resources.doctrine.dbal.connections.default.parameters.driver = "pdo_mysql"
resources.doctrine.dbal.connections.default.parameters.dbname = "zc"
resources.doctrine.dbal.connections.default.parameters.host = "localhost"
resources.doctrine.dbal.connections.default.parameters.port = 3306
resources.doctrine.dbal.connections.default.parameters.user = "root"
resources.doctrine.dbal.connections.default.parameters.password = "123456"
I use of this code but it retuens null
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$user = $bootstrap->getOption('user');
var_dump($user);
edit: how may I read all of connections options ?
I think you should use
$this->getInvokeArgs('bootstrap');
For more info see this chapter in manual.
What about using
$conf = $bootstrap->getOption('resources');
$dbConf = $conf['doctrine']['dbal']['connections']['default']['parameters'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With