From 23197efdd21aaee08142f92aa8012f7770965d4b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 17 Nov 2021 17:21:04 +0800 Subject: [PATCH] rename NGun->Gun --- ...ontroller.class.php => GunController.class.php} | 4 +++- webapp/index.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) rename webapp/controller/{NGunController.class.php => GunController.class.php} (96%) diff --git a/webapp/controller/NGunController.class.php b/webapp/controller/GunController.class.php similarity index 96% rename from webapp/controller/NGunController.class.php rename to webapp/controller/GunController.class.php index 0c41dc6..2262f09 100644 --- a/webapp/controller/NGunController.class.php +++ b/webapp/controller/GunController.class.php @@ -1,6 +1,8 @@ '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();');