game2001api/webapp/index.php
aozhiwei c71fa3b9bc 1
2019-07-23 11:17:27 +08:00

33 lines
661 B
PHP

<?php
require 'bootstrap/init.php';
if (empty($_REQUEST['c']) || empty($_REQUEST['a'])) {
die();
return;
}
function autoload_controller__($classname)
{
require_once "controller/$classname.class.php";
spl_autoload_unregister('autoload_controller__');
}
spl_autoload_register('autoload_controller__');
function loginVerify($accountid, $sessionid)
{
if (!phpcommon\isValidSessionId($accountid, $sessionid)) {
return false;
}
return true;
}
try{
$c = $_REQUEST['c'];
$a = $_REQUEST['a'];
$classname = $c .'Controller';
$obj = eval('return (new $classname())->$a();');
} catch (Exception $e){
echo($e);
}