diff --git a/config.php b/.data/config.php similarity index 100% rename from config.php rename to .data/config.php diff --git a/glitch.json b/glitch.json new file mode 100644 index 0000000..618456b --- /dev/null +++ b/glitch.json @@ -0,0 +1,3 @@ +{ + "start": "php -S 0.0.0.0:8080 index.php" +} diff --git a/platform/Normal.php b/platform/Normal.php index a261705..347fed7 100644 --- a/platform/Normal.php +++ b/platform/Normal.php @@ -46,7 +46,7 @@ function getConfig($str, $disktag = '') global $InnerEnv; global $Base64Env; //include 'config.php'; - $s = file_get_contents('config.php'); + $s = file_get_contents('.data/config.php'); //$configs = substr($s, 18, -2); $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}'; if ($configs!='') { @@ -73,7 +73,7 @@ function setConfig($arr, $disktag = '') global $Base64Env; if ($disktag=='') $disktag = $_SERVER['disktag']; //include 'config.php'; - $s = file_get_contents('config.php'); + $s = file_get_contents('.data/config.php'); //$configs = substr($s, 18, -2); $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}'; if ($configs!='') $envs = json_decode($configs, true); @@ -114,7 +114,7 @@ function setConfig($arr, $disktag = '') //echo '
'. json_encode($envs, JSON_PRETTY_PRINT).'
'; $prestr = '0) return json_encode( [ 'response' => 'success' ] ); return json_encode( [ 'message' => 'Failed to write config.', 'code' => 'failed' ] ); } @@ -183,7 +183,7 @@ function install() //if (location.port!="") url += ":" + location.port; url += location.pathname; if (url.substr(-1)!="/") url += "/"; - url += "config.php"; + url += ".data/config.php"; //alert(url); var xhr4 = new XMLHttpRequest(); xhr4.open("GET", url); @@ -248,7 +248,7 @@ function RewriteEngineOn() { $http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://'; $tmpurl = $http_type . $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; - $tmpurl .= path_format($_SERVER['base_path'] . '/config.php'); + $tmpurl .= path_format($_SERVER['base_path'] . '/.data/config.php'); $tmp = curl_request($tmpurl); if ($tmp['stat']==200) return false; if ($tmp['stat']==201) return true; //when install return 201, after installed return 404 or 200; @@ -308,10 +308,10 @@ function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = if ($outPath=='') return 0; //unlink($outPath.'/config.php'); - $response = rename($projectPath . $slash . 'config.php', $outPath . $slash . 'config.php'); + $response = rename($projectPath . $slash . '.data' . $slash . 'config.php', $outPath . $slash . '.data' . $slash . 'config.php'); if (!$response) { $tmp1['code'] = "Move Failed"; - $tmp1['message'] = "Can not move " . $projectPath . $slash . 'config.php' . " to " . $outPath . $slash . 'config.php'; + $tmp1['message'] = "Can not move " . $projectPath . $slash . '.data' . $slash . 'config.php' . " to " . $outPath . $slash . '.data' . $slash . 'config.php'; return json_encode($tmp1); } return moveFolder($outPath, $projectPath, $slash); diff --git a/writeable.sh b/writeable.sh index 8d3b5dc..44da92b 100644 --- a/writeable.sh +++ b/writeable.sh @@ -1,3 +1,3 @@ OneManagerPath=`cd $(dirname $0);pwd -P` cd ${OneManagerPath} -chmod 666 config.php +chmod 666 .data/config.php