Esempio n. 1
0
 public function init(array $argv = array(), $verbosity = 0)
 {
     $this->_verbosity = $verbosity;
     /* First element is the php script name. Store it for debugging. */
     $this->_php_exec = array_shift($argv);
     /* Second element is just the executable we called to run ZF commands. Store it for printing errors/usage. */
     $this->_native_exec = array_shift($argv);
     $opts = $this->getOptions()->addArguments($argv);
     $opts->parse();
     // Shortcut to verbosity option so that we can display more earlier
     if (isset($opts->verbosity)) {
         $this->_verbosity = $opts->verbosity;
     }
     // Shortcut to help option so that no arguments have to be specified
     if (isset($opts->help)) {
         $this->printHelp();
         return null;
     }
     try {
         $actionName = array_shift($argv);
         $context = Zend_Build_Manifest::getInstance()->getContext(self::MF_ACTION_TYPE, $actionName);
         $config = $this->_parseParams($context, $argv);
         $action = new $context->class();
         $action . setConfig($config);
         $action . configure();
     } catch (Zend_Console_Exception $e) {
         throw $e->prependUsage($this->getUsage());
     }
     return $this;
 }
Esempio n. 2
0
 public function __construct()
 {
     $buildManifest = Zend_Build_Manifest::getInstance();
     $buildManifest->scanIncludePath();
     $this->_globalContext = new Zend_Tool_Cli_Context_Global();
     $this->_globalContext->setBuildManifest($buildManifest);
     $this->_actionContext = new Zend_Tool_Cli_Context_Action();
     $this->_actionContext->setBuildManifest($buildManifest);
     $this->_resourceContext = new Zend_Tool_Cli_Context_Resource();
     $this->_resourceContext->setBuildManifest($buildManifest);
 }
Esempio n. 3
0
 /**
  * _make
  *
  * @param  string $type
  * @param  string $name
  * @throws Zend_Build_Exception
  * @return Zend_Config
  */
 private static function _make($type, $name)
 {
     /**
      * @see Zend_Build_Manifest
      */
     require_once 'Zend/Build/Manifest.php';
     $config = Zend_Build_Manifest::getInstance()->getContext($type, $name);
     if (!is_set($config)) {
         /**
          * @see Zend_Build_Exception
          */
         require_once 'Zend/Build/Exception.php';
         throw new Zend_Build_Exception("Action '{$name}' not found.");
     }
     return Zend_Build_AbstractConfigurable::getConfigurable($config);
 }
Esempio n. 4
0
 public function setup()
 {
     $this->_cdToTestProject();
     $this->_manifest = Zend_Build_Manifest::getInstance();
 }
Esempio n. 5
0
 public function __construct()
 {
     $this->_buildManifest = Zend_Build_Manifest::getInstance();
 }