summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorphilip <philip@roshambo.org>2017-01-04 10:12:31 -0800
committerDavey Shafik <davey@php.net>2017-01-08 18:43:13 -0500
commitf27f41438680e55d3ac750ce740cc4ae37ba7a0b (patch)
treebc05ac1f20b8b54f853c18689f809dea233e7608 /lib
parent17b3681e4b1543e69a47e11732d98d6d5e67fe0a (diff)
downloadphp7-mysql-shim-f27f41438680e55d3ac750ce740cc4ae37ba7a0b.zip
php7-mysql-shim-f27f41438680e55d3ac750ce740cc4ae37ba7a0b.tar.gz
php7-mysql-shim-f27f41438680e55d3ac750ce740cc4ae37ba7a0b.tar.bz2
Replaced array operator with explicit array() to lower required PHP version. Should be 5.4 or 5.3 now, we'll see
Diffstat (limited to 'lib')
-rw-r--r--lib/mysql.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 088130f..08af607 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -46,7 +46,7 @@ namespace {
}
\Dshafik\MySQL::$last_connection = $conn;
$conn->hash = $hash;
- \Dshafik\MySQL::$connections[$hash] = ['refcount' => 1, 'conn' => $conn];
+ \Dshafik\MySQL::$connections[$hash] = array('refcount' => 1, 'conn' => $conn);
return $conn;
}
@@ -74,7 +74,7 @@ namespace {
// @codeCoverageIgnoreEnd
$conn->hash = $hash;
- \Dshafik\MySQL::$connections[$hash] = ['refcount' => 1, 'conn' => $conn];
+ \Dshafik\MySQL::$connections[$hash] = array('refcount' => 1, 'conn' => $conn);
return $conn;
} catch (\Throwable $e) {
@@ -334,7 +334,7 @@ namespace {
return mysqli_fetch_assoc($result) ?: false;
}
- function mysql_fetch_object($result, $class = null, array $params = []) /* : object|null */
+ function mysql_fetch_object($result, $class = null, array $params = array()) /* : object|null */
{
if (\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
// @codeCoverageIgnoreStart
@@ -625,7 +625,7 @@ namespace Dshafik {
class MySQL
{
public static $last_connection = null;
- public static $connections = [];
+ public static $connections = array();
public static function getConnection($link = null, $func = null)
{
@@ -718,7 +718,7 @@ namespace Dshafik {
protected static function getFieldFlags($what)
{
// Order of flags taken from http://lxr.php.net/xref/PHP_5_6/ext/mysql/php_mysql.c#2507
- $flags = [
+ $flags = array(
MYSQLI_NOT_NULL_FLAG => "not_null",
MYSQLI_PRI_KEY_FLAG => "primary_key",
MYSQLI_UNIQUE_KEY_FLAG => "unique_key",
@@ -731,9 +731,9 @@ namespace Dshafik {
MYSQLI_SET_FLAG => "set",
MYSQLI_AUTO_INCREMENT_FLAG => "auto_increment",
MYSQLI_TIMESTAMP_FLAG => "timestamp",
- ];
+ );
- $fieldFlags = [];
+ $fieldFlags = array();
foreach ($flags as $flag => $value) {
if ($what & $flag) {
$fieldFlags[] = $value;
@@ -745,7 +745,7 @@ namespace Dshafik {
protected static function getFieldType($what)
{
- $types = [
+ $types = array(
MYSQLI_TYPE_STRING => 'string',
MYSQLI_TYPE_VAR_STRING => 'string',
MYSQLI_TYPE_ENUM => 'string',
@@ -778,7 +778,7 @@ namespace Dshafik {
MYSQLI_TYPE_NULL => 'null',
MYSQLI_TYPE_GEOMETRY => 'geometry',
- ];
+ );
return isset($types[$what]) ? $types[$what] : "unknown";
}