YiiAMQP
YiiAMQP copied to clipboard
Do not get settings from main.php by default.
There is a bug in YiiAMQP\Client which do not allow to get settings from config file by default. In getConnectionConfig method there is $this->_connectionConfig = array( ... . Which add default hardcoded settings to the future connection. But we have already settings in public $server var. My suggestion is using main.php settings there:
public function getConnectionConfig()
{
if ($this->_connectionConfig === array()) {
if($this->server) // Check if $server is not null etc.
$this->_connectionConfig = $this->server; // Use it
else $this->_connectionConfig = array(
'host' => 'localhost',
'port' => 5672,
'user' => 'guest',
'password' => 'guest',
'vhost' => '/',
);
}
return $this->_connectionConfig;
}
Thanks an Michael
Would you like to open a PR with this and I review?
Sent from my iPhone
On 8 Nov 2014, at 01:14, anmishael [email protected] wrote:
There is a bug in YiiAMQP\Client which do not allow to get settings from config file by default. In getConnectionConfig method there is $this->_connectionConfig = array( ... . Which add default hardcoded settings to the future connection. But we have already settings in public $server var. My suggestion is using main.php settings there: public function getConnectionConfig() { if ($this->_connectionConfig === array()) { if($this->server) // Check if $server is not null etc. $this->_connectionConfig = $this->server; // Use it else $this->_connectionConfig = array( 'host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'vhost' => '/', ); } return $this->_connectionConfig; }
— Reply to this email directly or view it on GitHub.
Add suggestion as patch-1