Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP8 Decoder for ionCube Encoder)
- *
- * @ Version : 8.1.0.9
- * @ Author : DeZender
- * @ Release on : 27.10.2023
- * @ Official site : http://DeZender.Net
- *
- */
- class ip_manager_license_1163PDOWrapper
- {
- private static $pdoConnection = null;
- private static function getDbConnection()
- {
- if (class_exists('Illuminate\\Database\\Capsule\\Manager')) {
- return Illuminate\Database\Capsule\Manager::connection()->getPdo();
- }
- if (is_null(self::$pdoConnection)) {
- self::$pdoConnection = self::setNewConnection();
- }
- return self::$pdoConnection;
- }
- private static 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) {
- }
- }
- public static function query($query, $params = [])
- {
- $statement = self::getDbConnection()->prepare($query);
- $statement->execute($params);
- return $statement;
- }
- public static function real_escape_string($string)
- {
- return substr(self::getDbConnection()->quote($string), 1, -1);
- }
- public static function fetch_assoc($query)
- {
- return $query->fetch(PDO::FETCH_ASSOC);
- }
- public static function fetch_array($query)
- {
- return $query->fetch(PDO::FETCH_BOTH);
- }
- public static function fetch_object($query)
- {
- return $query->fetch(PDO::FETCH_OBJ);
- ...................................................................
- ......................................
- ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement