import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 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: Base.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Base.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,16 +31,16 @@ require_once 'Zend/Tool/Framework/Action/Interface.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Interface
class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Interface
{
/**
* @var string
*/
protected $_name = null;
/**
* constructor -
* constructor -
*
* @param unknown_type $options
*/
@ -53,7 +53,7 @@ class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Inte
// implement $options here in the future if this is needed
}
}
/**
* setName()
*
@ -65,7 +65,7 @@ class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Inte
$this->_name = $name;
return $this;
}
/**
* getName()
*
@ -78,7 +78,7 @@ class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Inte
}
return $this->_name;
}
/**
* _parseName - internal method to determine the name of an action when one is not explicity provided.
*
@ -91,5 +91,5 @@ class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Inte
$actionName = substr($className, strrpos($className, '_')+1);
return $actionName;
}
}

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: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Exception.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,5 +33,5 @@ require_once 'Zend/Tool/Framework/Exception.php';
*/
class Zend_Tool_Framework_Action_Exception extends Zend_Tool_Framework_Exception
{
}

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: Repository.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Repository.php 18951 2009-11-12 16:26:19Z alexander $
*/
require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
@ -28,20 +28,20 @@ require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Action_Repository
class Zend_Tool_Framework_Action_Repository
implements Zend_Tool_Framework_Registry_EnabledInterface, IteratorAggregate, Countable
{
/**
* @var Zend_Tool_Framework_Registry_Interface
*/
protected $_registry = null;
/**
* @var array
*/
protected $_actions = array();
/**
* setRegistry()
*
@ -51,7 +51,7 @@ class Zend_Tool_Framework_Action_Repository
{
$this->_registry = $registry;
}
/**
* addAction()
*
@ -66,10 +66,10 @@ class Zend_Tool_Framework_Action_Repository
require_once 'Zend/Tool/Framework/Action/Exception.php';
throw new Zend_Tool_Framework_Action_Exception('An action name for the provided action could not be determined.');
}
if (!$overrideExistingAction && array_key_exists(strtolower($actionName), $this->_actions)) {
require_once 'Zend/Tool/Framework/Action/Exception.php';
throw new Zend_Tool_Framework_Action_Exception('An action by the name ' . $actionName
throw new Zend_Tool_Framework_Action_Exception('An action by the name ' . $actionName
. ' is already registered and $overrideExistingAction is set to false.');
}
@ -86,7 +86,7 @@ class Zend_Tool_Framework_Action_Repository
{
return null;
}
/**
* getActions() - get all actions in the repository
*
@ -111,7 +111,7 @@ class Zend_Tool_Framework_Action_Repository
return $this->_actions[strtolower($actionName)];
}
/**
* count() required by the Countable interface
*
@ -121,7 +121,7 @@ class Zend_Tool_Framework_Action_Repository
{
return count($this->_actions);
}
/**
* getIterator() - get all actions, this supports the IteratorAggregate interface
*

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: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -44,7 +44,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
* @var Zend_Tool_Framework_Registry
*/
protected $_registry = null;
/**
* @var callback|null
*/
@ -54,19 +54,19 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
* @var bool
*/
protected $_isInitialized = false;
/**
* @var Zend_Log
*/
protected $_debugLogger = null;
public function __construct($options = array())
{
if ($options) {
$this->setOptions($options);
}
}
public function setOptions(Array $options)
{
foreach ($options as $optionName => $optionValue) {
@ -76,15 +76,15 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
}
}
}
/**
* getName() - Return the client name which can be used to
* getName() - Return the client name which can be used to
* query the manifest if need be.
*
* @return string The client name
*/
abstract public function getName();
/**
* initialized() - This will initialize the client for use
*
@ -95,15 +95,15 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
if ($this->_isInitialized) {
return;
}
// this might look goofy, but this is setting up the
// this might look goofy, but this is setting up the
// registry for dependency injection into the client
$registry = new Zend_Tool_Framework_Registry();
$registry->setClient($this);
// NOTE: at this moment, $this->_registry should contain
// the registry object
// run any preInit
$this->_preInit();
@ -113,27 +113,27 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
require_once 'Zend/Log/Writer/Null.php';
$this->_debugLogger = new Zend_Log(new Zend_Log_Writer_Null());
}
// let the loader load, then the repositories process whats been loaded
$this->_registry->getLoader()->load();
// process the action repository
$this->_registry->getActionRepository()->process();
// process the provider repository
$this->_registry->getProviderRepository()->process();
// process the manifest repository
$this->_registry->getManifestRepository()->process();
if ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface) {
require_once 'Zend/Tool/Framework/Client/Interactive/InputHandler.php';
}
if ($this instanceof Zend_Tool_Framework_Client_Interactive_OutputInterface) {
$this->_registry->getResponse()->setContentCallback(array($this, 'handleInteractiveOutput'));
}
}
@ -160,7 +160,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
protected function _postDispatch()
{
}
/**
* setRegistry() - Required by the Zend_Tool_Framework_Registry_EnabledInterface
* interface which ensures proper registry dependency resolution
@ -173,10 +173,10 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
$this->_registry = $registry;
return $this;
}
/**
* hasInteractiveInput() - Convienence method for determining if this
* client can handle interactive input, and thus be able to run the
* client can handle interactive input, and thus be able to run the
* promptInteractiveInput
*
* @return bool
@ -185,21 +185,21 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
{
return ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface);
}
public function promptInteractiveInput($inputRequest)
{
if (!$this->hasInteractiveInput()) {
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('promptInteractive() cannot be called on a non-interactive client.');
}
$inputHandler = new Zend_Tool_Framework_Client_Interactive_InputHandler();
$inputHandler->setClient($this);
$inputHandler->setInputRequest($inputRequest);
return $inputHandler->handle();
}
/**
* This method should be called in order to "handle" a Tooling Client
* request that has come to the client that has been implemented.
@ -207,7 +207,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
public function dispatch()
{
$this->initialize();
try {
$this->_preDispatch();
@ -234,51 +234,51 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
$this->_postDispatch();
}
public function convertToClientNaming($string)
{
return $string;
}
public function convertFromClientNaming($string)
{
return $string;
}
protected function _handleDispatch()
{
// get the provider repository
$providerRepository = $this->_registry->getProviderRepository();
$request = $this->_registry->getRequest();
// get the dispatchable provider signature
$providerSignature = $providerRepository->getProviderSignature($request->getProviderName());
// get the actual provider
$provider = $providerSignature->getProvider();
// ensure that we can pretend if this is a pretend request
if ($request->isPretend() && (!$provider instanceof Zend_Tool_Framework_Provider_Pretendable)) {
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - provider does not support pretend');
throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - provider does not support pretend');
}
// get the action name
$actionName = $this->_registry->getRequest()->getActionName();
if (!$actionableMethod = $providerSignature->getActionableMethodByActionName($actionName)) {
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - actionable method not found');
throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - actionable method not found');
}
// get the actual method and param information
$methodName = $actionableMethod['methodName'];
$methodParameters = $actionableMethod['parameterInfo'];
// get the provider params
$requestParameters = $this->_registry->getRequest()->getProviderParameters();
// @todo This seems hackish, determine if there is a better way
$callParameters = array();
foreach ($methodParameters as $methodParameterName => $methodParameterValue) {
@ -299,11 +299,11 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor
$callParameters[] = (array_key_exists($methodParameterName, $requestParameters)) ? $requestParameters[$methodParameterName] : $methodParameterValue['default'];
}
}
if (($specialtyName = $this->_registry->getRequest()->getSpecialtyName()) != '_Global') {
$methodName .= $specialtyName;
}
if (method_exists($provider, $methodName)) {
call_user_func_array(array($provider, $methodName), $callParameters);
} elseif (method_exists($provider, $methodName . 'Action')) {

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: Config.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Config.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,21 +28,21 @@
*/
class Zend_Tool_Framework_Client_Config
{
protected $_configFilepath = null;
/**
* @var Zend_Config
*/
protected $_config = null;
public function __config($options = array())
{
if ($options) {
$this->setOptions($options);
}
}
public function setOptions(Array $options)
{
foreach ($options as $optionName => $optionValue) {
@ -52,7 +52,7 @@ class Zend_Tool_Framework_Client_Config
}
}
}
public function setConfigFilepath($configFilepath)
{
if (!file_exists($configFilepath)) {
@ -61,9 +61,9 @@ class Zend_Tool_Framework_Client_Config
}
$this->_configFilepath = $configFilepath;
$suffix = substr($configFilepath, -4);
switch ($suffix) {
case '.ini':
require_once 'Zend/Config/Ini.php';
@ -83,23 +83,23 @@ class Zend_Tool_Framework_Client_Config
. $suffix . ' at location ' . $configFilepath
);
}
return $this;
}
public function getConfigFilepath()
{
return $this->_configFilepath;
}
public function get($name, $defaultValue)
{
return $this->_config->get($name, $defaultValue);
}
public function __get($name)
{
return $this->_config->{$name};
}
}

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: Console.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: Console.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -52,40 +52,40 @@ require_once 'Zend/Tool/Framework/Client/Response/ContentDecorator/Separator.php
/**
* Zend_Tool_Framework_Client_Console - the CLI Client implementation for Zend_Tool_Framework
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Client_Console
class Zend_Tool_Framework_Client_Console
extends Zend_Tool_Framework_Client_Abstract
implements Zend_Tool_Framework_Client_Interactive_InputInterface,
Zend_Tool_Framework_Client_Interactive_OutputInterface
Zend_Tool_Framework_Client_Interactive_OutputInterface
{
/**
* @var array
*/
protected $_configOptions = null;
/**
* @var array
*/
protected $_storageOptions = null;
/**
* @var Zend_Filter_Word_CamelCaseToDash
*/
protected $_filterToClientNaming = null;
/**
* @var Zend_Filter_Word_DashToCamelCase
*/
protected $_filterFromClientNaming = null;
/**
* main() - This is typically called from zf.php. This method is a
* main() - This is typically called from zf.php. This method is a
* self contained main() function.
*
*/
@ -101,13 +101,13 @@ class Zend_Tool_Framework_Client_Console
$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'
*
@ -117,7 +117,7 @@ class Zend_Tool_Framework_Client_Console
{
return 'console';
}
/**
* _init() - Tasks processed before the constructor, generally setting up objects to use
*
@ -125,25 +125,25 @@ 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']);
}
// support setting the loader from the environment
if (isset($_ENV['ZEND_TOOL_FRAMEWORK_LOADER_CLASS'])) {
if (class_exists($_ENV['ZEND_TOOL_FRAMEWORK_LOADER_CLASS'])
@ -163,7 +163,7 @@ class Zend_Tool_Framework_Client_Console
protected function _preDispatch()
{
$response = $this->_registry->getResponse();
if (function_exists('posix_isatty')) {
require_once 'Zend/Tool/Framework/Client/Console/ResponseDecorator/Colorizer.php';
$response->addContentDecorator(new Zend_Tool_Framework_Client_Console_ResponseDecorator_Colorizer());
@ -171,12 +171,12 @@ class Zend_Tool_Framework_Client_Console
$response->addContentDecorator(new Zend_Tool_Framework_Client_Response_ContentDecorator_Separator())
->setDefaultDecoratorOptions(array('separator' => true));
$optParser = new Zend_Tool_Framework_Client_Console_ArgumentParser();
$optParser->setArguments($_SERVER['argv'])
->setRegistry($this->_registry)
->parse();
return;
}
@ -188,7 +188,7 @@ class Zend_Tool_Framework_Client_Console
{
$request = $this->_registry->getRequest();
$response = $this->_registry->getResponse();
if ($response->isException()) {
require_once 'Zend/Tool/Framework/Client/Console/HelpSystem.php';
$helpSystem = new Zend_Tool_Framework_Client_Console_HelpSystem();
@ -199,17 +199,17 @@ class Zend_Tool_Framework_Client_Console
$request->getActionName()
);
}
echo PHP_EOL;
return;
}
/**
* handleInteractiveInputRequest() is required by the Interactive InputInterface
*
*
*
* @param Zend_Tool_Framework_Client_Interactive_InputRequest $inputRequest
* @return string
* @return string
*/
public function handleInteractiveInputRequest(Zend_Tool_Framework_Client_Interactive_InputRequest $inputRequest)
{
@ -217,10 +217,10 @@ class Zend_Tool_Framework_Client_Console
$inputContent = fgets(STDIN);
return rtrim($inputContent); // remove the return from the end of the string
}
/**
* handleInteractiveOutput() is required by the Interactive OutputInterface
*
*
* This allows us to display output immediately from providers, rather
* than displaying it after the provider is done.
*
@ -230,9 +230,9 @@ class Zend_Tool_Framework_Client_Console
{
echo $output;
}
/**
* getMissingParameterPromptString()
* getMissingParameterPromptString()
*
* @param Zend_Tool_Framework_Provider_Interface $provider
* @param Zend_Tool_Framework_Action_Interface $actionInterface
@ -244,14 +244,14 @@ class Zend_Tool_Framework_Client_Console
return 'Please provide a value for $' . $missingParameterName;
}
/**
* convertToClientNaming()
*
*
* Convert words to client specific naming, in this case is lower, dash separated
*
* Filters are lazy-loaded.
*
*
* @param string $string
* @return string
*/
@ -264,20 +264,20 @@ class Zend_Tool_Framework_Client_Console
$filter = new Zend_Filter();
$filter->addFilter(new Zend_Filter_Word_CamelCaseToDash());
$filter->addFilter(new Zend_Filter_StringToLower());
$this->_filterToClientNaming = $filter;
}
return $this->_filterToClientNaming->filter($string);
}
/**
* convertFromClientNaming()
*
* Convert words from client specific naming to code naming - camelcased
*
*
* Filters are lazy-loaded.
*
*
* @param string $string
* @return string
*/
@ -287,7 +287,7 @@ class Zend_Tool_Framework_Client_Console
require_once 'Zend/Filter/Word/DashToCamelCase.php';
$this->_filterFromClientNaming = new Zend_Filter_Word_DashToCamelCase();
}
return $this->_filterFromClientNaming->filter($string);
}

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: ArgumentParser.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: ArgumentParser.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,9 +31,9 @@ require_once 'Zend/Console/Getopt.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Framework_Registry_EnabledInterface
class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Framework_Registry_EnabledInterface
{
/**
* @var Zend_Tool_Framework_Registry_Interface
*/
@ -63,8 +63,8 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
protected $_helpKnownAction = false;
protected $_helpKnownProvider = false;
protected $_helpKnownSpecialty = false;
/**
* setArguments
*
@ -76,7 +76,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_argumentsOriginal = $this->_argumentsWorking = $arguments;
return $this;
}
/**
* setRegistry()
*
@ -87,14 +87,14 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
{
// get the client registry
$this->_registry = $registry;
// set manifest repository, request, response for easy access
$this->_manifestRepository = $this->_registry->getManifestRepository();
$this->_request = $this->_registry->getRequest();
$this->_response = $this->_registry->getResponse();
return $this;
}
/**
* Parse() - This method does the work of parsing the arguments into the enpooint request,
* this will also (during help operations) fill the response in with information as needed
@ -108,10 +108,10 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('The client registry must have both a request and response registered.');
}
// setup the help options
$helpResponseOptions = array();
// check to see if the first cli arg is the script name
if ($this->_argumentsWorking[0] == $_SERVER['SCRIPT_NAME' ]) {
array_shift($this->_argumentsWorking);
@ -128,7 +128,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
// ensure there are arguments left
if (count($this->_argumentsWorking) == 0) {
$this->_request->setDispatchable(false); // at this point request is not dispatchable
// check to see if this was a help request
if ($this->_help) {
$this->_createHelpResponse();
@ -149,17 +149,17 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
if ($this->_helpKnownAction) {
$helpResponseOptions = array_merge(
$helpResponseOptions,
$helpResponseOptions,
array('actionName' => $this->_request->getActionName())
);
}
/* @TODO Action Parameter Requirements */
// make sure there are more "words" on the command line
if (count($this->_argumentsWorking) == 0) {
$this->_request->setDispatchable(false); // at this point request is not dispatchable
// check to see if this is a help request
if ($this->_help) {
$this->_createHelpResponse($helpResponseOptions);
@ -169,7 +169,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
return;
}
// process the provider part of the command line
try {
$this->_parseProviderPart();
@ -178,21 +178,21 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_createHelpResponse(array('error' => $exception->getMessage()));
return;
}
if ($this->_helpKnownProvider) {
$helpResponseOptions = array_merge(
$helpResponseOptions,
$helpResponseOptions,
array('providerName' => $this->_request->getProviderName())
);
}
if ($this->_helpKnownSpecialty) {
$helpResponseOptions = array_merge(
$helpResponseOptions,
$helpResponseOptions,
array('specialtyName' => $this->_request->getSpecialtyName())
);
}
// if there are arguments on the command line, lets process them as provider options
if (count($this->_argumentsWorking) != 0) {
$this->_parseProviderOptionsPart();
@ -234,7 +234,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$getoptOptions['pretend|p'] = 'PRETEND';
$getoptOptions['debug|d'] = 'DEBUG';
$getoptParser = new Zend_Console_Getopt($getoptOptions, $this->_argumentsWorking, array('parseAll' => false));
// @todo catch any exceptions here
$getoptParser->parse();
@ -247,7 +247,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_request->setVerbose(true);
} else {
$property = '_'.$option;
$this->{$property} = true;
$this->{$property} = true;
}
}
@ -313,7 +313,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_help = true;
return;
}
// get the cli provider names from the manifest
$providerMetadata = $this->_manifestRepository->getMetadata(array(
'type' => 'Tool',
@ -331,15 +331,15 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_helpKnownProvider = true;
$this->_request->setProviderName($providerMetadata->getProviderName());
if ($consoleSpecialtyName == '?') {
$this->_help = true;
return;
}
$providerSpecialtyMetadata = $this->_manifestRepository->getMetadata(array(
'type' => 'Tool',
'name' => 'specialtyName',
'type' => 'Tool',
'name' => 'specialtyName',
'value' => $consoleSpecialtyName,
'providerName' => $providerMetadata->getProviderName(),
'clientName' => 'console'
@ -368,7 +368,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_help = true;
return;
}
$searchParams = array(
'type' => 'Tool',
'providerName' => $this->_request->getProviderName(),
@ -399,10 +399,10 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
// process ParameterInfo into array for command line option matching
if ($parameterInfo['type'] == 'string' || $parameterInfo['type'] == 'bool') {
$optionConfig .= $paramNameShortValues[$parameterNameLong]
$optionConfig .= $paramNameShortValues[$parameterNameLong]
. (($parameterInfo['optional']) ? '-' : '=') . 's';
} elseif (in_array($parameterInfo['type'], array('int', 'integer', 'float'))) {
$optionConfig .= $paramNameShortValues[$parameterNameLong]
$optionConfig .= $paramNameShortValues[$parameterNameLong]
. (($parameterInfo['optional']) ? '-' : '=') . 'i';
} else {
$optionConfig .= $paramNameShortValues[$parameterNameLong] . '-s';
@ -467,7 +467,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
$this->_metadataProviderOptionsLong = $actionableMethodLongParamsMetadata;
$this->_metadataProviderOptionsShort = $actionableMethodShortParamsMetadata;
*/
$this->_argumentsWorking = $getoptParser->getRemainingArgs();
return;
@ -483,11 +483,11 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra
require_once 'Zend/Tool/Framework/Client/Console/HelpSystem.php';
$helpSystem = new Zend_Tool_Framework_Client_Console_HelpSystem();
$helpSystem->setRegistry($this->_registry);
if (isset($options['error'])) {
$helpSystem->respondWithErrorMessage($options['error']);
}
if (isset($options['actionName']) && isset($options['providerName'])) {
$helpSystem->respondWithSpecialtyAndParamHelp($options['providerName'], $options['actionName']);
} elseif (isset($options['actionName'])) {

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: HelpSystem.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: HelpSystem.php 18305 2009-09-19 16:31:16Z beberlei $
*/
/**
@ -297,7 +297,9 @@ class Zend_Tool_Framework_Client_Console_HelpSystem
'clientName' => 'console'
));
$this->_respondWithCommand($providerMetadata, $actionMetadata, $specialtyMetadata, $actionableSpecialtyLongMetadata);
if($actionableSpecialtyLongMetadata) {
$this->_respondWithCommand($providerMetadata, $actionMetadata, $specialtyMetadata, $actionableSpecialtyLongMetadata);
}
}
}

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: Manifest.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Manifest.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -58,7 +58,7 @@ require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Client_Console_Manifest
implements Zend_Tool_Framework_Registry_EnabledInterface,
implements Zend_Tool_Framework_Registry_EnabledInterface,
Zend_Tool_Framework_Manifest_MetadataManifestable
{
@ -66,7 +66,7 @@ class Zend_Tool_Framework_Client_Console_Manifest
* @var Zend_Tool_Framework_Registry_Interface
*/
protected $_registry = null;
/**
* setRegistry() - Required for the Zend_Tool_Framework_Registry_EnabledInterface interface
*
@ -78,12 +78,12 @@ class Zend_Tool_Framework_Client_Console_Manifest
$this->_registry = $registry;
return $this;
}
/**
* getMetadata() is required by the Manifest Interface.
*
*
* These are the following metadatas that will be setup:
*
*
* actionName
* - metadata for actions
* - value will be a dashed name for the action named in 'actionName'
@ -102,17 +102,17 @@ class Zend_Tool_Framework_Client_Console_Manifest
public function getMetadata()
{
$metadatas = array();
// setup the camelCase to dashed filter to use since cli expects dashed named
$ccToDashedFilter = new Zend_Filter();
$ccToDashedFilter
->addFilter(new Zend_Filter_Word_CamelCaseToDash())
->addFilter(new Zend_Filter_StringToLower());
// get the registry to get the action and provider repository
$actionRepository = $this->_registry->getActionRepository();
$providerRepository = $this->_registry->getProviderRepository();
// loop through all actions and create a metadata for each
foreach ($actionRepository->getActions() as $action) {
// each action metadata will be called
@ -140,7 +140,7 @@ class Zend_Tool_Framework_Client_Console_Manifest
// create the metadatas for the per provider specialites in providerSpecaltyNames
foreach ($providerSignature->getSpecialties() as $specialty) {
$metadatas[] = new Zend_Tool_Framework_Metadata_Tool(array(
'name' => 'specialtyName',
'value' => $ccToDashedFilter->filter($specialty),
@ -149,25 +149,25 @@ class Zend_Tool_Framework_Client_Console_Manifest
'providerName' => $providerSignature->getName(),
'specialtyName' => $specialty,
'clientReference' => $this->_registry->getClient()
));
));
}
// $actionableMethod is keyed by the methodName (but not used)
foreach ($providerSignature->getActionableMethods() as $actionableMethodData) {
$methodLongParams = array();
$methodShortParams = array();
// $actionableMethodData get both the long and short names
foreach ($actionableMethodData['parameterInfo'] as $parameterInfoData) {
// filter to dashed
$methodLongParams[$parameterInfoData['name']] = $ccToDashedFilter->filter($parameterInfoData['name']);
// simply lower the character, (its only 1 char after all)
$methodShortParams[$parameterInfoData['name']] = strtolower($parameterInfoData['name'][0]);
}
// create metadata for the long name cliActionableMethodLongParameters
@ -181,7 +181,7 @@ class Zend_Tool_Framework_Client_Console_Manifest
'reference' => &$actionableMethodData,
'clientReference' => $this->_registry->getClient()
));
// create metadata for the short name cliActionableMethodShortParameters
$metadatas[] = new Zend_Tool_Framework_Metadata_Tool(array(
'name' => 'actionableMethodShortParams',
@ -197,13 +197,13 @@ class Zend_Tool_Framework_Client_Console_Manifest
}
}
return $metadatas;
}
public function getIndex()
{
return 10000;
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: InputHandler.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: InputHandler.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,20 +27,20 @@
*/
class Zend_Tool_Framework_Client_Interactive_InputHandler
{
/**
* @var Zend_Tool_Framework_Client_Interactive_InputInterface
*/
protected $_client = null;
protected $_inputRequest = null;
public function setClient(Zend_Tool_Framework_Client_Interactive_InputInterface $client)
{
$this->_client = $client;
return $this;
}
public function setInputRequest($inputRequest)
{
if (is_string($inputRequest)) {
@ -50,25 +50,25 @@ class Zend_Tool_Framework_Client_Interactive_InputHandler
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('promptInteractive() requires either a string or an instance of Zend_Tool_Framework_Client_Interactive_InputRequest.');
}
$this->_inputRequest = $inputRequest;
return $this;
}
public function handle()
{
$inputResponse = $this->_client->handleInteractiveInputRequest($this->_inputRequest);
if (is_string($inputResponse)) {
require_once 'Zend/Tool/Framework/Client/Interactive/InputResponse.php';
$inputResponse = new Zend_Tool_Framework_Client_Interactive_InputResponse($inputResponse);
$inputResponse = new Zend_Tool_Framework_Client_Interactive_InputResponse($inputResponse);
} elseif (!$inputResponse instanceof Zend_Tool_Framework_Client_Interactive_InputResponse) {
require_once 'Zend/Tool/Framework/Client/Exception.php';
throw new Zend_Tool_Framework_Client_Exception('The registered $_interactiveCallback for the client must either return a string or an instance of Zend_Tool_Framework_Client_Interactive_InputResponse.');
}
return $inputResponse;
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: InputInterface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: InputInterface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,7 +27,7 @@
*/
interface Zend_Tool_Framework_Client_Interactive_InputInterface
{
/**
* Handle Interactive Input Request
*
@ -35,7 +35,7 @@ interface Zend_Tool_Framework_Client_Interactive_InputInterface
* @return Zend_Tool_Framework_Client_Interactive_InputResponse|string
*/
public function handleInteractiveInputRequest(Zend_Tool_Framework_Client_Interactive_InputRequest $inputRequest);
public function getMissingParameterPromptString(Zend_Tool_Framework_Provider_Interface $provider, Zend_Tool_Framework_Action_Interface $actionInterface, $missingParameterName);
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: InputRequest.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: InputRequest.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,20 +28,20 @@
class Zend_Tool_Framework_Client_Interactive_InputRequest
{
protected $_content = null;
public function __construct($content = null)
{
if ($content) {
$this->setContent($content);
}
}
public function setContent($content)
{
$this->_content = $content;
return $this;
}
public function getContent()
{
return $this->_content;

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: InputResponse.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: InputResponse.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,26 +27,26 @@
*/
class Zend_Tool_Framework_Client_Interactive_InputResponse
{
protected $_content = null;
public function __construct($content = null)
{
if ($content) {
$this->setContent($content);
}
}
public function setContent($content)
{
$this->_content = $content;
return $this;
}
public function getContent()
{
return $this->_content;
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: OutputInterface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: OutputInterface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,7 +27,7 @@
*/
interface Zend_Tool_Framework_Client_Interactive_OutputInterface
{
public function handleInteractiveOutput($string);
}

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: Request.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Request.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,47 +28,47 @@
*/
class Zend_Tool_Framework_Client_Request
{
/**
* @var string
*/
protected $_providerName = null;
/**
* @var string
*/
protected $_specialtyName = null;
/**
* @var string
*/
protected $_actionName = null;
/**
* @var array
*/
protected $_actionParameters = array();
/**
* @var array
*/
protected $_providerParameters = array();
/**
* @var bool
*/
protected $_isPretend = false;
/**
* @var bool
*/
protected $_isDebug = false;
/**
* @var bool
*/
protected $_isVerbose = false;
/**
* @var bool
*/
@ -85,7 +85,7 @@ class Zend_Tool_Framework_Client_Request
$this->_providerName = $providerName;
return $this;
}
/**
* getProviderName()
*
@ -95,7 +95,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_providerName;
}
/**
* setSpecialtyName()
*
@ -107,17 +107,17 @@ class Zend_Tool_Framework_Client_Request
$this->_specialtyName = $specialtyName;
return $this;
}
/**
* getSpecialtyName()
*
*
* @return string
*/
public function getSpecialtyName()
{
return $this->_specialtyName;
}
/**
* setActionName()
*
@ -126,10 +126,10 @@ class Zend_Tool_Framework_Client_Request
*/
public function setActionName($actionName)
{
$this->_actionName = $actionName;
$this->_actionName = $actionName;
return $this;
}
/**
* getActionName()
*
@ -139,7 +139,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_actionName;
}
/**
* setActionParameter()
*
@ -152,7 +152,7 @@ class Zend_Tool_Framework_Client_Request
$this->_actionParameters[$parameterName] = $parameterValue;
return $this;
}
/**
* getActionParameters()
*
@ -162,7 +162,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_actionParameters;
}
/**
* getActionParameter()
*
@ -173,7 +173,7 @@ class Zend_Tool_Framework_Client_Request
{
return (isset($this->_actionParameters[$parameterName])) ? $this->_actionParameters[$parameterName] : null;
}
/**
* setProviderParameter()
*
@ -186,7 +186,7 @@ class Zend_Tool_Framework_Client_Request
$this->_providerParameters[$parameterName] = $parameterValue;
return $this;
}
/**
* getProviderParameters()
*
@ -196,7 +196,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_providerParameters;
}
/**
* getProviderParameter()
*
@ -207,7 +207,7 @@ class Zend_Tool_Framework_Client_Request
{
return (isset($this->_providerParameters[$parameterName])) ? $this->_providerParameters[$parameterName] : null;
}
/**
* setPretend()
*
@ -219,7 +219,7 @@ class Zend_Tool_Framework_Client_Request
$this->_isPretend = (bool) $pretend;
return $this;
}
/**
* isPretend() - Whether or not this is a pretend request
*
@ -229,7 +229,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_isPretend;
}
/**
* setDebug()
*
@ -241,7 +241,7 @@ class Zend_Tool_Framework_Client_Request
$this->_isDebug = (bool) $debug;
return $this;
}
/**
* isDebug() - Whether or not this is a debug enabled request
*
@ -251,7 +251,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_isDebug;
}
/**
* setVerbose()
*
@ -263,7 +263,7 @@ class Zend_Tool_Framework_Client_Request
$this->_isVerbose = (bool) $verbose;
return $this;
}
/**
* isVerbose() - Whether or not this is a verbose enabled request
*
@ -273,7 +273,7 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_isVerbose;
}
/**
* setDispatchable()
*
@ -285,7 +285,7 @@ class Zend_Tool_Framework_Client_Request
$this->_isDispatchable = (bool) $dispatchable;
return $this;
}
/**
* isDispatchable() Is this request Dispatchable?
*
@ -295,5 +295,5 @@ class Zend_Tool_Framework_Client_Request
{
return $this->_isDispatchable;
}
}

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: Response.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Response.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -32,22 +32,22 @@ class Zend_Tool_Framework_Client_Response
* @var callback|null
*/
protected $_callback = null;
/**
* @var array
*/
protected $_content = array();
/**
* @var Zend_Tool_Framework_Exception
*/
protected $_exception = null;
/**
* @var null|array
*/
protected $_decorators = null;
/**
* @var array
*/
@ -68,7 +68,7 @@ class Zend_Tool_Framework_Client_Response
$this->_callback = $callback;
return $this;
}
/**
* setContent()
*
@ -78,7 +78,7 @@ class Zend_Tool_Framework_Client_Response
public function setContent($content, Array $decoratorOptions = array())
{
$this->_applyDecorators($content, $decoratorOptions);
$this->_content = array();
$this->appendContent($content);
return $this;
@ -93,7 +93,7 @@ class Zend_Tool_Framework_Client_Response
public function appendContent($content, Array $decoratorOptions = array())
{
$content = $this->_applyDecorators($content, $decoratorOptions);
if ($this->_callback !== null) {
call_user_func($this->_callback, $content);
}
@ -119,7 +119,7 @@ class Zend_Tool_Framework_Client_Response
$this->_defaultDecoratorOptions = array_merge($this->_defaultDecoratorOptions, $decoratorOptions);
return $this;
}
/**
* getContent()
*
@ -174,7 +174,7 @@ class Zend_Tool_Framework_Client_Response
$this->_decorators[$decoratorName] = $contentDecorator;
return $this;
}
/**
* getContentDecorators()
*
@ -184,7 +184,7 @@ class Zend_Tool_Framework_Client_Response
{
return $this->_decorators;
}
/**
* __toString() to cast to a string
*
@ -194,7 +194,7 @@ class Zend_Tool_Framework_Client_Response
{
return (string) implode('', $this->_content);
}
/**
* _applyDecorators() apply a group of decorators
*
@ -205,9 +205,9 @@ class Zend_Tool_Framework_Client_Response
protected function _applyDecorators($content, Array $decoratorOptions)
{
$options = array_merge($this->_defaultDecoratorOptions, $decoratorOptions);
$options = array_change_key_case($options, CASE_LOWER);
if ($options) {
foreach ($this->_decorators as $decoratorName => $decorator) {
if (array_key_exists($decoratorName, $options)) {
@ -215,9 +215,9 @@ class Zend_Tool_Framework_Client_Response
}
}
}
return $content;
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,9 +27,9 @@
*/
interface Zend_Tool_Framework_Client_Response_ContentDecorator_Interface
{
public function getName();
public function decorate($content, $decoratorValue);
}

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: Separator.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Separator.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,15 +31,15 @@ require_once 'Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Client_Response_ContentDecorator_Separator
implements Zend_Tool_Framework_Client_Response_ContentDecorator_Interface
class Zend_Tool_Framework_Client_Response_ContentDecorator_Separator
implements Zend_Tool_Framework_Client_Response_ContentDecorator_Interface
{
/**
* @var string
*/
protected $_separator = PHP_EOL;
/**
* getName() - name of the decorator
*
@ -61,7 +61,7 @@ class Zend_Tool_Framework_Client_Response_ContentDecorator_Separator
$this->_separator = $separator;
return $this;
}
/**
* getSeparator()
*
@ -71,23 +71,23 @@ class Zend_Tool_Framework_Client_Response_ContentDecorator_Separator
{
return $this->_separator;
}
public function decorate($content, $decoratorValue)
{
$run = 1;
if (is_bool($decoratorValue) && $decoratorValue === false) {
return $content;
}
if (is_int($decoratorValue)) {
$run = $decoratorValue;
}
for ($i = 0; $i < $run; $i++) {
$content .= $this->_separator;
}
return $content;
}
}

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: Storage.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: Storage.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,19 +33,19 @@ require_once 'Zend/Tool/Framework/Client/Storage/AdapterInterface.php';
*/
class Zend_Tool_Framework_Client_Storage
{
/**
* @var Zend_Tool_Framework_Client_Storage_AdapterInterface
*/
protected $_adapter = null;
public function __construct($options = array())
{
if (isset($options['adapter'])) {
$this->setAdapter($options['adapter']);
}
}
public function setAdapter($adapter)
{
if (is_string($adapter)) {
@ -55,29 +55,29 @@ class Zend_Tool_Framework_Client_Storage
}
$this->_adapter = $adapter;
}
public function isEnabled()
{
return ($this->_adapter instanceof Zend_Tool_Framework_Client_Storage_AdapterInterface);
}
public function put($name, $value)
{
if (!$this->_adapter) {
return false;
}
$this->_adapter->put($name, $value);
return $this;
}
public function get($name, $defaultValue = false)
{
if (!$this->_adapter) {
return false;
}
if ($this->_adapter->has($name)) {
return $this->_adapter->get($name);
} else {
@ -85,33 +85,33 @@ class Zend_Tool_Framework_Client_Storage
}
}
public function has($name)
{
if (!$this->_adapter) {
return false;
}
return $this->_adapter->has($name);
}
public function remove($name)
{
if (!$this->_adapter) {
return false;
}
$this->_adapter->remove($name);
return $this;
}
public function getStreamUri($name)
{
if (!$this->_adapter) {
return false;
}
return $this->_adapter->getStreamUri($name);
}
}

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: AdapterInterface.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: AdapterInterface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,15 +28,15 @@
*/
interface Zend_Tool_Framework_Client_Storage_AdapterInterface
{
public function put($name, $value);
public function get($name);
public function has($name);
public function remove($name);
public function getStreamUri($name);
}

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: Directory.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: Directory.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -32,11 +32,11 @@ require_once 'Zend/Tool/Framework/Client/Storage/AdapterInterface.php';
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Client_Storage_Directory
implements Zend_Tool_Framework_Client_Storage_AdapterInterface
implements Zend_Tool_Framework_Client_Storage_AdapterInterface
{
protected $_directoryPath = null;
public function __construct($directoryPath)
{
if (!file_exists($directoryPath)) {
@ -44,30 +44,30 @@ class Zend_Tool_Framework_Client_Storage_Directory
}
$this->_directoryPath = $directoryPath;
}
public function put($name, $value)
{
return file_put_contents($this->_directoryPath . DIRECTORY_SEPARATOR . $name, $value);
}
public function get($name)
{
return file_get_contents($this->_directoryPath . DIRECTORY_SEPARATOR . $name);
}
public function has($name)
{
return file_exists($this->_directoryPath . DIRECTORY_SEPARATOR . $name);
}
public function remove($name)
{
return unlink($this->_directoryPath . DIRECTORY_SEPARATOR . $name);
}
public function getStreamUri($name)
{
return $this->_directoryPath . DIRECTORY_SEPARATOR . $name;
}
}

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: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Exception.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,6 +31,6 @@ require_once 'Zend/Exception.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Exception extends Zend_Exception
class Zend_Tool_Framework_Exception extends Zend_Exception
{
}

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: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Abstract.php 19145 2009-11-20 22:08:36Z beberlei $
*/
/**
@ -37,17 +37,17 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
* @var Zend_Tool_Framework_Repository_Interface
*/
protected $_registry = null;
/**
* @var array
*/
private $_retrievedFiles = array();
/**
* @var array
*/
private $_loadedClasses = array();
/**
* _getFiles
*
@ -67,7 +67,7 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
$this->_registry = $registry;
return $this;
}
/**
* load() - called by the client initialize routine to load files
*
@ -76,14 +76,18 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
{
$this->_retrievedFiles = $this->getRetrievedFiles();
$this->_loadedClasses = array();
$manifestRegistry = $this->_registry->getManifestRepository();
$providerRegistry = $this->_registry->getProviderRepository();
$loadedClasses = array();
// loop through files and find the classes declared by loading the file
foreach ($this->_retrievedFiles as $file) {
if(is_dir($file)) {
continue;
}
$classesLoadedBefore = get_declared_classes();
$oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings
// should we lint the files here? i think so
@ -92,32 +96,32 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
$classesLoadedAfter = get_declared_classes();
$loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));
}
// loop through the loaded classes and ensure that
// loop through the loaded classes and ensure that
foreach ($loadedClasses as $loadedClass) {
// reflect class to see if its something we want to load
$reflectionClass = new ReflectionClass($loadedClass);
if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')
&& !$reflectionClass->isAbstract())
if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')
&& !$reflectionClass->isAbstract())
{
$manifestRegistry->addManifest($reflectionClass->newInstance());
$this->_loadedClasses[] = $loadedClass;
}
if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')
if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')
&& !$reflectionClass->isAbstract()
&& !$providerRegistry->hasProvider($reflectionClass->getName(), false))
&& !$providerRegistry->hasProvider($reflectionClass->getName(), false))
{
$providerRegistry->addProvider($reflectionClass->newInstance());
$this->_loadedClasses[] = $loadedClass;
}
}
return $this->_loadedClasses;
}
/**
* getRetrievedFiles()
*
@ -128,10 +132,10 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
if ($this->_retrievedFiles == null) {
$this->_retrievedFiles = $this->_getFiles();
}
return $this->_retrievedFiles;
}
/**
* getLoadedClasses()
*
@ -142,5 +146,5 @@ abstract class Zend_Tool_Framework_Loader_Abstract implements Zend_Tool_Framewor
return $this->_loadedClasses;
}
}

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: IncludePathLoader.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: IncludePathLoader.php 19145 2009-11-20 22:08:36Z beberlei $
*/
/**
@ -36,9 +36,9 @@ require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterat
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_Loader_Abstract
class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_Loader_Abstract
{
/**
* _getFiles()
*
@ -52,19 +52,19 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
$relativeItems = array();
$files = array();
$isZendTraversed = false;
foreach ($paths as $path) {
// default patterns to use
$filterDenyDirectoryPattern = '.*(/|\\\\).svn';
$filterAcceptFilePattern = '.*(?:Manifest|Provider)\.php$';
if (!file_exists($path) || $path[0] == '.') {
continue;
}
$realIncludePath = realpath($path);
// ensure that we only traverse a single version of Zend Framework on all include paths
if (file_exists($realIncludePath . '/Zend/Tool/Framework/Loader/IncludePathLoader.php')) {
if ($isZendTraversed === false) {
@ -74,10 +74,10 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
$filterDenyDirectoryPattern = '.*((/|\\\\).svn|' . preg_quote($realIncludePath . DIRECTORY_SEPARATOR) . 'Zend)';
}
}
// create recursive directory iterator
$rdi = new RecursiveDirectoryIterator($path);
// pass in the RecursiveDirectoryIterator & the patterns
$filter = new Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator(
$rdi,
@ -87,18 +87,22 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
// build the rii with the filter
$iterator = new RecursiveIteratorIterator($filter);
// iterate over the accepted items
foreach ($iterator as $item) {
$file = (string)$item;
if($this->_fileIsBlacklisted($file)) {
continue;
}
// ensure that the same named file from separate include_paths is not loaded
$relativeItem = preg_replace('#^' . preg_quote($realIncludePath . DIRECTORY_SEPARATOR, '#') . '#', '', $item->getRealPath());
// no links allowed here for now
if ($item->isLink()) {
continue;
}
// no items that are relavitely the same are allowed
if (in_array($relativeItem, $relativeItems)) {
continue;
@ -111,5 +115,24 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
return $files;
}
/**
*
* @param string $file
* @return bool
*/
protected function _fileIsBlacklisted($file)
{
$blacklist = array(
"PHPUnit".DIRECTORY_SEPARATOR."Framework",
"Zend".DIRECTORY_SEPARATOR."OpenId".DIRECTORY_SEPARATOR."Provider"
);
foreach($blacklist AS $blacklitedPattern) {
if(strpos($file, $blacklitedPattern) !== false) {
return true;
}
}
return false;
}
}

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: RecursiveFilterIterator.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: RecursiveFilterIterator.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,7 +31,7 @@ class Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator exten
protected $_denyDirectoryPattern = null;
protected $_acceptFilePattern = null;
/**
* constructor
*
@ -45,7 +45,7 @@ class Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator exten
$this->_acceptFilePattern = $acceptFilePattern;
parent::__construct($iterator);
}
/**
* accept() - Which iterable items to accept or deny, required by FilterInterface
*
@ -57,11 +57,11 @@ class Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator exten
$currentNodeRealPath = $currentNode->getRealPath();
// if the current node is a directory AND doesn't match the denyDirectory pattern, accept
if ($currentNode->isDir()
if ($currentNode->isDir()
&& !preg_match('#' . $this->_denyDirectoryPattern . '#', $currentNodeRealPath)) {
return true;
}
// if the file matches the accept file pattern, accept
$acceptable = (preg_match('#' . $this->_acceptFilePattern . '#', $currentNodeRealPath)) ? true : false;
return $acceptable;
@ -79,13 +79,13 @@ class Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator exten
if (empty($this->ref)) {
$this->ref = new ReflectionClass($this);
}
return $this->ref->newInstance(
$this->getInnerIterator()->getChildren(),
$this->_denyDirectoryPattern,
$this->_acceptFilePattern
);
}
}

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: ActionManifestable.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: ActionManifestable.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,12 +36,12 @@ interface Zend_Tool_Framework_Manifest_ActionManifestable extends Zend_Tool_Fram
/**
* getActions()
*
*
* Should either return a single action, or an array
* of actions
*
*
* @return array|Zend_Tool_Framework_Action_Interface
*/
public function getActions();
}

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: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Exception.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,5 +33,5 @@ require_once 'Zend/Tool/Framework/Exception.php';
*/
class Zend_Tool_Framework_Manifest_Exception extends Zend_Tool_Framework_Exception
{
}

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: Indexable.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Indexable.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,12 +31,12 @@ interface Zend_Tool_Framework_Manifest_Indexable extends Zend_Tool_Framework_Man
/**
* getActions()
*
*
* Should either return a single action, or an array
* of actions
*
*
* @return array|Zend_Tool_Framework_Action_Interface
*/
public function getIndex();
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,56 +27,56 @@
*/
interface Zend_Tool_Framework_Manifest_Interface
{
/**
* The following methods are completely optional, and any combination of them
* can be used as part of a manifest. The manifest repository will process
* the return values of these actions as specfied in the following method docblocks.
*
*
* Since these actions are
*
*
*/
/**
* getMetadata()
*
*
* Should either return a single metadata object or an array
* of metadata objects
*
*
* @return array|Zend_Tool_Framework_Manifest_Metadata
**
public function getMetadata();
**/
/**
* getActions()
*
*
* Should either return a single action, or an array
* of actions
*
*
* @return array|Zend_Tool_Framework_Action_Interface
**
public function getActions();
**/
/**
* getProviders()
*
*
* Should either return a single provider or an array
* of providers
*
*
**
public function getProviders();
**/
}

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: MetadataManifestable.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: MetadataManifestable.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,12 +36,12 @@ interface Zend_Tool_Framework_Manifest_MetadataManifestable extends Zend_Tool_Fr
/**
* getMetadata()
*
*
* Should either return a single metadata object or an array
* of metadata objects
*
*
* @return array|Zend_Tool_Framework_Manifest_Metadata
*/
*/
public function getMetadata();
}

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: ProviderManifestable.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: ProviderManifestable.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,12 +36,12 @@ interface Zend_Tool_Framework_Manifest_ProviderManifestable extends Zend_Tool_Fr
/**
* getProviders()
*
*
* Should either return a single provider or an array
* of providers
*
*
* @return array|string|Zend_Tool_Framework_Provider_Interface
*/
public function getProviders();
}

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: Repository.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Repository.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -39,7 +39,7 @@ class Zend_Tool_Framework_Manifest_Repository
* @var Zend_Tool_Framework_Provider_Registry_Interface
*/
protected $_registry = null;
/**
* @var array
*/
@ -61,7 +61,7 @@ class Zend_Tool_Framework_Manifest_Repository
$this->_registry = $registry;
return $this;
}
/**
* addManifest() - Add a manifest for later processing
*
@ -70,14 +70,14 @@ class Zend_Tool_Framework_Manifest_Repository
*/
public function addManifest(Zend_Tool_Framework_Manifest_Interface $manifest)
{
// we need to get an index number so that manifests with
// we need to get an index number so that manifests with
// higher indexes have priority over others
$index = count($this->_manifests);
if ($manifest instanceof Zend_Tool_Framework_Registry_EnabledInterface) {
$manifest->setRegistry($this->_registry);
}
// if the manifest supplies a getIndex() method, use it
if ($manifest instanceof Zend_Tool_Framework_Manifest_Indexable) {
$index = $manifest->getIndex();
@ -86,7 +86,7 @@ class Zend_Tool_Framework_Manifest_Repository
// get the required objects from the framework registry
$actionRepository = $this->_registry->getActionRepository();
$providerRepository = $this->_registry->getProviderRepository();
// load providers if interface supports that method
if ($manifest instanceof Zend_Tool_Framework_Manifest_ProviderManifestable) {
$providers = $manifest->getProviders();
@ -98,7 +98,7 @@ class Zend_Tool_Framework_Manifest_Repository
if (!$provider instanceof Zend_Tool_Framework_Provider_Interface) {
require_once 'Zend/Tool/Framework/Manifest/Exception.php';
throw new Zend_Tool_Framework_Manifest_Exception(
'A provider provided by the ' . get_class($manifest)
'A provider provided by the ' . get_class($manifest)
. ' does not implement Zend_Tool_Framework_Provider_Interface'
);
}
@ -127,7 +127,7 @@ class Zend_Tool_Framework_Manifest_Repository
// should we detect collisions here? does it even matter?
$this->_manifests[$index] = $manifest;
ksort($this->_manifests);
return $this;
}
@ -140,7 +140,7 @@ class Zend_Tool_Framework_Manifest_Repository
{
return $this->_manifests;
}
/**
* addMetadata() - add a metadata peice by peice
*
@ -152,10 +152,10 @@ class Zend_Tool_Framework_Manifest_Repository
$this->_metadatas[] = $metadata;
return $this;
}
/**
* process() - Process is expected to be called at the end of client construction time.
* By this time, the loader has run and loaded any found manifests into the repository
* By this time, the loader has run and loaded any found manifests into the repository
* for loading
*
* @return Zend_Tool_Framework_Manifest_Repository
@ -189,13 +189,13 @@ class Zend_Tool_Framework_Manifest_Repository
/**
* getMetadatas() - This is the main search function for the repository.
*
*
* @example This will retrieve all metadata that matches the following criteria
* $manifestRepo->getMetadatas(array(
* 'providerName' => 'Version',
* 'actionName' => 'show'
* ));
*
*
* @param array $searchProperties
* @param bool $includeNonExistentProperties
* @return Zend_Tool_Framework_Manifest_Metadata[]
@ -204,7 +204,7 @@ class Zend_Tool_Framework_Manifest_Repository
{
$returnMetadatas = array();
// loop through the metadatas so that we can search each individual one
foreach ($this->_metadatas as $metadata) {
@ -233,7 +233,7 @@ class Zend_Tool_Framework_Manifest_Repository
return $returnMetadatas;
}
/**
* getMetadata() - This will proxy to getMetadatas(), but will only return a single metadata. This method
* should be used in situations where the search criteria is known to only find a single metadata object
@ -276,7 +276,7 @@ class Zend_Tool_Framework_Manifest_Repository
return $string;
}
/**
* count() - required by the Countable Interface
*
@ -286,7 +286,7 @@ class Zend_Tool_Framework_Manifest_Repository
{
return count($this->_metadatas);
}
/**
* getIterator() - required by the IteratorAggregate interface
*

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: Basic.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Basic.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,14 +33,14 @@ require_once 'Zend/Tool/Framework/Metadata/Interface.php';
*/
class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata_Interface
{
/**#@+
* Search constants
*/
const ATTRIBUTES_ALL = 'attributesAll';
const ATTRIBUTES_NO_PARENT = 'attributesParent';
/**#@-*/
/**#@+
* @var string
*/
@ -48,7 +48,7 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
protected $_name = null;
protected $_value = null;
/**#@-*/
/**
* @var mixed
*/
@ -65,9 +65,9 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
$this->setOptions($options);
}
}
/**
* setOptions() - standard issue implementation, this will set any
* setOptions() - standard issue implementation, this will set any
* options that are supported via a set method.
*
* @param array $options
@ -81,23 +81,23 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
$this->{$setMethod}($optionValue);
}
}
return $this;
}
/**
* getType()
*
*
* @return string
*/
public function getType()
{
return $this->_type;
}
/**
* setType()
*
*
* @param string $type
* @return Zend_Tool_Framework_Metadata_Basic
*/
@ -109,17 +109,17 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
/**
* getName()
*
*
* @return string
*/
public function getName()
{
return $this->_name;
}
/**
* setName()
*
*
* @param string $name
* @return Zend_Tool_Framework_Metadata_Basic
*/
@ -128,20 +128,20 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
$this->_name = $name;
return $this;
}
/**
* getValue()
*
* getValue()
*
* @return mixed
*/
public function getValue()
{
return $this->_value;
}
/**
* setValue()
*
*
* @param unknown_type $Value
* @return Zend_Tool_Framework_Metadata_Basic
*/
@ -162,7 +162,7 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
$this->_reference = $reference;
return $this;
}
/**
* getReference()
*
@ -172,7 +172,7 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
{
return $this->_reference;
}
/**
* getAttributes() - this will retrieve any attributes of this object that exist as properties
* This is most useful for printing metadata.
@ -183,34 +183,34 @@ class Zend_Tool_Framework_Metadata_Basic implements Zend_Tool_Framework_Metadata
public function getAttributes($type = self::ATTRIBUTES_ALL, $stringRepresentationOfNonScalars = false)
{
$thisReflection = new ReflectionObject($this);
$metadataPairValues = array();
foreach (get_object_vars($this) as $varName => $varValue) {
if ($type == self::ATTRIBUTES_NO_PARENT && ($thisReflection->getProperty($varName)->getDeclaringClass()->getName() == 'Zend_Tool_Framework_Metadata_Basic')) {
continue;
}
if ($stringRepresentationOfNonScalars) {
if (is_object($varValue)) {
$varValue = '(object)';
}
if (is_null($varValue)) {
$varValue = '(null)';
}
}
$metadataPairValues[ltrim($varName, '_')] = $varValue;
}
return $metadataPairValues;
}
/**
* __toString() - string representation of this object
* __toString() - string representation of this object
*
* @return string
*/

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: Dynamic.php 17517 2009-08-10 13:52:31Z ralph $
* @version $Id: Dynamic.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,39 +33,39 @@ require_once 'Zend/Tool/Framework/Metadata/Interface.php';
*/
class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metadata_Interface
{
/**
* @var string
*/
protected $_type = 'Dynamic';
/**
* @var string
*/
protected $_name = null;
/**
* @var string
*/
protected $_value = null;
/**
* @var array
*/
protected $_dynamicAttributes = array();
/**
* getType()
*
*
* The type of metadata this describes
*
*
* @return string
*/
public function getType()
{
return $this->_type;
}
/**
* getName()
*
@ -77,10 +77,10 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
{
return $this->_name;
}
/**
* getValue()
*
*
* Metadata Value
*
* @return string
@ -89,11 +89,11 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
{
return $this->_value;
}
/**
* __isset()
*
*
* Check if an attrbute is set
*
* @param string $name
@ -103,7 +103,7 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
{
return isset($this->_dynamicAttributes[$name]);
}
/**
* __unset()
*
@ -115,7 +115,7 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
unset($this->_dynamicAttributes[$name]);
return;
}
/**
* __get() - Get a property via property call $metadata->foo
*
@ -133,7 +133,7 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this metadata.');
}
}
/**
* __set() - Set a property via the magic set $metadata->foo = 'foo'
*
@ -147,8 +147,8 @@ class Zend_Tool_Framework_Metadata_Dynamic implements Zend_Tool_Framework_Metada
return;
} else {
require_once 'Zend/Tool/Framework/Registry/Exception.php';
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');
}
}
}

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: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,25 +28,25 @@
*/
interface Zend_Tool_Framework_Metadata_Interface
{
/**
* getType()
*
*
* The type of metadata this describes
*
*/
public function getType();
/**
* getName()
*
*/
public function getName();
/**
* getValue()
*
*/
public function getValue();
}

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: Tool.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Tool.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,12 +33,12 @@ require_once 'Zend/Tool/Framework/Metadata/Basic.php';
*/
class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Basic
{
/**
* @var string
*/
protected $_type = 'Tool';
/**#@+
* @var string
*/
@ -47,7 +47,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
protected $_providerName = null;
protected $_specialtyName = null;
/**#@-*/
/**#@+
* @var string
*/
@ -61,12 +61,12 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
$this->_clientName = $clientName;
return $this;
}
public function getClientName()
{
return $this->_clientName;
}
/**
* setActionName()
*
@ -88,7 +88,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
{
return $this->_actionName;
}
/**
* setProviderName()
*
@ -144,7 +144,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
$this->_clientReference = $client;
return $this;
}
/**
* getClientReference()
*
@ -154,7 +154,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
{
return $this->_clientReference;
}
/**
* setActionReference()
*
@ -166,7 +166,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
$this->_actionReference = $action;
return $this;
}
/**
* getActionReference()
*
@ -176,7 +176,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
{
return $this->_actionReference;
}
/**
* setProviderReference()
*
@ -188,7 +188,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
$this->_providerReference = $provider;
return $this;
}
/**
* getProviderReference()
*
@ -198,7 +198,7 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
{
return $this->_providerReference;
}
/**
* __toString() cast to string
*
@ -207,11 +207,11 @@ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Bas
public function __toString()
{
$string = parent::__toString();
$string .= ' (ProviderName: ' . $this->_providerName
. ', ActionName: ' . $this->_actionName
. ', SpecialtyName: ' . $this->_specialtyName
$string .= ' (ProviderName: ' . $this->_providerName
. ', ActionName: ' . $this->_actionName
. ', SpecialtyName: ' . $this->_specialtyName
. ')';
return $string;
}

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: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,25 +33,25 @@ require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
/**
* This is a convenience class.
*
*
* At current it will return the request and response from the client registry
* as they are the more common things that will be needed by providers
*
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Tool_Framework_Provider_Abstract
abstract class Zend_Tool_Framework_Provider_Abstract
implements Zend_Tool_Framework_Provider_Interface, Zend_Tool_Framework_Registry_EnabledInterface
{
/**
* @var Zend_Tool_Framework_Registry_Interface
*/
protected $_registry = null;
/**
* setRegistry() - required by Zend_Tool_Framework_Registry_EnabledInterface
*
@ -63,6 +63,6 @@ abstract class Zend_Tool_Framework_Provider_Abstract
$this->_registry = $registry;
return $this;
}
}

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: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Exception.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Tool/Framework/Exception.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Provider_Exception extends Zend_Tool_Framework_Exception
class Zend_Tool_Framework_Provider_Exception extends Zend_Tool_Framework_Exception
{
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: Interactable.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Interactable.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -26,5 +26,5 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Tool_Framework_Provider_Interactable
{
{
}

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: Repository.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: Repository.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,25 +36,25 @@ require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Provider_Repository
class Zend_Tool_Framework_Provider_Repository
implements Zend_Tool_Framework_Registry_EnabledInterface, IteratorAggregate, Countable
{
/**
* @var Zend_Tool_Framework_Registry
*/
protected $_registry = null;
/**
* @var bool
*/
protected $_processOnAdd = false;
/**
* @var Zend_Tool_Framework_Provider_Interface[]
*/
protected $_unprocessedProviders = array();
/**
* @var Zend_Tool_Framework_Provider_Signature[]
*/
@ -64,7 +64,7 @@ class Zend_Tool_Framework_Provider_Repository
* @var array Array of Zend_Tool_Framework_Provider_Inteface
*/
protected $_providers = array();
/**
* setRegistry()
*
@ -76,7 +76,7 @@ class Zend_Tool_Framework_Provider_Repository
$this->_registry = $registry;
return $this;
}
/**
* Set the ProcessOnAdd flag
*
@ -88,7 +88,7 @@ class Zend_Tool_Framework_Provider_Repository
$this->_processOnAdd = (bool) $processOnAdd;
return $this;
}
/**
* Add a provider to the repository for processing
*
@ -100,30 +100,30 @@ class Zend_Tool_Framework_Provider_Repository
if ($provider instanceof Zend_Tool_Framework_Registry_EnabledInterface) {
$provider->setRegistry($this->_registry);
}
if (method_exists($provider, 'getName')) {
$providerName = $provider->getName();
} else {
$providerName = $this->_parseName($provider);
}
// if a provider by the given name already exist, and its not set as overwritable, throw exception
if (!$overwriteExistingProvider &&
(array_key_exists($providerName, $this->_unprocessedProviders)
|| array_key_exists($providerName, $this->_providers)))
if (!$overwriteExistingProvider &&
(array_key_exists($providerName, $this->_unprocessedProviders)
|| array_key_exists($providerName, $this->_providers)))
{
require_once 'Zend/Tool/Framework/Provider/Exception.php';
throw new Zend_Tool_Framework_Provider_Exception('A provider by the name ' . $providerName
throw new Zend_Tool_Framework_Provider_Exception('A provider by the name ' . $providerName
. ' is already registered and $overrideExistingProvider is set to false.');
}
$this->_unprocessedProviders[$providerName] = $provider;
// if process has already been called, process immediately.
if ($this->_processOnAdd) {
$this->process();
}
return $this;
}
@ -134,7 +134,7 @@ class Zend_Tool_Framework_Provider_Repository
} else {
$targetProviderClassName = (string) $providerOrClassName;
}
if (!$processedOnly) {
foreach ($this->_unprocessedProviders as $unprocessedProvider) {
if (get_class($unprocessedProvider) == $targetProviderClassName) {
@ -142,16 +142,16 @@ class Zend_Tool_Framework_Provider_Repository
}
}
}
foreach ($this->_providers as $processedProvider) {
if (get_class($processedProvider) == $targetProviderClassName) {
return true;
}
}
return false;
}
/**
* Process all of the unprocessed providers
*
@ -164,24 +164,24 @@ class Zend_Tool_Framework_Provider_Repository
// create a signature for the provided provider
$providerSignature = new Zend_Tool_Framework_Provider_Signature($provider);
if ($providerSignature instanceof Zend_Tool_Framework_Registry_EnabledInterface) {
$providerSignature->setRegistry($this->_registry);
}
$providerSignature->process();
// ensure the name is lowercased for easier searching
$providerName = strtolower($providerName);
// add to the appropraite place
$this->_providerSignatures[$providerName] = $providerSignature;
$this->_providers[$providerName] = $providerSignature->getProvider();
// remove from unprocessed array
unset($this->_unprocessedProviders[$providerName]);
}
}
/**
@ -203,7 +203,7 @@ class Zend_Tool_Framework_Provider_Repository
{
return $this->_providerSignatures;
}
/**
* getProvider()
*
@ -235,7 +235,7 @@ class Zend_Tool_Framework_Provider_Repository
{
return count($this->_providers);
}
/**
* getIterator() - Required by the IteratorAggregate Interface
*
@ -245,7 +245,7 @@ class Zend_Tool_Framework_Provider_Repository
{
return new ArrayIterator($this->getProviders());
}
/**
* _parseName - internal method to determine the name of an action when one is not explicity provided.
*

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: Signature.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Signature.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,9 +36,9 @@ require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
require_once 'Zend/Tool/Framework/Action/Base.php';
/**
* The purpose of Zend_Tool_Framework_Provider_Signature is to derive
* The purpose of Zend_Tool_Framework_Provider_Signature is to derive
* callable signatures from the provided provider.
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@ -51,27 +51,27 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
* @var Zend_Tool_Framework_Registry
*/
protected $_registry = null;
/**
* @var Zend_Tool_Framework_Provider_Interface
*/
protected $_provider = null;
/**
* @var string
*/
protected $_name = null;
/**
* @var array
*/
protected $_specialties = array();
/**
* @var array
*/
protected $_actionableMethods = array();
/**
* @var unknown_type
*/
@ -86,7 +86,7 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
* @var bool
*/
protected $_isProcessed = false;
/**
* Constructor
*
@ -109,16 +109,16 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
$this->_registry = $registry;
return $this;
}
public function process()
{
if ($this->_isProcessed) {
return;
}
$this->_process();
}
/**
* getName() of the provider
*
@ -148,7 +148,7 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
{
return $this->_providerReflection;
}
/**
* getSpecialities()
*
@ -161,14 +161,14 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
/**
* getActions()
*
*
* @return array Array of Actions
*/
public function getActions()
{
return $this->_actions;
}
/**
* getActionableMethods()
*
@ -180,7 +180,7 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
}
/**
* getActionableMethod() - Get an actionable method by name, this will return an array of
* getActionableMethod() - Get an actionable method by name, this will return an array of
* useful information about what can be exectued on this provider
*
* @param string $methodName
@ -191,12 +191,12 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
if (isset($this->_actionableMethods[$methodName])) {
return $this->_actionableMethods[$methodName];
}
return false;
}
/**
* getActionableMethodByActionName() - Get an actionable method by its action name, this
* getActionableMethodByActionName() - Get an actionable method by its action name, this
* will return an array of useful information about what can be exectued on this provider
*
* @param string $actionName
@ -296,21 +296,21 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi
* the following will determine what methods are actually actionable
* public, non-static, non-underscore prefixed, classes that dont
* contain the name "
*/
if (!$method->getDeclaringClass()->isInstantiable()
|| !$method->isPublic()
|| $methodName[0] == '_'
*/
if (!$method->getDeclaringClass()->isInstantiable()
|| !$method->isPublic()
|| $methodName[0] == '_'
|| $method->isStatic()
|| in_array($methodName, array('getContextClasses', 'getName')) // other protected public methods will nee to go here
) {
continue;
}
/**
* check to see if the method was a required method by a Zend_Tool_* interface
*/
foreach ($method->getDeclaringClass()->getInterfaces() as $methodDeclaringClassInterface) {
if (strpos($methodDeclaringClassInterface->getName(), 'Zend_Tool_') === 0
if (strpos($methodDeclaringClassInterface->getName(), 'Zend_Tool_') === 0
&& $methodDeclaringClassInterface->hasMethod($methodName)) {
continue 2;
}

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: Registry.php 16972 2009-07-22 18:44:24Z ralph $
* @version $Id: Registry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -37,47 +37,47 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
* @var Zend_Tool_Framework_Loader_Abstract
*/
protected $_loader = null;
/**
* @var Zend_Tool_Framework_Client_Abstract
*/
protected $_client = null;
/**
* @var Zend_Tool_Framework_Client_Config
*/
protected $_config = null;
/**
* @var Zend_Tool_Framework_Client_Storage
*/
protected $_storage = null;
/**
* @var Zend_Tool_Framework_Action_Repository
*/
protected $_actionRepository = null;
/**
* @var Zend_Tool_Framework_Provider_Repository
*/
protected $_providerRepository = null;
/**
* @var Zend_Tool_Framework_Manifest_Repository
*/
protected $_manifestRepository = null;
/**
* @var Zend_Tool_Framework_Client_Request
*/
protected $_request = null;
/**
* @var Zend_Tool_Framework_Client_Response
*/
protected $_response = null;
/**
* reset() - Reset all internal properties
*
@ -91,12 +91,12 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
unset($this->_request);
unset($this->_response);
}
// public function __construct()
// {
// // no instantiation from outside
// // no instantiation from outside
// }
/**
* Enter description here...
*
@ -111,7 +111,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
}
return $this;
}
/**
* getClient() return the client in the registry
*
@ -121,9 +121,9 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
{
return $this->_client;
}
/**
* setConfig()
* setConfig()
*
* @param Zend_Tool_Framework_Client_Config $config
* @return Zend_Tool_Framework_Registry
@ -133,7 +133,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
$this->_config = $config;
return $this;
}
/**
* getConfig()
*
@ -145,12 +145,12 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Client/Config.php';
$this->setConfig(new Zend_Tool_Framework_Client_Config());
}
return $this->_config;
}
/**
* setStorage()
* setStorage()
*
* @param Zend_Tool_Framework_Client_Storage $storage
* @return Zend_Tool_Framework_Registry
@ -160,7 +160,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
$this->_storage = $storage;
return $this;
}
/**
* getConfig()
*
@ -172,12 +172,12 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Client/Storage.php';
$this->setStorage(new Zend_Tool_Framework_Client_Storage());
}
return $this->_storage;
}
/**
* setLoader()
* setLoader()
*
* @param Zend_Tool_Framework_Loader_Abstract $loader
* @return Zend_Tool_Framework_Registry
@ -190,7 +190,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
}
return $this;
}
/**
* getLoader()
*
@ -202,10 +202,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Loader/IncludePathLoader.php';
$this->setLoader(new Zend_Tool_Framework_Loader_IncludePathLoader());
}
return $this->_loader;
}
/**
* setActionRepository()
*
@ -220,7 +220,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
}
return $this;
}
/**
* getActionRepository()
*
@ -232,10 +232,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Action/Repository.php';
$this->setActionRepository(new Zend_Tool_Framework_Action_Repository());
}
return $this->_actionRepository;
}
/**
* setProviderRepository()
*
@ -250,7 +250,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
}
return $this;
}
/**
* getProviderRepository()
*
@ -262,10 +262,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Provider/Repository.php';
$this->setProviderRepository(new Zend_Tool_Framework_Provider_Repository());
}
return $this->_providerRepository;
}
/**
* setManifestRepository()
*
@ -280,7 +280,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
}
return $this;
}
/**
* getManifestRepository()
*
@ -292,10 +292,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Manifest/Repository.php';
$this->setManifestRepository(new Zend_Tool_Framework_Manifest_Repository());
}
return $this->_manifestRepository;
}
/**
* setRequest()
*
@ -307,7 +307,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
$this->_request = $request;
return $this;
}
/**
* getRequest()
*
@ -319,10 +319,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Client/Request.php';
$this->setRequest(new Zend_Tool_Framework_Client_Request());
}
return $this->_request;
}
/**
* setResponse()
*
@ -346,10 +346,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Client/Response.php';
$this->setResponse(new Zend_Tool_Framework_Client_Response());
}
return $this->_response;
}
/**
* __get() - Get a property via property call $registry->foo
*
@ -365,7 +365,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');
}
}
/**
* __set() - Set a property via the magic set $registry->foo = 'foo'
*
@ -379,10 +379,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
return;
} else {
require_once 'Zend/Tool/Framework/Registry/Exception.php';
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');
throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');
}
}
/**
* isObjectRegistryEnablable() - Check whether an object is registry enablable
*
@ -395,10 +395,10 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Registry/Exception.php';
throw new Zend_Tool_Framework_Registry_Exception('isObjectRegistryEnablable() expects an object.');
}
return ($object instanceof Zend_Tool_Framework_Registry_EnabledInterface);
}
/**
* enableRegistryOnObject() - make an object registry enabled
*
@ -411,9 +411,9 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter
require_once 'Zend/Tool/Framework/Registry/Exception.php';
throw new Zend_Tool_Framework_Registry_Exception('Object provided is not registry enablable, check first with Zend_Tool_Framework_Registry::isObjectRegistryEnablable()');
}
$object->setRegistry($this);
return $this;
}
}

View File

@ -17,16 +17,16 @@
* @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: EnabledInterface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: EnabledInterface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
* This is a convenience class.
*
*
* At current it will return the request and response from the client registry
* as they are the more common things that will be needed by providers
*
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@ -34,7 +34,7 @@
*/
interface Zend_Tool_Framework_Registry_EnabledInterface
{
public function setRegistry(Zend_Tool_Framework_Registry_Interface $registry);
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Exception.php 18951 2009-11-12 16:26:19Z alexander $
*/
require_once 'Zend/Tool/Framework/Exception.php';
@ -27,7 +27,7 @@ require_once 'Zend/Tool/Framework/Exception.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Registry_Exception extends Zend_Tool_Framework_Exception
class Zend_Tool_Framework_Registry_Exception extends Zend_Tool_Framework_Exception
{
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -27,7 +27,7 @@
*/
interface Zend_Tool_Framework_Registry_Interface
{
/**
* setClient()
@ -36,29 +36,29 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Registry
*/
public function setClient(Zend_Tool_Framework_Client_Abstract $client);
/**
* getClient() return the client in the registry
*
* @return Zend_Tool_Framework_Client_Abstract
*/
public function getClient();
/**
* setLoader()
* setLoader()
*
* @param Zend_Tool_Framework_Loader_Abstract $loader
* @return Zend_Tool_Framework_Registry
*/
public function setLoader(Zend_Tool_Framework_Loader_Abstract $loader);
/**
* getLoader()
*
* @return Zend_Tool_Framework_Loader_Abstract
*/
public function getLoader();
/**
* setActionRepository()
*
@ -66,14 +66,14 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Registry
*/
public function setActionRepository(Zend_Tool_Framework_Action_Repository $actionRepository);
/**
* getActionRepository()
*
* @return Zend_Tool_Framework_Action_Repository
*/
public function getActionRepository();
/**
* setProviderRepository()
*
@ -81,14 +81,14 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Registry
*/
public function setProviderRepository(Zend_Tool_Framework_Provider_Repository $providerRepository);
/**
* getProviderRepository()
*
* @return Zend_Tool_Framework_Provider_Repository
*/
public function getProviderRepository();
/**
* setManifestRepository()
*
@ -96,14 +96,14 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Registry
*/
public function setManifestRepository(Zend_Tool_Framework_Manifest_Repository $manifestRepository);
/**
* getManifestRepository()
*
* @return Zend_Tool_Framework_Manifest_Repository
*/
public function getManifestRepository();
/**
* setRequest()
*
@ -111,14 +111,14 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Registry
*/
public function setRequest(Zend_Tool_Framework_Client_Request $request);
/**
* getRequest()
*
* @return Zend_Tool_Framework_Client_Request
*/
public function getRequest();
/**
* setResponse()
*
@ -133,5 +133,5 @@ interface Zend_Tool_Framework_Registry_Interface
* @return Zend_Tool_Framework_Client_Response
*/
public function getResponse();
}

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: Create.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Create.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,11 +28,11 @@ require_once 'Zend/Tool/Framework/Action/Base.php';
/**
* This is a convenience class.
*
*
* At current it will return the request and response from the client registry
* as they are the more common things that will be needed by providers
*
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@ -40,5 +40,5 @@ require_once 'Zend/Tool/Framework/Action/Base.php';
*/
class Zend_Tool_Framework_System_Action_Create extends Zend_Tool_Framework_Action_Base
{
}

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: Delete.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Delete.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -28,11 +28,11 @@ require_once 'Zend/Tool/Framework/Action/Base.php';
/**
* This is a convenience class.
*
*
* At current it will return the request and response from the client registry
* as they are the more common things that will be needed by providers
*
*
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@ -40,5 +40,5 @@ require_once 'Zend/Tool/Framework/Action/Base.php';
*/
class Zend_Tool_Framework_System_Action_Delete extends Zend_Tool_Framework_Action_Base
{
}

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: Manifest.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Manifest.php 18951 2009-11-12 16:26:19Z alexander $
*/
require_once 'Zend/Tool/Framework/Manifest/ProviderManifestable.php';
@ -34,7 +34,7 @@ require_once 'Zend/Tool/Framework/System/Action/Delete.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_System_Manifest
class Zend_Tool_Framework_System_Manifest
implements Zend_Tool_Framework_Manifest_ProviderManifestable, Zend_Tool_Framework_Manifest_ActionManifestable
{

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: Manifest.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Manifest.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,32 +36,32 @@ require_once 'Zend/Tool/Framework/Provider/Interface.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_System_Provider_Manifest
class Zend_Tool_Framework_System_Provider_Manifest
implements Zend_Tool_Framework_Provider_Interface, Zend_Tool_Framework_Registry_EnabledInterface
{
public function setRegistry(Zend_Tool_Framework_Registry_Interface $registry)
{
$this->_registry = $registry;
}
public function getName()
{
return 'Manifest';
}
public function show()
{
$manifestRepository = $this->_registry->getManifestRepository();
$response = $this->_registry->getResponse();
$metadataTree = array();
$longestAttrNameLen = 50;
foreach ($manifestRepository as $metadata) {
$metadataType = $metadata->getType();
$metadataName = $metadata->getName();
$metadataAttrs = $metadata->getAttributes('attributesParent');
@ -69,33 +69,33 @@ class Zend_Tool_Framework_System_Provider_Manifest
if (!$metadataAttrs) {
$metadataAttrs = '(None)';
} else {
$metadataAttrs = urldecode(http_build_query($metadataAttrs, null, ', '));
$metadataAttrs = urldecode(http_build_query($metadataAttrs, null, ', '));
}
if (!array_key_exists($metadataType, $metadataTree)) {
$metadataTree[$metadataType] = array();
}
if (!array_key_exists($metadataName, $metadataTree[$metadataType])) {
$metadataTree[$metadataType][$metadataName] = array();
}
if (!array_key_exists($metadataAttrs, $metadataTree[$metadataType][$metadataName])) {
$metadataTree[$metadataType][$metadataName][$metadataAttrs] = array();
}
$longestAttrNameLen = (strlen($metadataAttrs) > $longestAttrNameLen) ? strlen($metadataAttrs) : $longestAttrNameLen;
$metadataValue = $metadata->getValue();
if (is_array($metadataValue) && count($metadataValue) > 0) {
$metadataValue = urldecode(http_build_query($metadataValue, null, ', '));
} elseif (is_array($metadataValue)) {
$metadataValue = '(empty array)';
}
$metadataTree[$metadataType][$metadataName][$metadataAttrs][] = $metadataValue;
}
foreach ($metadataTree as $metadataType => $metadatasByName) {
$response->appendContent($metadataType);
foreach ($metadatasByName as $metadataName => $metadatasByAttributes) {
@ -109,6 +109,6 @@ class Zend_Tool_Framework_System_Provider_Manifest
}
}
}
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Tool
* @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.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Version.php 18951 2009-11-12 16:26:19Z alexander $
*/
require_once 'Zend/Tool/Framework/Registry.php';
@ -31,7 +31,7 @@ require_once 'Zend/Version.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_System_Provider_Version
class Zend_Tool_Framework_System_Provider_Version
implements Zend_Tool_Framework_Provider_Interface, Zend_Tool_Framework_Registry_EnabledInterface
{
@ -39,7 +39,7 @@ class Zend_Tool_Framework_System_Provider_Version
* @var Zend_Tool_Framework_Registry_Interface
*/
protected $_registry = null;
const MODE_MAJOR = 'major';
const MODE_MINOR = 'minor';
const MODE_MINI = 'mini';
@ -51,7 +51,7 @@ class Zend_Tool_Framework_System_Provider_Version
$this->_registry = $registry;
return $this;
}
/**
* Show Action
*