PHP Reflection Test: Extract the Controller's action method
$V) {//1. Remove the datum path $v = Str_replace ($basepath, ", $v);//2. Remove the suffix $v = preg_replace ('/\.php$/i ', ' ', $v);//3. Split Filter $v = Core_app Utils::normalize ($v, Directory_separator), if (Empty ($v)) continue, $paths [$k] = Implode (' _ ', $v);} $d = Array (), foreach ($paths as $controller) {$d [$controller] = Self::getactionlistfromcontrollerclass ($controller);} return $d;} static function Getactionlistfromcontrollerclass ($controller _name) {Static $controllerClassPrefix = Null;if (!$ Controllerclassprefix) {$controllerClassPrefix = Core_app::ini (' Mvc/web/dispatcher/controllerclassprefix ', ' core_ Controller_ ');} $clazz = "{$controllerClassPrefix} {$controller _name}"; Core_autoloader::loadclass ($clazz, true); $obj = new Reflectionclass ($clazz); $d = Array (); $publicMethods = $obj GetMethods (Reflectionmethod::is_public), foreach ($publicMethods as $method) {if (Preg_match ('/^action/i ', $method- >name) {$action _name = preg_replace ('/^action/i ', ' ", $method->name); $RMD = Core_mvc_router::resourceencode ($ Controller_name, $action _nAME); $q = Array_shift ($RMD); $d [$q] = Self::getaclresourcedescription ($method->getdoccomment ());}} Return Array (' description ' = Self::getaclresourcedescription ($obj->getdoccomment ()), ' actions ' = $d);} static function Getaclresourcedescription ($finder) {static $tagfinder _start = ' @aclres-finder-desc{'; static $ Tagfinder_end = '}aclres-finder-desc@ '; if (empty ($finder)) return '; $start = Stripos ($finder, $tagfinder _start); if ($ Start) {$end = Stripos ($finder, $tagfinder _end), if ($end && $end > $start) {//Only closed labels are line $start = $start +strlen ($ Tagfinder_start), return trim (substr ($finder, $start, $end-$start));}} Return ';}}
?
1/F Vb2005xu 2012-05-31
HTTP://WWW.PHP10086.COM/PAGE/3 a good blog
2/F Vb2005xu 2012-05-31
http://opauth.org/
3/F Vb2005xu 2012-06-01
Http://www.shejidaren.com/category/css