game2005api/webapp/index.php
aozhiwei b952f49092 1
2021-01-15 20:05:06 +08:00

36 lines
901 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';
$beginTick = phpcommon\getTickCount();
$obj = eval('$obj = new $classname(); $obj->handlePre(); $obj->$a(); $obj->handlePost();');
//error_log('c=' . $_REQUEST['c'] . ' a=' . $_REQUEST['a'] . ' costtime:' . (phpcommon\getTickCount() - $beginTick));
} catch (Exception $e){
echo($e);
}