Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 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. class InstallService {
  15.  
  16.  
  17. public static $permission_err = "";
  18. public function checkIsScriptInstalled() {
  19.  
  20. $dbconfigured = $this->checkIsDBConfigured();
  21. if ($dbconfigured && Config::get("license/credentials.key") != "" || file_exists(app_path() . "/lib/modules.php"))
  22. {
  23. return true;
  24. }
  25. return false;
  26. }
  27.  
  28. public function checkIsDBConfigured() {
  29.  
  30. try
  31. {
  32. $dbdefault = Config::get("database.default");
  33. $databaseconfig = Config::get("database.connections");
  34. $selected_db = $databaseconfig[$dbdefault];
  35. if ($selected_db != "")
  36. {
  37. return true;
  38. }
  39. return false;
  40. }
  41. catch (PDOException $e)
  42. {
  43. return false;
  44. }
  45. return;
  46. }
  47.  
  48. public function checkIsLicenseKeyValid() {
  49.  
  50. return true;
  51. }
  52.  
  53. public function ConnectDB($input_arr) {
  54.  
  55. if ($rs = @mysql_connect($input_arr["dbhost"], $input_arr["dbuser"], $input_arr["dbpass"]))
  56. {
  57. return $rs;
  58. }
  59. $err_msg = "<li>Could not connect</li>";
  60. return false;
  61. }
  62.  
  63. public function isDBExist($input_arr) {
  64.  
  65. if (!mysql_select_db($input_arr["dbname"]))
  66. {
  67. $err_msg = "<li>Database not created, please create the database and press \"Next\"...</li>";
  68. return false;
  69. }
  70. return true;
  71. }
  72.  
  73. public function parse_mysql_dump($db_det = array(), $paths = "", $ignoreerrors = false) {
  74.  
  75. if (empty($db_det))
  76. {
  77. return false;
  78. }
  79. if (!mysql_select_db($db_det["dbname"]))
  80. {
  81. $err_msg .= "<li>Database not created, please create the database and press \"Next\"...</li>";
  82. return false;
  83. }
  84. if ($paths == "")
  85. {
  86. $paths = array(app_path() . "/database/config_data.sql", app_path() . "/database/update.sql", app_path() . "/database/data.sql", app_path() . "/database/api_server_details.sql");
  87. }
  88. if (is_string($paths) && $paths != "")
  89. {
  90. $paths = array($paths);
  91. }
  92. if (empty($paths))
  93. {
  94. $err_msg .= "<li>No dump file available to run...</li>";
  95. return false;
  96. }
  97. foreach ($paths as $path)
  98. {
  99. $file_content = file($path);
  100. $query = "";
  101. foreach ($file_content as $sql_line)
  102. {
  103. $tsl = trim($sql_line);
  104. if (!($sql_line != "" && substr($tsl, 0, 2) != "--" && substr($tsl, 0, 1) != "#"))
  105. {
  106. continue;
  107. }
  108. $query .= $sql_line;
  109. if (!preg_match("/;\\s*\$/", $sql_line))
  110. {
  111. continue;
  112. }
  113. $result = mysql_query($query);
  114. if (!$result && !$ignoreerrors)
  115. {
  116. die(mysql_error());
  117. }
  118. $query = "";
  119. continue;
  120. }
  121. continue;
  122. }
  123. return;
  124. }
  125.  
  126. public static function chkIsWritableAll($folder_name = "", $all = false, $all_display = false) {
  127.  
  128. $val = 0;
  129. $disp_folder_name = $folder_name;
  130. $folder_name = base_path() . $folder_name;
  131. if ($all || is_dir($folder_name))
  132. {
  133. if ($handle = opendir($folder_name))
  134. {
  135. if ($all_display)
  136. {
  137. ....................................................................
  138. ...............................
  139. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement