adding zend project folders into old campcaster.

This commit is contained in:
naomiaro 2010-12-07 14:19:27 -05:00
parent 56abfaf28e
commit 7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions

View file

@ -0,0 +1,78 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: BootstrapFile.php 19643 2009-12-14 14:57:07Z ralph $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Tool_Project_Context_Zf_AbstractClassFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* getFullClassName()
*
* @param $localClassName
* @param $classContextName
*/
public function getFullClassName($localClassName, $classContextName = null)
{
// find the ApplicationDirectory OR ModuleDirectory
$currentResource = $this->_resource;
do {
$resourceName = $currentResource->getName();
if ($resourceName == 'ApplicationDirectory' || $resourceName == 'ModuleDirectory') {
$containingResource = $currentResource;
break;
}
} while ($currentResource instanceof Zend_Tool_Project_Profile_Resource
&& $currentResource = $currentResource->getParentResource());
$fullClassName = '';
// go find the proper prefix
if (isset($containingResource)) {
if ($containingResource->getName() == 'ApplicationDirectory') {
$prefix = $containingResource->getAttribute('classNamePrefix');
$fullClassName = $prefix;
} elseif ($containingResource->getName() == 'ModuleDirectory') {
$prefix = $containingResource->getAttribute('moduleName') . '_';
$fullClassName = $prefix;
}
}
if ($classContextName) {
$fullClassName .= rtrim($classContextName, '_') . '_';
}
$fullClassName .= $localClassName;
return $fullClassName;
}
}

View file

@ -0,0 +1,224 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ActionMethod.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Interface
*/
require_once 'Zend/Tool/Project/Context/Interface.php';
/**
* @see Zend_Reflection_File
*/
require_once 'Zend/Reflection/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ActionMethod implements Zend_Tool_Project_Context_Interface
{
/**
* @var Zend_Tool_Project_Profile_Resource
*/
protected $_resource = null;
/**
* @var Zend_Tool_Project_Profile_Resource
*/
protected $_controllerResource = null;
/**
* @var string
*/
protected $_controllerPath = '';
/**
* @var string
*/
protected $_actionName = null;
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ActionMethod
*/
public function init()
{
$this->_actionName = $this->_resource->getAttribute('actionName');
$this->_resource->setAppendable(false);
$this->_controllerResource = $this->_resource->getParentResource();
if (!$this->_controllerResource->getContext() instanceof Zend_Tool_Project_Context_Zf_ControllerFile) {
require_once 'Zend/Tool/Project/Context/Exception.php';
throw new Zend_Tool_Project_Context_Exception('ActionMethod must be a sub resource of a ControllerFile');
}
// make the ControllerFile node appendable so we can tack on the actionMethod.
$this->_resource->getParentResource()->setAppendable(true);
$this->_controllerPath = $this->_controllerResource->getContext()->getPath();
/*
* This code block is now commented, its doing to much for init()
*
if ($this->_controllerPath != '' && self::hasActionMethod($this->_controllerPath, $this->_actionName)) {
require_once 'Zend/Tool/Project/Context/Exception.php';
throw new Zend_Tool_Project_Context_Exception('An action named ' . $this->_actionName . 'Action already exists in this controller');
}
*/
return $this;
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'actionName' => $this->getActionName()
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ActionMethod';
}
/**
* setResource()
*
* @param Zend_Tool_Project_Profile_Resource $resource
* @return Zend_Tool_Project_Context_Zf_ActionMethod
*/
public function setResource(Zend_Tool_Project_Profile_Resource $resource)
{
$this->_resource = $resource;
return $this;
}
/**
* setActionName()
*
* @param string $actionName
* @return Zend_Tool_Project_Context_Zf_ActionMethod
*/
public function setActionName($actionName)
{
$this->_actionName = $actionName;
return $this;
}
/**
* getActionName()
*
* @return string
*/
public function getActionName()
{
return $this->_actionName;
}
/**
* create()
*
* @return Zend_Tool_Project_Context_Zf_ActionMethod
*/
public function create()
{
if (self::createActionMethod($this->_controllerPath, $this->_actionName) === false) {
require_once 'Zend/Tool/Project/Context/Exception.php';
throw new Zend_Tool_Project_Context_Exception(
'Could not create action within controller ' . $this->_controllerPath
. ' with action name ' . $this->_actionName
);
}
return $this;
}
/**
* delete()
*
* @return Zend_Tool_Project_Context_Zf_ActionMethod
*/
public function delete()
{
// @todo do this
return $this;
}
/**
* createAcionMethod()
*
* @param string $controllerPath
* @param string $actionName
* @param string $body
* @return true
*/
public static function createActionMethod($controllerPath, $actionName, $body = ' // action body')
{
if (!file_exists($controllerPath)) {
return false;
}
$controllerCodeGenFile = Zend_CodeGenerator_Php_File::fromReflectedFileName($controllerPath, true, true);
$controllerCodeGenFile->getClass()->setMethod(array(
'name' => $actionName . 'Action',
'body' => $body
));
file_put_contents($controllerPath, $controllerCodeGenFile->generate());
return true;
}
/**
* hasActionMethod()
*
* @param string $controllerPath
* @param string $actionName
* @return bool
*/
public static function hasActionMethod($controllerPath, $actionName)
{
if (!file_exists($controllerPath)) {
return false;
}
$controllerCodeGenFile = Zend_CodeGenerator_Php_File::fromReflectedFileName($controllerPath, true, true);
return $controllerCodeGenFile->getClass()->hasMethod($actionName . 'Action');
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ApisDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ApisDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'apis';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ApisDirectory';
}
}

View file

@ -0,0 +1,283 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ApplicationConfigFile.php 20967 2010-02-07 18:17:49Z ralph $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ApplicationConfigFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'application.ini';
/**
* @var string
*/
protected $_content = null;
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ApplicationConfigFile';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ApplicationConfigFile
*/
public function init()
{
$this->_type = $this->_resource->getAttribute('type');
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return array
*/
public function getPersistentAttributes()
{
return array('type' => $this->_type);
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
if ($this->_content === null) {
if (file_exists($this->getPath())) {
$this->_content = file_get_contents($this->getPath());
} else {
$this->_content = $this->_getDefaultContents();
}
}
return $this->_content;
}
public function getAsZendConfig($section = 'production')
{
return new Zend_Config_Ini($this->getPath(), $section);
}
/**
* addStringItem()
*
* @param string $key
* @param string $value
* @param string $section
* @param bool $quoteValue
* @return Zend_Tool_Project_Context_Zf_ApplicationConfigFile
*/
public function addStringItem($key, $value, $section = 'production', $quoteValue = true)
{
// null quote value means to auto-detect
if ($quoteValue === null) {
$quoteValue = preg_match('#[\"\']#', $value) ? false : true;
}
if ($quoteValue == true) {
$value = '"' . $value . '"';
}
$contentLines = preg_split('#[\n\r]#', $this->getContents());
$newLines = array();
$insideSection = false;
foreach ($contentLines as $contentLineIndex => $contentLine) {
if ($insideSection === false && preg_match('#^\[' . $section . '#', $contentLine)) {
$insideSection = true;
}
if ($insideSection) {
// if its blank, or a section heading
if ((trim($contentLine) == null) || (isset($contentLines[$contentLineIndex + 1]{0}) && $contentLines[$contentLineIndex + 1]{0} == '[')) {
$newLines[] = $key . ' = ' . $value;
$insideSection = null;
}
}
$newLines[] = $contentLine;
}
$this->_content = implode("\n", $newLines);
return $this;
}
/**
*
* @param array $item
* @param string $section
* @param bool $quoteValue
* @return Zend_Tool_Project_Context_Zf_ApplicationConfigFile
*/
public function addItem($item, $section = 'production', $quoteValue = true)
{
$stringItems = array();
$stringValues = array();
$configKeyNames = array();
$rii = new RecursiveIteratorIterator(
new RecursiveArrayIterator($item),
RecursiveIteratorIterator::SELF_FIRST
);
$lastDepth = 0;
// loop through array structure recursively to create proper keys
foreach ($rii as $name => $value) {
$lastDepth = $rii->getDepth();
if (is_array($value)) {
array_push($configKeyNames, $name);
} else {
$stringItems[] = implode('.', $configKeyNames) . '.' . $name;
$stringValues[] = $value;
}
}
foreach ($stringItems as $stringItemIndex => $stringItem) {
$this->addStringItem($stringItem, $stringValues[$stringItemIndex], $section, $quoteValue);
}
return $this;
}
public function removeStringItem($key, $section = 'production')
{
$contentLines = file($this->getPath());
$newLines = array();
$insideSection = false;
foreach ($contentLines as $contentLineIndex => $contentLine) {
if ($insideSection === false && preg_match('#^\[' . $section . '#', $contentLine)) {
$insideSection = true;
}
if ($insideSection) {
// if its blank, or a section heading
if ((trim($contentLine) == null) || ($contentLines[$contentLineIndex + 1][0] == '[')) {
$insideSection = null;
}
}
if (!preg_match('#' . $key . '\s?=.*#', $contentLine)) {
$newLines[] = $contentLine;
}
}
$this->_content = implode('', $newLines);
}
public function removeItem($item, $section = 'production')
{
$stringItems = array();
$stringValues = array();
$configKeyNames = array();
$rii = new RecursiveIteratorIterator(
new RecursiveArrayIterator($item),
RecursiveIteratorIterator::SELF_FIRST
);
$lastDepth = 0;
// loop through array structure recursively to create proper keys
foreach ($rii as $name => $value) {
$lastDepth = $rii->getDepth();
if (is_array($value)) {
array_push($configKeyNames, $name);
} else {
$stringItems[] = implode('.', $configKeyNames) . '.' . $name;
$stringValues[] = $value;
}
}
foreach ($stringItems as $stringItemIndex => $stringItem) {
$this->removeStringItem($stringItem, $section);
}
return $this;
}
protected function _getDefaultContents()
{
$contents =<<<EOS
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
EOS;
return $contents;
}
}

View file

@ -0,0 +1,81 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ApplicationDirectory.php 20967 2010-02-07 18:17:49Z ralph $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ApplicationDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
protected $_filesystemName = 'application';
protected $_classNamePrefix = 'Application_';
public function init()
{
if ($this->_resource->hasAttribute('classNamePrefix')) {
$this->_classNamePrefix = $this->_resource->getAttribute('classNamePrefix');
}
parent::init();
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'classNamePrefix' => $this->getClassNamePrefix()
);
}
public function getName()
{
return 'ApplicationDirectory';
}
public function setClassNamePrefix($classNamePrefix)
{
$this->_classNamePrefix = $classNamePrefix;
}
public function getClassNamePrefix()
{
return $this->_classNamePrefix;
}
}

View file

@ -0,0 +1,119 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: BootstrapFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_BootstrapFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'Bootstrap.php';
/**
* @var Zend_Tool_Project_Profile_Resource
*/
protected $_applicationConfigFile = null;
/**
* @var Zend_Tool_Project_Profile_Resource
*/
protected $_applicationDirectory = null;
/**
* @var Zend_Application
*/
protected $_applicationInstance = null;
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'BootstrapFile';
}
public function init()
{
parent::init();
$this->_applicationConfigFile = $this->_resource->getProfile()->search('ApplicationConfigFile');
$this->_applicationDirectory = $this->_resource->getProfile()->search('ApplicationDirectory');
if (($this->_applicationConfigFile === false) || ($this->_applicationDirectory === false)) {
throw new Exception('To use the BootstrapFile context, your project requires the use of both the "ApplicationConfigFile" and "ApplicationDirectory" contexts.');
}
}
/**
* getContents()
*
* @return array
*/
public function getContents()
{
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => 'Bootstrap',
'extendedClass' => 'Zend_Application_Bootstrap_Bootstrap',
)),
)
));
return $codeGenFile->generate();
}
public function getApplicationInstance()
{
if ($this->_applicationInstance == null) {
if ($this->_applicationConfigFile->getContext()->exists()) {
define('APPLICATION_PATH', $this->_applicationDirectory->getPath());
$applicationOptions = array();
$applicationOptions['config'] = $this->_applicationConfigFile->getPath();
$this->_applicationInstance = new Zend_Application(
'development',
$applicationOptions
);
}
}
return $this->_applicationInstance;
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: CacheDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_CacheDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'cache';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'CacheDirectory';
}
}

View file

@ -0,0 +1,67 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ConfigFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ConfigFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'bootstrap.php';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ConfigFile';
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
return '';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ConfigsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ConfigsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'configs';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ConfigsDirectory';
}
}

View file

@ -0,0 +1,214 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ControllerFile.php 20247 2010-01-12 21:38:15Z dasprid $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ControllerFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_controllerName = 'index';
/**
* @var string
*/
protected $_moduleName = null;
/**
* @var string
*/
protected $_filesystemName = 'controllerName';
/**
* init()
*
*/
public function init()
{
$this->_controllerName = $this->_resource->getAttribute('controllerName');
$this->_moduleName = $this->_resource->getAttribute('moduleName');
$this->_filesystemName = ucfirst($this->_controllerName) . 'Controller.php';
parent::init();
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'controllerName' => $this->getControllerName()
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ControllerFile';
}
/**
* getControllerName()
*
* @return string
*/
public function getControllerName()
{
return $this->_controllerName;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$className = ($this->_moduleName) ? ucfirst($this->_moduleName) . '_' : '';
$className .= ucfirst($this->_controllerName) . 'Controller';
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'fileName' => $this->getPath(),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'Zend_Controller_Action',
'methods' => array(
new Zend_CodeGenerator_Php_Method(array(
'name' => 'init',
'body' => '/* Initialize action controller here */',
))
)
))
)
));
if ($className == 'ErrorController') {
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'fileName' => $this->getPath(),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'Zend_Controller_Action',
'methods' => array(
new Zend_CodeGenerator_Php_Method(array(
'name' => 'errorAction',
'body' => <<<EOS
\$errors = \$this->_getParam('error_handler');
switch (\$errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
\$this->getResponse()->setHttpResponseCode(404);
\$this->view->message = 'Page not found';
break;
default:
// application error
\$this->getResponse()->setHttpResponseCode(500);
\$this->view->message = 'Application error';
break;
}
// Log exception, if logger available
if (\$log = \$this->getLog()) {
\$log->crit(\$this->view->message, \$errors->exception);
}
// conditionally display exceptions
if (\$this->getInvokeArg('displayExceptions') == true) {
\$this->view->exception = \$errors->exception;
}
\$this->view->request = \$errors->request;
EOS
)),
new Zend_CodeGenerator_Php_Method(array(
'name' => 'getLog',
'body' => <<<EOS
\$bootstrap = \$this->getInvokeArg('bootstrap');
if (!\$bootstrap->hasPluginResource('Log')) {
return false;
}
\$log = \$bootstrap->getResource('Log');
return \$log;
EOS
)),
)
))
)
));
}
// store the generator into the registry so that the addAction command can use the same object later
Zend_CodeGenerator_Php_File::registerFileCodeGenerator($codeGenFile); // REQUIRES filename to be set
return $codeGenFile->generate();
}
/**
* addAction()
*
* @param string $actionName
*/
public function addAction($actionName)
{
$classCodeGen = $this->getCodeGenerator();
$classCodeGen->setMethod(array('name' => $actionName . 'Action', 'body' => ' // action body here'));
file_put_contents($this->getPath(), $classCodeGen->generate());
}
/**
* getCodeGenerator()
*
* @return Zend_CodeGenerator_Php_Class
*/
public function getCodeGenerator()
{
$codeGenFile = Zend_CodeGenerator_Php_File::fromReflectedFileName($this->getPath());
$codeGenFileClasses = $codeGenFile->getClasses();
$class = array_shift($codeGenFileClasses);
return $class;
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ControllersDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ControllersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'controllers';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ControllersDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DataDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_DataDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'data';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'DataDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DbTableDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_DbTableDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'DbTable';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'DbTableDirectory';
}
}

View file

@ -0,0 +1,92 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DbTableFile.php 20967 2010-02-07 18:17:49Z ralph $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_DbTableFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile
{
protected $_dbTableName = null;
protected $_actualTableName = null;
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'DbTableFile';
}
/**
* init()
*
*/
public function init()
{
$this->_dbTableName = $this->_resource->getAttribute('dbTableName');
$this->_actualTableName = $this->_resource->getAttribute('actualTableName');
$this->_filesystemName = ucfirst($this->_dbTableName) . '.php';
parent::init();
}
public function getPersistentAttributes()
{
return array('dbTableName' => $this->_dbTableName);
}
public function getContents()
{
$className = $this->getFullClassName($this->_dbTableName, 'Model_DbTable');
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'fileName' => $this->getPath(),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'Zend_Db_Table_Abstract',
'properties' => array(
new Zend_CodeGenerator_Php_Property(array(
'name' => '_name',
'visibility' => Zend_CodeGenerator_Php_Property::VISIBILITY_PROTECTED,
'defaultValue' => $this->_actualTableName
))
),
))
)
));
return $codeGenFile->generate();
}
}

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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DataDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_DocsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'docs';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'DocsDirectory';
}
public function create(){
parent::create();
}
}

View file

@ -0,0 +1,108 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FormFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_FormFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile
{
/**
* @var string
*/
protected $_formName = 'Base';
/**
* @var string
*/
protected $_filesystemName = 'formName';
/**
* init()
*
*/
public function init()
{
$this->_formName = $this->_resource->getAttribute('formName');
$this->_filesystemName = ucfirst($this->_formName) . '.php';
parent::init();
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'formName' => $this->getFormName()
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'FormFile';
}
public function getFormName()
{
return $this->_formName;
}
public function getContents()
{
$className = $this->getFullClassName($this->_formName, 'Form');
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'fileName' => $this->getPath(),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'Zend_Form',
'methods' => array(
new Zend_CodeGenerator_Php_Method(array(
'name' => 'init',
'body' => '/* Form Elements & Other Definitions Here ... */',
))
)
))
)
));
return $codeGenFile->generate();
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FormsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_FormsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'forms';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'FormsDirectory';
}
}

View file

@ -0,0 +1,77 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: HtaccessFile.php 20969 2010-02-07 18:20:02Z ralph $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_HtaccessFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = '.htaccess';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'HtaccessFile';
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$output = <<<EOS
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
EOS;
return $output;
}
}

View file

@ -0,0 +1,109 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewScriptFile.php 18386 2009-09-23 20:44:43Z ralph $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LayoutScriptFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'layout.phtml';
/**
* @var string
*/
protected $_layoutName = null;
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LayoutScriptFile';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ViewScriptFile
*/
public function init()
{
if ($layoutName = $this->_resource->getAttribute('layoutName')) {
$this->_layoutName = $layoutName;
} else {
throw new Exception('Either a forActionName or scriptName is required.');
}
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return unknown
*/
public function getPersistentAttributes()
{
$attributes = array();
if ($this->_layoutName) {
$attributes['layoutName'] = $this->_layoutName;
}
return $attributes;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$contents = <<<EOS
<?php echo \$this->layout()->content; ?>
EOS;
return $contents;
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewScriptsDirectory.php 18386 2009-09-23 20:44:43Z ralph $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LayoutScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'scripts';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LayoutScriptsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: LayoutsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LayoutsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'layouts';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LayoutsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: LibraryDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'library';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LibraryDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: LocalesDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LocalesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'locales';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LocalesDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: LogsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_LogsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'logs';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'LogsDirectory';
}
}

View file

@ -0,0 +1,102 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ModelFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ModelFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile
{
/**
* @var string
*/
protected $_modelName = 'Base';
/**
* @var string
*/
protected $_filesystemName = 'modelName';
/**
* init()
*
*/
public function init()
{
$this->_modelName = $this->_resource->getAttribute('modelName');
$this->_filesystemName = ucfirst($this->_modelName) . '.php';
parent::init();
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'modelName' => $this->getModelName()
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ModelFile';
}
public function getModelName()
{
return $this->_modelName;
}
public function getContents()
{
$className = $this->getFullClassName($this->_modelName, 'Model');
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'fileName' => $this->getPath(),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
))
)
));
return $codeGenFile->generate();
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ModelsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ModelsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'models';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ModelsDirectory';
}
}

View file

@ -0,0 +1,97 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ModuleDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ModuleDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_moduleName = null;
/**
* @var string
*/
protected $_filesystemName = 'moduleDirectory';
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ControllerFile
*/
public function init()
{
$this->_filesystemName = $this->_moduleName = $this->_resource->getAttribute('moduleName');
parent::init();
return $this;
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ModuleDirectory';
}
/**
* getPersistentAttributes
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'moduleName' => $this->getModuleName()
);
}
/**
* getModuleName()
*
* @return string
*/
public function getModuleName()
{
return $this->_moduleName;
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ModulesDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ModulesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'modules';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'modulesDirectory';
}
}

View file

@ -0,0 +1,152 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ProjectProviderFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* @see Zend_CodeGenerator_Php_File
*/
require_once 'Zend/CodeGenerator/Php/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ProjectProviderFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_projectProviderName = null;
/**
* @var array
*/
protected $_actionNames = array();
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ProjectProviderFile
*/
public function init()
{
$this->_projectProviderName = $this->_resource->getAttribute('projectProviderName');
$this->_actionNames = $this->_resource->getAttribute('actionNames');
$this->_filesystemName = ucfirst($this->_projectProviderName) . 'Provider.php';
if (strpos($this->_actionNames, ',')) {
$this->_actionNames = explode(',', $this->_actionNames);
} else {
$this->_actionNames = ($this->_actionNames) ? array($this->_actionNames) : array();
}
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'projectProviderName' => $this->getProjectProviderName(),
'actionNames' => implode(',', $this->_actionNames)
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ProjectProviderFile';
}
/**
* getProjectProviderName()
*
* @return string
*/
public function getProjectProviderName()
{
return $this->_projectProviderName;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$filter = new Zend_Filter_Word_DashToCamelCase();
$className = $filter->filter($this->_projectProviderName) . 'Provider';
$class = new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'Zend_Tool_Project_Provider_Abstract'
));
$methods = array();
foreach ($this->_actionNames as $actionName) {
$methods[] = new Zend_CodeGenerator_Php_Method(array(
'name' => $actionName,
'body' => ' /** @todo Implementation */'
));
}
if ($methods) {
$class->setMethods($methods);
}
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'requiredFiles' => array(
'Zend/Tool/Project/Provider/Abstract.php',
'Zend/Tool/Project/Provider/Exception.php'
),
'classes' => array($class)
));
return $codeGenFile->generate();
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PublicDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_PublicDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'public';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'PublicDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PublicImagesDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_PublicImagesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'images';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'PublicImagesDirectory';
}
}

View file

@ -0,0 +1,95 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PublicIndexFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_PublicIndexFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'index.php';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'PublicIndexFile';
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$codeGenerator = new Zend_CodeGenerator_Php_File(array(
'body' => <<<EOS
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
\$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
\$application->bootstrap()
->run();
EOS
));
return $codeGenerator->generate();
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PublicScriptsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_PublicScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'js';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'PublicScriptsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PublicStylesheetsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_PublicStylesheetsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'styles';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'PublicStylesheetsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SearchIndexesDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_SearchIndexesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'search-indexes';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'SearchIndexesDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SessionsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_SessionsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'sessions';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'SessionsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TemporaryDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TemporaryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'temp';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TemporaryDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestApplicationBootstrapFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestApplicationBootstrapFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'bootstrap.php';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestApplicationBootstrapFile';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestApplicationControllerDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestApplicationControllerDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'controllers';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestApplicationControllerDirectory';
}
}

View file

@ -0,0 +1,107 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestApplicationControllerFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestApplicationControllerFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_forControllerName = '';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestApplicationControllerFile';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_TestApplicationControllerFile
*/
public function init()
{
$this->_forControllerName = $this->_resource->getAttribute('forControllerName');
$this->_filesystemName = ucfirst($this->_forControllerName) . 'ControllerTest.php';
parent::init();
return $this;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$filter = new Zend_Filter_Word_DashToCamelCase();
$className = $filter->filter($this->_forControllerName) . 'ControllerTest';
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'requiredFiles' => array(
'PHPUnit/Framework/TestCase.php'
),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'PHPUnit_Framework_TestCase',
'methods' => array(
new Zend_CodeGenerator_Php_Method(array(
'name' => 'setUp',
'body' => ' /* Setup Routine */'
)),
new Zend_CodeGenerator_Php_Method(array(
'name' => 'tearDown',
'body' => ' /* Tear Down Routine */'
))
)
))
)
));
return $codeGenFile->generate();
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestApplicationDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestApplicationDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'application';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestApplicationDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestLibraryBootstrapFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestLibraryBootstrapFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'bootstrap.php';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestLibraryBootstrapFile';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestLibraryDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestLibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'library';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestLibraryDirectory';
}
}

View file

@ -0,0 +1,107 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestLibraryFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestLibraryFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_forClassName = '';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestLibraryFile';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_TestLibraryFile
*/
public function init()
{
$this->_forClassName = $this->_resource->getAttribute('forClassName');
$this->_filesystemName = ucfirst(ltrim(strrchr($this->_forClassName, '_'), '_')) . 'Test.php';
parent::init();
return $this;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$filter = new Zend_Filter_Word_DashToCamelCase();
$className = $filter->filter($this->_forClassName) . 'Test';
$codeGenFile = new Zend_CodeGenerator_Php_File(array(
'requiredFiles' => array(
'PHPUnit/Framework/TestCase.php'
),
'classes' => array(
new Zend_CodeGenerator_Php_Class(array(
'name' => $className,
'extendedClass' => 'PHPUnit_Framework_TestCase',
'methods' => array(
new Zend_CodeGenerator_Php_Method(array(
'name' => 'setUp',
'body' => ' /* Setup Routine */'
)),
new Zend_CodeGenerator_Php_Method(array(
'name' => 'tearDown',
'body' => ' /* Tear Down Routine */'
))
)
))
)
));
return $codeGenFile->generate();
}
}

View file

@ -0,0 +1,88 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestLibraryNamespaceDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestLibraryNamespaceDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_namespaceName = '';
/**
* @var string
*/
protected $_filesystemName = 'library';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestLibraryNamespaceDirectory';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_TestLibraryNamespaceDirectory
*/
public function init()
{
$this->_namespaceName = $this->_resource->getAttribute('namespaceName');
$this->_filesystemName = $this->_namespaceName;
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return array
*/
public function getPersistentAttributes()
{
$attributes = array();
$attributes['namespaceName'] = $this->_namespaceName;
return $attributes;
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestPHPUnitConfigFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestPHPUnitConfigFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'phpunit.xml';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestPHPUnitConfigFile';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TestsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_TestsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'tests';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'TestsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: UploadsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_UploadsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'uploads';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'UploadsDirectory';
}
}

View file

@ -0,0 +1,95 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewControllerScriptsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewControllerScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'controllerName';
/**
* @var name
*/
protected $_forControllerName = null;
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ViewControllerScriptsDirectory
*/
public function init()
{
$this->_forControllerName = $this->_resource->getAttribute('forControllerName');
$this->_filesystemName = $this->_convertControllerNameToFilesystemName($this->_forControllerName);
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return array
*/
public function getPersistentAttributes()
{
return array(
'forControllerName' => $this->_forControllerName
);
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewControllerScriptsDirectory';
}
protected function _convertControllerNameToFilesystemName($controllerName)
{
$filter = new Zend_Filter();
$filter->addFilter(new Zend_Filter_Word_CamelCaseToDash())
->addFilter(new Zend_Filter_StringToLower());
return $filter->filter($controllerName);
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewFiltersDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewFiltersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'filters';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewFiltersDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewHelpersDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewHelpersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'helpers';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewHelpersDirectory';
}
}

View file

@ -0,0 +1,212 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewScriptFile.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_File
*/
require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Context_Filesystem_File
{
/**
* @var string
*/
protected $_filesystemName = 'view.phtml';
/**
* @var string
*/
protected $_forActionName = null;
/**
* @var string
*/
protected $_scriptName = null;
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewScriptFile';
}
/**
* init()
*
* @return Zend_Tool_Project_Context_Zf_ViewScriptFile
*/
public function init()
{
if ($forActionName = $this->_resource->getAttribute('forActionName')) {
$this->_forActionName = $forActionName;
$this->_filesystemName = $this->_convertActionNameToFilesystemName($forActionName) . '.phtml';
} elseif ($scriptName = $this->_resource->getAttribute('scriptName')) {
$this->_scriptName = $scriptName;
$this->_filesystemName = $scriptName . '.phtml';
} else {
throw new Exception('Either a forActionName or scriptName is required.');
}
parent::init();
return $this;
}
/**
* getPersistentAttributes()
*
* @return unknown
*/
public function getPersistentAttributes()
{
$attributes = array();
if ($this->_forActionName) {
$attributes['forActionName'] = $this->_forActionName;
}
if ($this->_scriptName) {
$attributes['scriptName'] = $this->_scriptName;
}
return $attributes;
}
/**
* getContents()
*
* @return string
*/
public function getContents()
{
$contents = '';
if ($this->_filesystemName == 'error.phtml') { // should also check that the above directory is forController=error
$contents .= <<<EOS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zend Framework Default Application</title>
</head>
<body>
<h1>An error occurred</h1>
<h2><?php echo \$this->message ?></h2>
<?php if (isset(\$this->exception)): ?>
<h3>Exception information:</h3>
<p>
<b>Message:</b> <?php echo \$this->exception->getMessage() ?>
</p>
<h3>Stack trace:</h3>
<pre><?php echo \$this->exception->getTraceAsString() ?>
</pre>
<h3>Request Parameters:</h3>
<pre><?php echo var_export(\$this->request->getParams(), true) ?>
</pre>
<?php endif ?>
</body>
</html>
EOS;
} elseif ($this->_forActionName == 'index' && $this->_resource->getParentResource()->getAttribute('forControllerName') == 'Index') {
$contents =<<<EOS
<style>
a:link,
a:visited
{
color: #0398CA;
}
span#zf-name
{
color: #91BE3F;
}
div#welcome
{
color: #FFFFFF;
background-image: url(http://framework.zend.com/images/bkg_header.jpg);
width: 600px;
height: 400px;
border: 2px solid #444444;
overflow: hidden;
text-align: center;
}
div#more-information
{
background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
height: 100%;
}
</style>
<div id="welcome">
<h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1>
<h3>This is your project's main page</h3>
<div id="more-information">
<p><img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /></p>
<p>
Helpful Links: <br />
<a href="http://framework.zend.com/">Zend Framework Website</a> |
<a href="http://framework.zend.com/manual/en/">Zend Framework Manual</a>
</p>
</div>
</div>
EOS;
} else {
$contents = '<br /><br /><center>View script for controller <b>' . $this->_resource->getParentResource()->getAttribute('forControllerName') . '</b>'
. ' and script/action name <b>' . $this->_forActionName . '</b></center>';
}
return $contents;
}
protected function _convertActionNameToFilesystemName($actionName)
{
$filter = new Zend_Filter();
$filter->addFilter(new Zend_Filter_Word_CamelCaseToDash())
->addFilter(new Zend_Filter_StringToLower());
return $filter->filter($actionName);
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewScriptsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'scripts';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewScriptsDirectory';
}
}

View file

@ -0,0 +1,57 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewsDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'views';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ViewsDirectory';
}
}

View file

@ -0,0 +1,104 @@
<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ZfStandardLibraryDirectory.php 20903 2010-02-04 16:16:47Z matthew $
*/
/**
* @see Zend_Tool_Project_Context_Filesystem_Directory
*/
require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php';
/**
* This class is the front most class for utilizing Zend_Tool_Project
*
* A profile is a hierarchical set of resources that keep track of
* items within a specific project.
*
* @category Zend
* @package Zend_Tool
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ZfStandardLibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'Zend';
/**
* getName()
*
* @return string
*/
public function getName()
{
return 'ZfStandardLibraryDirectory';
}
/**
* create()
*
*/
public function create()
{
parent::create();
$zfPath = $this->_getZfPath();
if ($zfPath != false) {
$zfIterator = new RecursiveDirectoryIterator($zfPath);
foreach ($rii = new RecursiveIteratorIterator($zfIterator, RecursiveIteratorIterator::SELF_FIRST) as $file) {
$relativePath = preg_replace('#^'.preg_quote(realpath($zfPath), '#').'#', '', realpath($file->getPath())) . DIRECTORY_SEPARATOR . $file->getFilename();
if (strpos($relativePath, DIRECTORY_SEPARATOR . '.') !== false) {
continue;
}
if ($file->isDir()) {
mkdir($this->getBaseDirectory() . DIRECTORY_SEPARATOR . $this->getFilesystemName() . $relativePath);
} else {
copy($file->getPathname(), $this->getBaseDirectory() . DIRECTORY_SEPARATOR . $this->getFilesystemName() . $relativePath);
}
}
}
}
/**
* _getZfPath()
*
* @return string|false
*/
protected function _getZfPath()
{
require_once 'Zend/Loader.php';
foreach (Zend_Loader::explodeIncludePath() as $includePath) {
if (!file_exists($includePath) || $includePath[0] == '.') {
continue;
}
if (realpath($checkedPath = rtrim($includePath, '\\/') . '/Zend/Loader.php') !== false && file_exists($checkedPath)) {
return dirname($checkedPath);
}
}
return false;
}
}