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 ionCube Loader)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- class InstallService {
- public static $permission_err = "";
- public function checkIsScriptInstalled() {
- $dbconfigured = $this->checkIsDBConfigured();
- if ($dbconfigured && Config::get("license/credentials.key") != "" || file_exists(app_path() . "/lib/modules.php"))
- {
- return true;
- }
- return false;
- }
- public function checkIsDBConfigured() {
- try
- {
- $dbdefault = Config::get("database.default");
- $databaseconfig = Config::get("database.connections");
- $selected_db = $databaseconfig[$dbdefault];
- if ($selected_db != "")
- {
- return true;
- }
- return false;
- }
- catch (PDOException $e)
- {
- return false;
- }
- return;
- }
- public function checkIsLicenseKeyValid() {
- return true;
- }
- public function ConnectDB($input_arr) {
- if ($rs = @mysql_connect($input_arr["dbhost"], $input_arr["dbuser"], $input_arr["dbpass"]))
- {
- return $rs;
- }
- $err_msg = "<li>Could not connect</li>";
- return false;
- }
- public function isDBExist($input_arr) {
- if (!mysql_select_db($input_arr["dbname"]))
- {
- $err_msg = "<li>Database not created, please create the database and press \"Next\"...</li>";
- return false;
- }
- return true;
- }
- public function parse_mysql_dump($db_det = array(), $paths = "", $ignoreerrors = false) {
- if (empty($db_det))
- {
- return false;
- }
- if (!mysql_select_db($db_det["dbname"]))
- {
- $err_msg .= "<li>Database not created, please create the database and press \"Next\"...</li>";
- return false;
- }
- if ($paths == "")
- {
- $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");
- }
- if (is_string($paths) && $paths != "")
- {
- $paths = array($paths);
- }
- if (empty($paths))
- {
- $err_msg .= "<li>No dump file available to run...</li>";
- return false;
- }
- foreach ($paths as $path)
- {
- $file_content = file($path);
- $query = "";
- foreach ($file_content as $sql_line)
- {
- $tsl = trim($sql_line);
- if (!($sql_line != "" && substr($tsl, 0, 2) != "--" && substr($tsl, 0, 1) != "#"))
- {
- continue;
- }
- $query .= $sql_line;
- if (!preg_match("/;\\s*\$/", $sql_line))
- {
- continue;
- }
- $result = mysql_query($query);
- if (!$result && !$ignoreerrors)
- {
- die(mysql_error());
- }
- $query = "";
- continue;
- }
- continue;
- }
- return;
- }
- public static function chkIsWritableAll($folder_name = "", $all = false, $all_display = false) {
- $val = 0;
- $disp_folder_name = $folder_name;
- $folder_name = base_path() . $folder_name;
- if ($all || is_dir($folder_name))
- {
- if ($handle = opendir($folder_name))
- {
- if ($all_display)
- {
- ....................................................................
- ...............................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement