Esempio n. 1
0
 public function __construct()
 {
     $args = func_get_args();
     $this->rules = array();
     foreach ($args as $i => &$v) {
         if (is_array($v)) {
             $execute = false;
             if (array_key_exists('execute', $v)) {
                 $execute = $v['execute'];
                 unset($v['execute']);
             }
             $v = Dispatcher_Utils::vivify_rule($v);
             if ($execute) {
                 call_user_func_array(array($v, 'execute'), $execute);
             }
         }
         if (!is_object($v)) {
             Dispatch_Exception::construction("Got something that is not an object for argument {$i}");
         }
         if (!$v instanceof Dispatcher_Rule) {
             Dispatch_Exception::construction("Got something that is not a Dispatcher_Rule for argument {$i}");
         }
         $this->add_rule($v);
     }
     return $this;
 }
Esempio n. 2
0
 public static function Exception($name)
 {
     throw Dispatcher_Utils::vivify_exception(func_get_args());
 }
Esempio n. 3
0
 public function execute($action)
 {
     $this->action = Dispatcher_Utils::vivify_action(func_get_args());
     return $this;
 }
Esempio n. 4
0
 public function __construct(array $config)
 {
     $this->document_root = Dispatcher_Utils::extract_param($config, array('name' => 'document_root', 'required' => true));
 }