Skip to content

Commit

Permalink
Short array syntax declaration redone for PHP 5.3 compatibility. (Thi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Schekotov authored and avbdr committed Aug 10, 2017
1 parent c6811cd commit 8b58668
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MysqliDb
* MySQLi instances
* @var mysqli[]
*/
protected $_mysqli = [];
protected $_mysqli = array();

/**
* The SQL query to be prepared and executed
Expand Down Expand Up @@ -211,7 +211,7 @@ class MysqliDb
/**
* @var array connections settings [profile_name=>[same_as_contruct_args]]
*/
protected $connectionsSettings = [];
protected $connectionsSettings = array();
/**
* @var string the name of a default (main) mysqli connection
*/
Expand Down Expand Up @@ -240,15 +240,15 @@ public function __construct($host = null, $username = null, $password = null, $d
}
}

$this->addConnection('default', [
$this->addConnection('default', array(
'host' => $host,
'username' => $username,
'password' => $password,
'db' => $db,
'port' => $port,
'socket' => $socket,
'charset' => $charset
]);
));

if ($isSubQuery) {
$this->isSubQuery = true;
Expand Down Expand Up @@ -345,8 +345,8 @@ public function disconnect($connection = 'default')
*/
public function addConnection($name, array $params)
{
$this->connectionsSettings[$name] = [];
foreach (['host', 'username', 'password', 'db', 'port', 'socket', 'charset'] as $k) {
$this->connectionsSettings[$name] = array();
foreach (array('host', 'username', 'password', 'db', 'port', 'socket', 'charset') as $k) {
$prm = isset($params[$k]) ? $params[$k] : null;

if ($k == 'host') {
Expand Down Expand Up @@ -2161,7 +2161,7 @@ public static function subQuery($subQueryAlias = "")
public function copy()
{
$copy = unserialize(serialize($this));
$copy->_mysqli = [];
$copy->_mysqli = array();
return $copy;
}

Expand Down

0 comments on commit 8b58668

Please sign in to comment.