import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -0,0 +1,44 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Tool
* @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$
*/
/**
* @see Zend_Tool_Framework_Action_Base
*/
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)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_System_Action_Create extends Zend_Tool_Framework_Action_Base
{
}

View File

@ -0,0 +1,44 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Tool
* @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$
*/
/**
* @see Zend_Tool_Framework_Action_Base
*/
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)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_System_Action_Delete extends Zend_Tool_Framework_Action_Base
{
}

View File

@ -0,0 +1,61 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Tool
* @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$
*/
require_once 'Zend/Tool/Framework/Manifest/ProviderManifestable.php';
require_once 'Zend/Tool/Framework/Manifest/ActionManifestable.php';
require_once 'Zend/Tool/Framework/System/Provider/Version.php';
require_once 'Zend/Tool/Framework/System/Provider/Phpinfo.php';
require_once 'Zend/Tool/Framework/System/Provider/Manifest.php';
require_once 'Zend/Tool/Framework/System/Action/Create.php';
require_once 'Zend/Tool/Framework/System/Action/Delete.php';
/**
* @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_System_Manifest
implements Zend_Tool_Framework_Manifest_ProviderManifestable, Zend_Tool_Framework_Manifest_ActionManifestable
{
public function getProviders()
{
$providers = array(
new Zend_Tool_Framework_System_Provider_Version(),
new Zend_Tool_Framework_System_Provider_Phpinfo(),
new Zend_Tool_Framework_System_Provider_Manifest()
);
return $providers;
}
public function getActions()
{
$actions = array(
new Zend_Tool_Framework_System_Action_Create(),
new Zend_Tool_Framework_System_Action_Delete()
);
return $actions;
}
}

View File

@ -0,0 +1,114 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Tool
* @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$
*/
/**
* @see Zend_Tool_Framework_Registry_EnabledInterface
*/
require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';
/**
* @see Zend_Tool_Framework_Provider_Interface
*/
require_once 'Zend/Tool/Framework/Provider/Interface.php';
/**
* @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_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');
if (!$metadataAttrs) {
$metadataAttrs = '(None)';
} else {
$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) {
$response->appendContent(" " . $metadataName);
foreach ($metadatasByAttributes as $metadataAttributeName => $metadataValues) {
foreach ($metadataValues as $metadataValue) {
$string = sprintf(" %-{$longestAttrNameLen}.{$longestAttrNameLen}s : ", $metadataAttributeName)
. $metadataValue;
$response->appendContent($string);
}
}
}
}
}
}

View File

@ -0,0 +1,13 @@
<?php
require_once 'Zend/Tool/Framework/Provider/Interface.php';
class Zend_Tool_Framework_System_Provider_Phpinfo implements Zend_Tool_Framework_Provider_Interface
{
public function showAction()
{
phpinfo();
}
}

View File

@ -0,0 +1,88 @@
<?php
require_once 'Zend/Tool/Framework/Registry.php';
require_once 'Zend/Tool/Framework/Provider/Interface.php';
require_once 'Zend/Version.php';
/**
* Version Provider
*
*/
class Zend_Tool_Framework_System_Provider_Version
implements Zend_Tool_Framework_Provider_Interface, Zend_Tool_Framework_Registry_EnabledInterface
{
/**
* @var Zend_Tool_Framework_Registry_Interface
*/
protected $_registry = null;
const MODE_MAJOR = 'major';
const MODE_MINOR = 'minor';
const MODE_MINI = 'mini';
protected $_specialties = array('MajorPart', 'MinorPart', 'MiniPart');
public function setRegistry(Zend_Tool_Framework_Registry_Interface $registry)
{
$this->_registry = $registry;
return $this;
}
/**
* Show Action
*
* @param string $mode The mode switch can be one of: major, minor, or mini (default)
* @param bool $nameincluded
*/
public function show($mode = self::MODE_MINI, $nameIncluded = true)
{
$versionInfo = $this->_splitVersion();
switch($mode) {
case self::MODE_MINOR:
unset($versionInfo['mini']);
break;
case self::MODE_MAJOR:
unset($versionInfo['mini'], $versionInfo['minor']);
break;
}
$output = implode('.', $versionInfo);
if ($nameIncluded) {
$output = 'Zend Framework Version: ' . $output;
}
$this->_registry->response->appendContent($output);
}
public function showMajorPart($nameIncluded = true)
{
$versionNumbers = $this->_splitVersion();
$output = (($nameIncluded == true) ? 'ZF Major Version: ' : null) . $versionNumbers['major'];
$this->_registry->response->appendContent($output);
}
public function showMinorPart($nameIncluded = true)
{
$versionNumbers = $this->_splitVersion();
$output = (($nameIncluded == true) ? 'ZF Minor Version: ' : null) . $versionNumbers['minor'];
$this->_registry->response->appendContent($output);
}
public function showMiniPart($nameIncluded = true)
{
$versionNumbers = $this->_splitVersion();
$output = (($nameIncluded == true) ? 'ZF Mini Version: ' : null) . $versionNumbers['mini'];
$this->_registry->response->appendContent($output);
}
protected function _splitVersion()
{
list($major, $minor, $mini) = explode('.', Zend_Version::VERSION);
return array('major' => $major, 'minor' => $minor, 'mini' => $mini);
}
}