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
Post a Comment