Advertisement
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 : 5.0.1.0
- * @ Author : DeZender
- * @ Release on : 22.04.2022
- * @ Official site : http://DeZender.Net
- *
- */
- class expense_tracker_license_3868PDOWrapper
- {
- static private $pdoConnection = null;
- 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);
- ..............................................................
- ......................................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement