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: Module.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Module.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -46,7 +46,7 @@ require_once 'Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.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_Project_Provider_Module
class Zend_Tool_Project_Provider_Module
extends Zend_Tool_Project_Provider_Abstract
implements Zend_Tool_Framework_Provider_Pretendable
{
@ -58,45 +58,45 @@ class Zend_Tool_Project_Provider_Module
if ($targetModuleResource == null) {
$targetModuleResource = $profile->search('applicationDirectory');
$targetModuleEnabledResources = array(
'ControllersDirectory', 'ModelsDirectory', 'ViewsDirectory',
'ControllersDirectory', 'ModelsDirectory', 'ViewsDirectory',
'ViewScriptsDirectory', 'ViewHelpersDirectory', 'ViewFiltersDirectory'
);
}
// find the actual modules directory we will use to house our module
$modulesDirectory = $profile->search('modulesDirectory');
// if there is a module directory already, except
if ($modulesDirectory->search(array('moduleDirectory' => array('moduleName' => $moduleName)))) {
throw new Zend_Tool_Project_Provider_Exception('A module named "' . $moduleName . '" already exists.');
}
// create the module directory
$moduleDirectory = $modulesDirectory->createResource('moduleDirectory', array('moduleName' => $moduleName));
// create a context filter so that we can pull out only what we need from the module skeleton
$moduleContextFilterIterator = new Zend_Tool_Project_Profile_Iterator_ContextFilter(
$targetModuleResource,
$targetModuleResource,
array(
'denyNames' => array('ModulesDirectory', 'ViewControllerScriptsDirectory'),
'denyType' => 'Zend_Tool_Project_Context_Filesystem_File'
)
);
// the iterator for the module skeleton
$targetIterator = new RecursiveIteratorIterator($moduleContextFilterIterator, RecursiveIteratorIterator::SELF_FIRST);
// initialize some loop state information
$currentDepth = 0;
$parentResources = array();
$currentResource = $moduleDirectory;
// loop through the target module skeleton
foreach ($targetIterator as $targetSubResource) {
$depthDifference = $targetIterator->getDepth() - $currentDepth;
$currentDepth = $targetIterator->getDepth();
if ($depthDifference === 1) {
// if we went down into a child, make note
array_push($parentResources, $currentResource);
@ -114,7 +114,7 @@ class Zend_Tool_Project_Provider_Module
// get parameters for the newly created module resource
$params = $targetSubResource->getAttributes();
$currentChildResource = $currentResource->createResource($targetSubResource->getName(), $params);
// based of the provided list (Currently up top), enable specific resources
if (isset($targetModuleEnabledResources)) {
$currentChildResource->setEnabled(in_array($targetSubResource->getName(), $targetModuleEnabledResources));
@ -123,10 +123,10 @@ class Zend_Tool_Project_Provider_Module
}
}
return $moduleDirectory;
}
/**
* create()
*
@ -135,11 +135,11 @@ class Zend_Tool_Project_Provider_Module
public function create($name) //, $moduleProfile = null)
{
$this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION);
$resources = self::createResources($this->_loadedProfile, $name);
$response = $this->_registry->getResponse();
if ($this->_registry->getRequest()->isPretend()) {
$response->appendContent('I would create the following module and artifacts:');
foreach (new RecursiveIteratorIterator($resources, RecursiveIteratorIterator::SELF_FIRST) as $resource) {
@ -154,12 +154,12 @@ class Zend_Tool_Project_Provider_Module
$response->appendContent($resource->getContext()->getPath());
$resource->create();
}
// store changes to the profile
$this->_storeProfile();
}
}
}