public function getDepends() { $name = get_class($this); $reflection = new \Addendum\ReflectionAnnotatedClass($name); if ($reflection->hasAnnotation('Depends')) { $a = $reflection->getAnnotation('Depends'); return $a->value; } return array(); }
public function execute($command, $args) { $c = $this->command(ucfirst($command)); if ($c) { $deps = $c->getDepends(); if (!is_array($deps)) { $deps = array($deps); } foreach ($deps as $dep) { $this->execute($dep, $args); } $reflection = new \Addendum\ReflectionAnnotatedClass($c); if (!$reflection->hasAnnotation('Clips\\FullArgs')) { array_shift($args); // For the clips script array_shift($args); // For the command } return $c->execute($args); } trigger_error('No command named ' . $command . ' found!'); }