Advertisement
Guest User

Untitled

a guest
Mar 10th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. $dbconf = array("hostname" => $conf["db_hostname"], "username" => $conf["db_username"], "password" => $conf["db_password"], "database" => $conf["db_name"], "prefix" => $conf["db_prefix"], "version" => isset($conf["db_version"]) ? ($conf["db_version"]) : "", "debug" => $conf["debug"]);
  15. $DB = new DB($dbconf);
  16. $DB->connect_db();
  17. if ("4.1" <= $DB->version)
  18. {
  19. $DB->query("SET NAMES utf8");
  20. }
  21. $DB->query("SET @@session.sql_mode= ''");
  22. if (!(!(!(defined("VIR_PATH") == false) && defined("VIR_CP_PATH") == false) && defined("SYS_PATH") == false) && defined("SYS_LICENSE") == false)
  23. {
  24. exit("The system does not appear to be properly installed (1).");
  25. }
  26. if (isset($DB) == false)
  27. {
  28. exit("The system does not appear to be installed properly (2).");
  29. }
  30.  
  31.  
  32. class DB {
  33.  
  34.  
  35. public $conn_id = "";
  36. public $hostname = "";
  37. public $username = "";
  38. public $password = "";
  39. public $database = "";
  40. public $version = "";
  41. public $debug = 0;
  42. public $markers = array();
  43. public $totalqueries = 0;
  44. public $mysqli = false;
  45. public function DB($conf) {
  46.  
  47. if ($conf["hostname"] != "")
  48. {
  49. $this->hostname = $conf["hostname"];
  50. }
  51. if ($conf["username"] != "")
  52. {
  53. $this->username = $conf["username"];
  54. }
  55. if ($conf["password"] != "")
  56. {
  57. $this->password = $conf["password"];
  58. }
  59. if ($conf["database"] != "")
  60. {
  61. $this->database = $conf["database"];
  62. }
  63. if ($conf["prefix"] != "")
  64. {
  65. $this->prefix = $conf["prefix"];
  66. }
  67. if ($conf["version"] != "")
  68. {
  69. $this->version = $conf["version"];
  70. }
  71. if ($conf["debug"] != "")
  72. {
  73. $this->debug = $conf["debug"];
  74. }
  75. if (function_exists("mysqli_connect"))
  76. {
  77. $this->mysqli = true;
  78. }
  79. return;
  80. }
  81.  
  82. public function connect_db($select_db = true) {
  83.  
  84. if (!$this->hostname)
  85. {
  86. return false;
  87. }
  88. $this->conn_id = $this->mysqli ? (@mysqli_connect($this->hostname, $this->username, $this->password)) : (@mysql_connect($this->hostname, $this->username, $this->password));
  89. if (!$this->conn_id || $this->debug)
  90. {
  91. return $this->error_db("Unable to connect to the database.");
  92. }
  93. if ($select_db == true)
  94. {
  95. ........................................................................
  96. ...................................
  97. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement