import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -17,7 +17,7 @@
* @subpackage Framework
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
* @version $Id: Console.php 16972 2009-07-22 18:44:24Z ralph $
*/
/**
@ -64,6 +64,16 @@ class Zend_Tool_Framework_Client_Console
Zend_Tool_Framework_Client_Interactive_OutputInterface
{
/**
* @var array
*/
protected $_configOptions = null;
/**
* @var array
*/
protected $_storageOptions = null;
/**
* @var Zend_Filter_Word_CamelCaseToDash
*/
@ -79,13 +89,25 @@ class Zend_Tool_Framework_Client_Console
* self contained main() function.
*
*/
public static function main()
public static function main($options = array())
{
ini_set('display_errors', true);
$cliClient = new self();
$cliClient = new self($options);
$cliClient->dispatch();
}
public function setConfigOptions($configOptions)
{
$this->_configOptions = $configOptions;
return $this;
}
public function setStorageOptions($storageOptions)
{
$this->_storageOptions = $storageOptions;
return $this;
}
/**
* getName() - return the name of the client, in this case 'console'
*
@ -102,6 +124,21 @@ class Zend_Tool_Framework_Client_Console
*/
protected function _preInit()
{
$config = $this->_registry->getConfig();
if ($this->_configOptions != null) {
$config->setOptions($this->_configOptions);
}
$storage = $this->_registry->getStorage();
if ($this->_storageOptions != null && isset($this->_storageOptions['directory'])) {
require_once 'Zend/Tool/Framework/Client/Storage/Directory.php';
$storage->setAdapter(
new Zend_Tool_Framework_Client_Storage_Directory($this->_storageOptions['directory'])
);
}
// support the changing of the current working directory, necessary for some providers
if (isset($_ENV['ZEND_TOOL_CURRENT_WORKING_DIRECTORY'])) {
chdir($_ENV['ZEND_TOOL_CURRENT_WORKING_DIRECTORY']);