Exemple #1
0
 public function __construct()
 {
     parent::__construct();
     $p = new reflectionobject($this);
     var_dump($h = $p->getProperty('a'));
     var_dump($h->isDefault(), $h->isProtected(), $h->isPrivate(), $h->isPublic(), $h->isStatic());
     var_dump($p->getProperties());
 }
Exemple #2
0
}
/* Include the controller
 */
if (file_exists($file = "../controllers/" . $_page->module . ".php")) {
    include $file;
    $controller_class = str_replace("/", "_", $_page->module) . "_controller";
    if (class_exists($controller_class) == false) {
        print "Controller class '" . $controller_class . "' does not exist.\n";
    } else {
        if (is_subclass_of($controller_class, "controller") == false) {
            print "Controller class '" . $controller_class . "' does not extend 'controller'.\n";
        } else {
            $_controller = new $controller_class($_database, $_settings, $_user, $_page, $_output, $_language);
            $method = "execute";
            if (is_true(URL_PARAMETERS)) {
                $reflection = new reflectionobject($_controller);
                $param_count = count($reflection->getmethod($method)->getParameters());
                unset($reflection);
                $params = array_pad($_page->parameters, $param_count, null);
                call_user_func_array(array($_controller, $method), $params);
            } else {
                $_controller->{$method}();
            }
            unset($_controller);
            if ($_output->disabled) {
                print ob_get_clean();
                exit;
            }
            while ($_output->depth > 2) {
                print "System error: controller didn't close an open tag.";
                $_output->close_tag();