/**
  * Attempts the registration of a single shell command.
  * @param  string $name
  */
 private function attemptRegistration($name)
 {
     try {
         $classpath = implode(array("Strata", StrataCommandNamer::getNamespaceStringInStrata(), $name), "\\");
         $this->application->add(new $classpath());
     } catch (Exception $e) {
         echo "Unable to autoload the '{$name}' command.";
     }
 }
Пример #2
0
 /**
  * Generates a possible namespace and classname combination of a
  * Strata controller. Mainly used to avoid hardcoding the '\\Shell\\Command\\'
  * string everywhere.
  * @param  string $name The class name of the controller
  * @return string       A fulle namespaced controller name
  */
 public static function generateClassPath($name)
 {
     return StrataCommandNamer::generateClassName($name);
 }
 /**
  * {@inheritdoc}
  */
 public function applyOptions(array $args)
 {
     $this->keyword = $args[0];
     $this->classname = StrataCommandNamer::generateClassName($this->keyword);
 }