Advertisement
Guest User

Untitled

a guest
Nov 6th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
  6. *
  7. * @ Version : 1.1.6.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.06.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class vB_Database {
  15. 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' );
  16. public $registry = null;
  17. public $fetchtypes = array( 'DBARRAY_NUM' => MYSQL_NUM, 'DBARRAY_ASSOC' => MYSQL_ASSOC, 'DBARRAY_BOTH' => MYSQL_BOTH );
  18. public $appname = 'vBulletin';
  19. public $appshortname = 'vBulletin';
  20. public $database = null;
  21. public $connection_master = null;
  22. public $connection_slave = null;
  23. public $connection_recent = null;
  24. public $multiserver = false;
  25. public $shutdownqueries = array( );
  26. public $sql = '';
  27. public $reporterror = true;
  28. public $error = '';
  29. public $errno = '';
  30. public $maxpacket = 0;
  31. public $locked = false;
  32. public $querycount = 0;
  33.  
  34. public function vB_Database($registry) {
  35. if (is_object( $registry )) {
  36. $this->registry = &$registry;
  37.  
  38. return null;
  39. }
  40.  
  41. trigger_error( 'vB_Database::Registry object is not an object', E_USER_ERROR );
  42. }
  43.  
  44. 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 = '') {
  45. $this->database = $database;
  46. $w_port = ($w_port ? $w_port : 3306);
  47. $r_port = ($r_port ? $r_port : 3306);
  48. $this->connection_master = $this->db_connect( $w_servername, $w_port, $w_username, $w_password, $w_usepconnect, $configfile, $charset );
  49. $this->multiserver = false;
  50. $this->connection_slave = &$this->connection_master;
  51.  
  52. if ($this->connection_master) {
  53. $this->select_db( $this->database );
  54. }
  55.  
  56. }
  57.  
  58. public function db_connect($servername, $port, $username, $password, $usepconnect, $configfile = '', $charset = '') {
  59. if (function_exists( 'catch_db_error' )) {
  60. set_error_handler( 'catch_db_error' );
  61. }
  62.  
  63. $link = $this->functions[($usepconnect ? 'pconnect' : 'connect')]( '' . $servername . ':' . $port, $username, $password );
  64.  
  65. if (!( ( !$link && $this->reporterror ))) {
  66. restore_error_handler( );
  67.  
  68. if (!( empty( $charset ))) {
  69. if (function_exists( 'mysql_set_charset' )) {
  70. mysql_set_charset( $charset );
  71. return $link;
  72. }
  73.  
  74. $this->sql = 'SET NAMES ' . $charset;
  75. $this->execute_query( true, $link );
  76. }
  77. ...............................................................
  78. ......................................
  79. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement