目录结构调整
This commit is contained in:
31
codes/games/server/debug.php
Normal file
31
codes/games/server/debug.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE");
|
||||
header("Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With");
|
||||
header("Access-Control-Allow-Credentials: true");
|
||||
header("Content-Type: textml; charset=utf-8");
|
||||
|
||||
$path = @$_REQUEST['dir'];
|
||||
$file = @$_REQUEST['file'];
|
||||
$data = @$_REQUEST['data'];
|
||||
|
||||
if (empty($path)){
|
||||
die('para error: dir');
|
||||
}
|
||||
if (empty($file)){
|
||||
die('para error: file');
|
||||
}
|
||||
if (empty($data)){
|
||||
die('para error: data');
|
||||
}
|
||||
|
||||
|
||||
$path = dirname($_SERVER['SCRIPT_FILENAME']) . '/debug/' . $path;
|
||||
if (!is_dir($path)){
|
||||
mkdir($path, 0777);
|
||||
}
|
||||
|
||||
file_put_contents($path . '/' . $file, $data);
|
||||
|
||||
die('debug save success');
|
||||
?>
|
||||
Reference in New Issue
Block a user