TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
332 B
17 lines
332 B
<?php
|
|
if (empty($_POST['code'])) {
|
|
die('require code');
|
|
}
|
|
|
|
$file = tempnam('/tmp', 'py2php');
|
|
file_put_contents($file, $_POST['code']);
|
|
$conv = dirname(__DIR__, 2) . '/conv.php';
|
|
|
|
$cmd = 'php ' . $conv . ' ' . $file;
|
|
$out = shell_exec($cmd);
|
|
|
|
echo json_encode([
|
|
'data' => ['code' => $out, 'cmd' => $cmd]
|
|
]);
|
|
|
|
unlink($file);
|
|
|