private function __construct() {
$pathToFile = APPLICATION_PATH . '/configs/xhprof.ini';
if (file_exists($pathToFile)) {
$xhprofIni = new Zend_Config_Ini($pathToFile);
if (null == ($config = $xhprofIni->get(APPLICATION_ENV)) && null == ($config = $xhprofIni->get('default'))) {
require_once 'Zend/Application/Exception.php';
throw new Zend_Application_Exception("Błędne ustawienia dla XHprof w pliku xhprof.ini");
}
$this->_xhprofConfigData = $config;
if (null !== $this->_xhprofConfigData && $this->_xhprofConfigData->count() >= 1) {
$dbAdapter = new Zend_Db_Adapter_Pdo_Pgsql(array(
'host' => $this->_xhprofConfigData->get('xhprof')->db->host,
'username' => $this->_xhprofConfigData->get('xhprof')->db->username,
'password' => $this->_xhprofConfigData->get('xhprof')->db->password,
'dbname' => $this->_xhprofConfigData->get('xhprof')->db->dbname,
'port' => $this->_xhprofConfigData->get('xhprof')->db->port
));
$this->_dbAdapter = $dbAdapter;
}
}
}