31 lines
745 B
PHP
31 lines
745 B
PHP
<?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');
|
|
?>
|