execute() public method

Executes the command
public execute ( Zephir\Config $config, Zephir\Logger $logger )
$config Zephir\Config
$logger Zephir\Logger
Exemplo n.º 1
0
 public function execute(Config $config, Logger $logger)
 {
     if (isset($_SERVER['argv'][2])) {
         $this->setParameter('namespace', strtolower(preg_replace('/[^0-9a-zA-Z]/', '', $_SERVER['argv'][2])));
     }
     parent::execute($config, $logger);
 }
Exemplo n.º 2
0
 public function execute(Config $config, Logger $logger)
 {
     $params = $this->parseArguments();
     $allowedArgs = array("theme-path" => "@.+@");
     foreach ($params as $k => $p) {
         if (isset($allowedArgs[$k])) {
             if (preg_match($allowedArgs[$k], $p)) {
                 $this->setParameter($k, $p);
             } else {
                 throw new Exception("Invalid value for argument '{$k}'");
             }
         } else {
             throw new Exception("Invalid argument '{$k}''");
         }
     }
     parent::execute($config, $logger);
 }
Exemplo n.º 3
0
 public function execute(Config $config, Logger $logger)
 {
     $params = $this->parseArguments();
     $allowedArgs = array("theme-path" => "@.+@", "output-directory" => "@.+@", "theme-options" => "@.+@", "base-url" => "@.+@");
     foreach ($params as $k => $p) {
         if (isset($allowedArgs[$k])) {
             if (preg_match($allowedArgs[$k], $p)) {
                 $this->setParameter($k, $p);
             } else {
                 throw new Exception("Invalid value for argument '{$k}'");
             }
         } else {
             if (!in_array($k, array('parser-compiled'))) {
                 throw new Exception("Invalid argument '{$k}' for api command'");
             }
         }
     }
     parent::execute($config, $logger);
 }