/** * method for calling function or static method * @param type $call * @param type $matches * @return boolean $res if no function or method is found return false. */ public static function call($call) { $ary = explode('::', $call); $call_exists = null; ob_start(); // call is a class if (count($ary) == 2) { $module = $ary[0]; $method = $ary[1]; $class = self::getModuleName($module); moduleloader::includeModule($module); moduleloader::$running = $module; if (method_exists($class, $method)) { $call_exists = 1; $o = new $class(); $o->{$method}(); if (isset(moduleloader::$status[403])) { moduleloader::includeModule('error'); $e = new errorModule(); $e->accessdeniedAction(); } if (isset(moduleloader::$status[404])) { moduleloader::includeModule('error'); $e = new errorModule(); $e->notfoundAction(); } } } return ob_get_clean(); }
/** * Include a module based on an array with method to call * @param array $call * @return boolean $res */ public static function includeModule($call) { $ary = explode('::', $call); $module = $ary[0]; if (moduleloader::moduleExists($module)) { moduleloader::includeModule($module); moduleloader::$running = $module; return true; } return false; }