return false;
} else {
Config::set('database', $funcname, 'success');
- if ($post_update) {
+
+ if ($prefix == 'update') {
Config::set('system', 'build', $x);
}
+
return true;
}
} else {
Config::set('database', $funcname, 'success');
- if ($post_update) {
+
+ if ($prefix == 'update') {
Config::set('system', 'build', $x);
}
+
return true;
}
}
use Friendica\Core\System;
use Friendica\Util\DateTimeFormat;
+use mysqli;
use PDO;
use PDOException;
use PDOStatement;
-use mysqli;
/**
* @class MySQL database class
self::$db_name = $db;
self::$db_charset = $charset;
+ $port = 0;
$serveraddr = trim($serveraddr);
$serverdata = explode(':', $serveraddr);
self::$driver = 'pdo';
$connect = "mysql:host=".$server.";dbname=".$db;
- if (isset($port)) {
+ if ($port > 0) {
$connect .= ";port=".$port;
}
}
}
- if (!self::$connected && class_exists('mysqli')) {
+ if (!self::$connected && class_exists('\mysqli')) {
self::$driver = 'mysqli';
- self::$db = @new mysqli($server, $user, $pass, $db, $port);
+
+ if ($port > 0) {
+ self::$db = @new mysqli($server, $user, $pass, $db, $port);
+ } else {
+ self::$db = @new mysqli($server, $user, $pass, $db);
+ }
+
if (!mysqli_connect_errno()) {
self::$connected = true;