Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- class directadmin_extended_license_1721PDOWrapper
- {
- private static $pdoConnection = null;
- private static 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;
- }
- 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 = array( ))
- {
- $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 );
- .....................................................................
- .............................................
- ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement