This commit is contained in:
2026-01-13 12:36:57 +03:00
commit ebe1f5bd00
29 changed files with 2295 additions and 0 deletions

44
core.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
namespace API;
foreach (glob("modules/$project_name/*.php") as $filename) { include_once $filename;
}
$traits_array_= array();
$traits_array = get_declared_traits();
foreach ($traits_array as $key) {
array_push($traits_array_, substr($key, 4));
}
$traits_name=implode(",", $traits_array_);
eval("
namespace API;
final class API
{
use $traits_name;
private static \$instance;
public static function getInstance(): self
{
if (null === static::\$instance) {
static::\$instance = new static();
}
return static::\$instance;
}
}
");
$api = API::getInstance();
$_POST = json_decode(file_get_contents('php://input'), true);
if (isset($_POST)) {
$params=$_POST['params'];
$flag=$params['flag'];
if (method_exists($api, $flag)) {
call_user_func(array($api, $flag), $params);
} else {
header('Content-Type:text/html; charset=UTF-8', true, 301);
exit;
}
}