game2006api/webapp/index.php
aozhiwei 0512935c70 1
2021-01-04 13:40:33 +08:00

34 lines
736 B
PHP

<?php
require '../config/config.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('$obj = new $classname(); $obj->handlePre(); $obj->$a(); $obj->handlePost();');
} catch (Exception $e){
echo($e);
}