rename NGun->Gun

This commit is contained in:
aozhiwei 2021-11-17 17:21:04 +08:00
parent a40eac745b
commit 23197efdd2
2 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,8 @@
<?php
require_once('mt/NewShop.php');
class NGunController extends BaseAuthedController {
class GunController extends BaseAuthedController {
public function getGunInfo()
{

View File

@ -23,9 +23,23 @@ function loginVerify($accountid, $sessionid)
return true;
}
$rewriteRule = array(
'NGun' => 'Gun'
);
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();');