/** * Returns a string representing the version of the MySQL server that the MySQLi extension is connected to. * * @param DB $db * * @return string */ public static function get_mysql_server_version(DB $db) { static $_mysqli_server_version = null; if ($_mysqli_server_version === null) { $_mysqli_server_version = \mysqli_get_server_version($db->getLink()); } return $_mysqli_server_version; }
protected function getLink() { if (!$this->db) { throw new WrongStateException('Expected setted db'); } if (!$this->db->isConnected()) { $this->db->connect(); } return $this->db->getLink(); }
public function __construct($db_name, $address_id = "") { $this->db = $db_name; $this->dbc = DB::getLink(); if (!empty($address_id)) { $this->id = $address_id; $this->initObject(); $this->Read(); } else { $this->initObject(); } }
public function __construct($shipment_id = "", $db_name) { $this->user = $db_name; $this->db = $db_name['database']; $this->dbc = DB::getLink(); if (!empty($shipment_id)) { $this->id = $shipment_id; $this->initObject(); $this->Read(); } else { $this->initObject(); } }
function __construct() { $this->initLang(); $this->dbc = DB::getLink(); $this->settings = Settings::get($this->user['database']); $this->session = new Session($this->user); $this->session->initByID($_REQUEST['sid']); $this->smarty = new SmartyTpl($this->user['folder']); $this->smarty->error_reporting = E_ALL & ~E_NOTICE; $this->smarty->assign('lang', $this->lang); $this->smarty->assign('user', $this->user); $this->smarty->assign('session', $this->session); $this->smarty->assign('settings', $this->settings->toArray()); $this->smarty->muteExpectedErrors(); }
function __construct($user) { if (!$user) { return false; } $this->id = $_REQUEST['sid']; $this->dbc = DB::getLink(); $this->dbn = $user['database']; $this->uid = $user['uid']; $this->data['name'] = $user['name']; $this->data['username'] = $user['username']; $this->data['email'] = $user['email']; $this->data['phone'] = $user['phone']; $this->data['ext'] = $user['ext']; }
function redirect($code) { $err = '/../404.php'; if (!checkCode($code)) { header("Location: {$err}"); exit; } $link = DB::getLink($code); if ($link == false) { header("Location: {$err}"); exit; } if (!DB::increase($code)) { header("Location: {$err}"); exit; } header("Location: {$link}"); exit; }
public function __construct($tenant) { $this->dbn = $tenant; $this->dbc = DB::getLink(); $this->initObject(); }
public function __construct($db_name) { $this->db = $db_name; $this->dbc = DB::getLink(); }