Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
- *
- * @ Version : 1.1.6.0
- * @ Author : DeZender
- * @ Release on : 02.06.2013
- * @ Official site : http://DeZender.Net
- *
- */
- class vB_Database {
- public $functions = array( 'connect' => 'mysql_connect', 'pconnect' => 'mysql_pconnect', 'select_db' => 'mysql_select_db', 'query' => 'mysql_query', 'query_unbuffered' => 'mysql_unbuffered_query', 'fetch_row' => 'mysql_fetch_row', 'fetch_array' => 'mysql_fetch_array', 'fetch_field' => 'mysql_fetch_field', 'free_result' => 'mysql_free_result', 'data_seek' => 'mysql_data_seek', 'error' => 'mysql_error', 'errno' => 'mysql_errno', 'affected_rows' => 'mysql_affected_rows', 'num_rows' => 'mysql_num_rows', 'num_fields' => 'mysql_num_fields', 'field_name' => 'mysql_field_name', 'insert_id' => 'mysql_insert_id', 'escape_string' => 'mysql_escape_string', 'real_escape_string' => 'mysql_real_escape_string', 'close' => 'mysql_close', 'client_encoding' => 'mysql_client_encoding' );
- public $registry = null;
- public $fetchtypes = array( 'DBARRAY_NUM' => MYSQL_NUM, 'DBARRAY_ASSOC' => MYSQL_ASSOC, 'DBARRAY_BOTH' => MYSQL_BOTH );
- public $appname = 'vBulletin';
- public $appshortname = 'vBulletin';
- public $database = null;
- public $connection_master = null;
- public $connection_slave = null;
- public $connection_recent = null;
- public $multiserver = false;
- public $shutdownqueries = array( );
- public $sql = '';
- public $reporterror = true;
- public $error = '';
- public $errno = '';
- public $maxpacket = 0;
- public $locked = false;
- public $querycount = 0;
- public function vB_Database($registry) {
- if (is_object( $registry )) {
- $this->registry = &$registry;
- return null;
- }
- trigger_error( 'vB_Database::Registry object is not an object', E_USER_ERROR );
- }
- public function connect($database, $w_servername, $w_port, $w_username, $w_password, $w_usepconnect = false, $r_servername = '', $r_port = 3306, $r_username = '', $r_password = '', $r_usepconnect = false, $configfile = '', $charset = '') {
- $this->database = $database;
- $w_port = ($w_port ? $w_port : 3306);
- $r_port = ($r_port ? $r_port : 3306);
- $this->connection_master = $this->db_connect( $w_servername, $w_port, $w_username, $w_password, $w_usepconnect, $configfile, $charset );
- $this->multiserver = false;
- $this->connection_slave = &$this->connection_master;
- if ($this->connection_master) {
- $this->select_db( $this->database );
- }
- }
- public function db_connect($servername, $port, $username, $password, $usepconnect, $configfile = '', $charset = '') {
- if (function_exists( 'catch_db_error' )) {
- set_error_handler( 'catch_db_error' );
- }
- $link = $this->functions[($usepconnect ? 'pconnect' : 'connect')]( '' . $servername . ':' . $port, $username, $password );
- if (!( ( !$link && $this->reporterror ))) {
- restore_error_handler( );
- if (!( empty( $charset ))) {
- if (function_exists( 'mysql_set_charset' )) {
- mysql_set_charset( $charset );
- return $link;
- }
- $this->sql = 'SET NAMES ' . $charset;
- $this->execute_query( true, $link );
- }
- ...............................................................
- ......................................
- ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement