php - How to get DATABASE_CONFIG value inside a plugin in cakephp? -


i want access database_config class values located @ app/config/database.php inside plugin app/plugin/myplugin/bootstrap.php

class database_config {     public $redis = array(         'datasource' => 'redis.redissource',         'host' => '127.0.0.1',         'port' => '6379',         'db' => '2'     ); } 

i want access $redis host , port inside myplugin

edit: cakephp version 2.1.2

get database details :-

app::uses('connectionmanager', 'model'); $datasource = connectionmanager::getdatasource('redis'); $host = $datasource->config['host']; $port = $datasource->config['port']; 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -