Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.0
- * @ Author : DeZender
- * @ Release on : 15.05.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class proxmox_vps_license_4690PDOWrapper
- {
- static private $pdoConnection;
- static private function getDbConnection()
- {
- if (class_exists('Illuminate\\Database\\Capsule\\Manager')) {
- return Illuminate\Database\Capsule\Manager::connection()->getPdo();
- }
- if (self::$pdoConnection === NULL) {
- self::$pdoConnection = self::setNewConnection();
- }
- return self::$pdoConnection;
- }
- static private function setNewConnection()
- {
- try {
- $includePath = ROOTDIR . DIRECTORY_SEPARATOR . 'configuration.php';
- if (file_exists($includePath)) {
- require $includePath;
- }
- else {
- throw new Exception('No configuration file found');
- }
- $connection = new PDO(sprintf('mysql:host=%s;dbname=%s;port=%s;charset=utf8', $db_host, $db_name, $db_port ? $db_port : 3360), $db_username, $db_password);
- $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- return $connection;
- }
- catch (PDOException $exc) {
- }
- }
- static public function query($query, $params = [])
- {
- $statement = self::getDbConnection()->prepare($query);
- $statement->execute($params);
- return $statement;
- }
- static public function real_escape_string($string)
- {
- return substr(self::getDbConnection()->quote($string), 1, -1);
- }
- static public function fetch_assoc($query)
- {
- return $query->fetch(PDO::FETCH_ASSOC);
- }
- static public function fetch_array($query)
- {
- return $query->fetch(PDO::FETCH_BOTH);
- }
- static public function fetch_object($query)
- {
- return $query->fetch(PDO::FETCH_OBJ);
- }
- static public function num_rows($query)
- {
- $query->fetch(PDO::FETCH_BOTH);
- return $query->rowCount();
- }
- static public function insert_id()
- {
- return self::getDbConnection()->lastInsertId();
- }
- static public function errorInfo()
- {
- $tmpErr = self::getDbConnection()->errorInfo();
- if ($tmpErr[0] && ($tmpErr[0] !== '00000')) {
- return $tmpErr;
- }
- return false;
- }
- static public function mysql_get_array($query, $params = [])
- {
- $qRes = self::query($query, $params);
- $arr = [];
- while ($row = self::fetch_assoc($qRes)) {
- $arr[] = $row;
- }
- return $arr;
- }
- static public function mysql_get_row($query, $params = [])
- {
- $qRes = self::query($query, $params);
- ......................................................................
- .....................................
- .................
Add Comment
Please, Sign In to add comment