Use singleton instance directly
This commit is contained in:
parent
69cf9ade47
commit
3966c697b7
@ -26,7 +26,7 @@
|
||||
/**
|
||||
* Singleton instance
|
||||
*
|
||||
* @var mysqli Object instance
|
||||
* @var uDb Object instance
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
/**
|
||||
* Database driver name
|
||||
*
|
||||
* @var String Driver
|
||||
* @var string Driver
|
||||
*/
|
||||
protected static $driver;
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
/**
|
||||
* Returns singleton instance
|
||||
*
|
||||
* @return object Singleton instance
|
||||
* @return uDb Singleton instance
|
||||
*/
|
||||
public static function getInstance() {
|
||||
if (!self::$instance) {
|
||||
|
@ -89,10 +89,7 @@
|
||||
* @return uDb instance
|
||||
*/
|
||||
private static function db() {
|
||||
if (is_null(self::$db)) {
|
||||
self::$db = uDb::getInstance();
|
||||
}
|
||||
return self::$db;
|
||||
return uDb::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,6 +31,9 @@
|
||||
|
||||
public $isValid = false;
|
||||
|
||||
/**
|
||||
* @var uDb $db
|
||||
*/
|
||||
private static $db = null;
|
||||
|
||||
/**
|
||||
@ -66,10 +69,7 @@
|
||||
* @return uDb instance
|
||||
*/
|
||||
private static function db() {
|
||||
if (is_null(self::$db)) {
|
||||
self::$db = uDb::getInstance();
|
||||
}
|
||||
return self::$db;
|
||||
return uDb::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +102,7 @@
|
||||
* Add new position to track
|
||||
*
|
||||
* @param int $userId
|
||||
* @param int $time Unix time stamp
|
||||
* @param int $timestamp Unix time stamp
|
||||
* @param double $lat
|
||||
* @param double $lon
|
||||
* @param double $altitude Optional
|
||||
|
@ -67,10 +67,7 @@
|
||||
* @return uDb instance
|
||||
*/
|
||||
private static function db() {
|
||||
if (is_null(self::$db)) {
|
||||
self::$db = uDb::getInstance();
|
||||
}
|
||||
return self::$db;
|
||||
return uDb::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user