php - Zend and Social Engine 4 - getting zend database configuration information -
before hand - regarding issue! running social engine 4.8.7 trying information default zend database configuration settings , new zend framework.
the internet has yielded many answers in none work... in our controller have tried:
$this->getinvokearg('bootstrap')->getoptions()
- fatal error: call undefined method ::getinvokearg()
new zend_config($this->getoptions());
- fatal error: call undefined method ::getoptions()
$this->application->getoptions()
- fatal error: call undefined method ::getoptions()
zend_controller_front::getinstance()->getparam('bootstrap')->getoptions();
- returns empty array " array(0) { } "
zend_registry::get('db')
- gives null
zend_registry::getinstance()['db']
- gives null
and have tried many other suggestions either give null or fatal errors our controller.php
at current our temporary solution not elegant @ works:
$config = new zend_config(include 'application/settings/database.php'); $config->adapter
which gives "mysqli". above can used retrieving database configuration information causes - serious security concerns.
is there correct way of getting same information zend without having access file directly?
thanks
<?php /** * @var zend_db_adapter_abstract $adapter */ $adapter = engine_api::_()->getmodulebootstrap('core')->getcontainer()->offsetget('db'); $config = $adapter->getconfig();
Comments
Post a Comment