25 lines
525 B
PHP
25 lines
525 B
PHP
<?php
|
|
$_POST['code'] = 'print("Hello from test")';
|
|
// Mock db()
|
|
function db() {
|
|
return new class {
|
|
function prepare($sql) {
|
|
return new class {
|
|
function execute($args) {}
|
|
};
|
|
}
|
|
};
|
|
}
|
|
// Capture output
|
|
ob_start();
|
|
require 'process.php';
|
|
$output = ob_get_clean();
|
|
$data = json_decode($output, true);
|
|
if ($data && $data['success']) {
|
|
echo "Generated Lua:\n";
|
|
echo $data['protected_code'];
|
|
} else {
|
|
echo "Error: " . ($data['error'] ?? 'Unknown error');
|
|
}
|
|
|