diff --git a/test.php b/test.php deleted file mode 100644 index 3985411..0000000 --- a/test.php +++ /dev/null @@ -1,179 +0,0 @@ - ini_get('upload_max_filesize'), - 'post_max_size' => ini_get('post_max_size'), - 'max_execution_time' => ini_get('max_execution_time'), - 'memory_limit' => ini_get('memory_limit') - ]; - - foreach ($configs as $key => $value) { - echo " $key: $value\n"; - } - - // 检查必要的PHP函数 - $functions = ['exec', 'move_uploaded_file', 'json_encode', 'file_put_contents']; - $allFunctionsAvailable = true; - - foreach ($functions as $function) { - if (function_exists($function)) { - echo "✓ 函数 $function 可用\n"; - } else { - echo "✗ 函数 $function 不可用\n"; - $allFunctionsAvailable = false; - } - } - - return $allFunctionsAvailable; -} - -// 测试目录权限 -function testDirectoryPermissions() { - echo "\n=== 测试目录权限 ===\n"; - - $directories = [ - __DIR__, - __DIR__ . '/uploads/', - __DIR__ . '/css/', - __DIR__ . '/js/' - ]; - - foreach ($directories as $dir) { - if (!is_dir($dir)) { - mkdir($dir, 0777, true); - } - - if (is_writable($dir)) { - echo "✓ 目录可写: $dir\n"; - } else { - echo "✗ 目录不可写: $dir\n"; - } - } - - return true; -} - -// 测试AJAX端点 -function testAjaxEndpoints() { - echo "\n=== 测试AJAX端点 ===\n"; - - // 这里可以添加更详细的端点测试 - $endpoints = [ - 'check_git' => '检查Git状态', - 'get_files' => '获取文件列表', - 'git_operation' => 'Git操作', - 'upload' => '文件上传' - ]; - - foreach ($endpoints as $endpoint => $description) { - echo "✓ 端点 $endpoint ($description) 已定义\n"; - } - - return true; -} - -// 运行所有测试 -function runAllTests() { - echo "开始Git上传工具测试...\n"; - echo "=====================================\n"; - - $tests = [ - 'testPHPConfiguration', - 'testDirectoryPermissions', - 'testGitOperations', - 'testAjaxEndpoints', - 'testFileUpload' - ]; - - $allPassed = true; - - foreach ($tests as $test) { - try { - $result = $test(); - if (!$result) { - $allPassed = false; - } - } catch (Exception $e) { - echo "✗ 测试 $test 抛出异常: " . $e->getMessage() . "\n"; - $allPassed = false; - } - echo "\n"; - } - - echo "=====================================\n"; - if ($allPassed) { - echo "✓ 所有测试通过!工具应该可以正常工作。\n"; - } else { - echo "✗ 部分测试失败,请检查配置和权限。\n"; - } - - // 清理测试文件 - $testFiles = glob('test_upload_*.txt'); - foreach ($testFiles as $file) { - unlink($file); - } -} - -// 如果直接访问此文件,运行测试 -if (basename($_SERVER['PHP_SELF']) === basename(__FILE__)) { - runAllTests(); -} \ No newline at end of file diff --git a/test_git_add_commit.php b/test_git_add_commit.php deleted file mode 100644 index 227bc9d..0000000 --- a/test_git_add_commit.php +++ /dev/null @@ -1,44 +0,0 @@ - true, - CURLOPT_POSTFIELDS => http_build_query(['action' => 'git_operation', 'operation' => 'add']), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'] -]); -$response = curl_exec($ch); -curl_close($ch); -if ($response) { - $result = json_decode($response, true); - echo "Git添加结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n\n"; -} - -// 测试Git提交 -echo "测试Git提交操作\n"; -$ch = curl_init($apiUrl); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => http_build_query([ - 'action' => 'git_operation', - 'operation' => 'commit', - 'message' => '测试提交:修复Git仓库路径问题' - ]), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'] -]); -$response = curl_exec($ch); -curl_close($ch); -if ($response) { - $result = json_decode($response, true); - echo "Git提交结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n\n"; -} - -echo "Git操作测试完成!\n"; -?> \ No newline at end of file diff --git a/test_git_operations.php b/test_git_operations.php deleted file mode 100644 index cc8bd4f..0000000 --- a/test_git_operations.php +++ /dev/null @@ -1,57 +0,0 @@ - true, - CURLOPT_POSTFIELDS => http_build_query(['action' => 'get_files']), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'] -]); -$response = curl_exec($ch); -curl_close($ch); -if ($response) { - $result = json_decode($response, true); - echo "文件列表结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n\n"; -} - -// 测试2: 获取分支列表 -echo "测试2: 获取分支列表\n"; -$ch = curl_init($apiUrl); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => http_build_query(['action' => 'get_branches']), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'] -]); -$response = curl_exec($ch); -curl_close($ch); -if ($response) { - $result = json_decode($response, true); - echo "分支列表结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n\n"; -} - -// 测试3: Git状态 -echo "测试3: Git状态\n"; -$ch = curl_init($apiUrl); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => http_build_query(['action' => 'git_operation', 'operation' => 'status']), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'] -]); -$response = curl_exec($ch); -curl_close($ch); -if ($response) { - $result = json_decode($response, true); - echo "Git状态结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n\n"; -} - -echo "测试完成!\n"; -?> \ No newline at end of file diff --git a/test_upload.php b/test_upload.php deleted file mode 100644 index 4176f98..0000000 --- a/test_upload.php +++ /dev/null @@ -1,37 +0,0 @@ - $uploadUrl, - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => [ - 'action' => 'upload', - 'files' => new CURLFile('test_upload.txt') - ], - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - 'Content-Type: multipart/form-data' - ] -]); - -echo "正在测试文件上传功能...\n"; -$response = curl_exec($ch); -curl_close($ch); - -if ($response) { - $result = json_decode($response, true); - echo "上传结果:\n"; - echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); -} else { - echo "上传失败:无法连接到服务器\n"; -} - -// 清理测试文件 -@unlink('test_upload.txt'); -?> \ No newline at end of file diff --git a/test_upload.txt b/test_upload.txt deleted file mode 100644 index 170be37..0000000 --- a/test_upload.txt +++ /dev/null @@ -1,3 +0,0 @@ -这是测试文件内容 -用于验证Git上传功能 -时间:2025-11-15 11:17:28 \ No newline at end of file diff --git a/v1.0.2.gxw b/v1.0.2.gxw new file mode 100644 index 0000000..f06d68c Binary files /dev/null and b/v1.0.2.gxw differ diff --git a/v1.0.3修改OKNG灯可废弃此版本.gxw b/v1.0.3修改OKNG灯可废弃此版本.gxw new file mode 100644 index 0000000..eda621e Binary files /dev/null and b/v1.0.3修改OKNG灯可废弃此版本.gxw differ diff --git a/测试文件夹/子文件夹/子文件.txt b/测试文件夹/子文件夹/子文件.txt new file mode 100644 index 0000000..4031d14 --- /dev/null +++ b/测试文件夹/子文件夹/子文件.txt @@ -0,0 +1 @@ +这是子文件夹中的文件 \ No newline at end of file diff --git a/测试文件夹/测试文件1.txt b/测试文件夹/测试文件1.txt new file mode 100644 index 0000000..f073bc7 --- /dev/null +++ b/测试文件夹/测试文件1.txt @@ -0,0 +1 @@ +这是一个测试文件1 \ No newline at end of file diff --git a/测试项目/css/style.css b/测试项目/css/style.css new file mode 100644 index 0000000..b216440 --- /dev/null +++ b/测试项目/css/style.css @@ -0,0 +1 @@ +模拟文件内容: 测试项目/css/style.css \ No newline at end of file diff --git a/测试项目/images/logo.png b/测试项目/images/logo.png new file mode 100644 index 0000000..85fa7d0 --- /dev/null +++ b/测试项目/images/logo.png @@ -0,0 +1 @@ +模拟文件内容: 测试项目/images/logo.png \ No newline at end of file diff --git a/测试项目/index.html b/测试项目/index.html new file mode 100644 index 0000000..0630287 --- /dev/null +++ b/测试项目/index.html @@ -0,0 +1 @@ +模拟文件内容: 测试项目/index.html \ No newline at end of file diff --git a/测试项目/js/main.js b/测试项目/js/main.js new file mode 100644 index 0000000..ae9cc9a --- /dev/null +++ b/测试项目/js/main.js @@ -0,0 +1 @@ +模拟文件内容: 测试项目/js/main.js \ No newline at end of file