'Gun', 'Property' => 'Role', 'NBag' => 'Bag', 'NHero' => 'Hero', 'NPlayer' => 'Role', 'NPlayerInfo' => 'Role', 'NRank' => 'Rank', ); function getRewriteClass($oldC) { global $rewriteRule; if (isset($rewriteRule[$oldC])) { return $rewriteRule[$oldC]; } return $oldC; } try{ $c = $_REQUEST['c']; $a = $_REQUEST['a']; $c = getRewriteClass($c); $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); }