private static function parseurl() { if (isset($_REQUEST['act']) && !empty($_REQUEST['act'])) { $act = ucfirst(trim($_REQUEST['act']) . 'Action'); } else { $act = 'IndexAction'; } if (isset($_REQUEST['mod']) && !empty($_REQUEST['mod'])) { $method = trim($_REQUEST['mod']); } else { $method = 'Index'; } if (CREATE_DEMO) { //if need create demo $demo = new Demo(); $demo->run(); } if (!class_exists($act)) { if (APP_DEBUG) { die('controller class: ' . $act . ' not find. '); } else { //record log SL('controller not find', '访问的controller: ' . $act . ' class not find', '访问日志', 1); location(); } } self::$controller_obj =& $controller; self::$act = str_ireplace('Action', '', $act); self::$mod = $method; $controller = new $act(); if (!method_exists($controller, $method)) { if (APP_DEBUG) { die('controller class: ' . $act . ', method: ' . $method . ' not find. '); } else { //record log SL('method not find', '访问的controller: ' . $act . ' class method: ' . $method . ' not find', '访问日志', 1); location(); } } $controller->method = $method; $controller->open_token = OPEN_TOKEN; $controller->act = self::$act; $controller->{$method}(); }
private static function parseurl() { if (isset($_REQUEST['act']) && isset($_REQUEST['mod'])) { $act = ucfirst(trim($_REQUEST['act']) . 'Action'); $method = trim($_REQUEST['mod']); } else { $act = 'IndexAction'; $method = 'index'; } if (isset($_REQUEST['app']) && !defined('APP_NAME')) { define('APP_NAME', trim($_REQUEST['app'])); } if (CREATE_DEMO) { //if need create demo $demo = new Demo(); $demo->run(); } if (!class_exists($act)) { if (APP_DEBUG) { die('controller class: ' . $act . ' not find. '); } else { location(); } } $controller = new $act(); if (!method_exists($controller, $method)) { if (APP_DEBUG) { die('controller class: ' . $act . ', method: ' . $method . ' not find. '); } else { location(); } } self::$controller_obj = $controller; $controller->method = $method; $controller->open_token = OPEN_TOKEN; $controller->act = str_ireplace('Action', '', $act); self::$act = $controller->act; self::$mod = $method; $controller->{$method}(); }
<?php class Demo extends PerformanceTest { protected function testOne() { $time = 0.5; $this->enterResult($time); } protected function testTwo() { $time = 1.5; $this->enterResult($time); } public function run() { $this->name = "demo"; $this->testOne(); $this->testTwo(); } } $test = new Demo($suite); $test->run(); echo $test->getResult(); echo $test->getName();
* 扫描带参数二维码 用户未关注时,进行关注后的事件推送 */ public function event_qrcode_unsubscribe(Event $event) { var_dump($event->getOptions()); } /** * 上报地理位置事件 */ public function event_location(Event $event) { var_dump($event->getOptions()); } /** * 自定义菜单事件 */ public function event_click(Event $event) { var_dump($event->getOptions()); } /** * 点击菜单跳转链接时的事件推送 */ public function event_view(Event $event) { var_dump($event->getOptions()); } } $demo = new Demo(); $demo->run();