import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
106
libs/Zend/Tool/Project/Context/Content/Engine.php
Normal file
106
libs/Zend/Tool/Project/Context/Content/Engine.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
*/
|
||||
require_once 'Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
*/
|
||||
require_once 'Zend/Tool/Project/Context/Content/Engine/Phtml.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-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Content_Engine
|
||||
{
|
||||
/**
|
||||
* @var Zend_Tool_Framework_Client_Storage
|
||||
*/
|
||||
protected $_storage = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_keyInStorage = 'project/content';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_engines = array();
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
* @param Zend_Tool_Framework_Client_Storage $storage
|
||||
*/
|
||||
public function __construct(Zend_Tool_Framework_Client_Storage $storage)
|
||||
{
|
||||
$this->_storage = $storage;
|
||||
$this->_engines = array(
|
||||
new Zend_Tool_Project_Context_Content_Engine_CodeGenerator($storage, $this->_keyInStorage),
|
||||
new Zend_Tool_Project_Context_Content_Engine_Phtml($storage, $this->_keyInStorage),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
* @param Zend_Tool_Project_Context_Interface $context
|
||||
* @param string $methodName
|
||||
* @param mixed $parameters
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(Zend_Tool_Project_Context_Interface $context, $methodName, $parameters)
|
||||
{
|
||||
$content = null;
|
||||
|
||||
foreach ($this->_engines as $engine) {
|
||||
if ($engine->hasContent($context, $methodName, $parameters)) {
|
||||
$content = $engine->getContent($context, $methodName, $parameters);
|
||||
|
||||
if ($content != null) {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($content == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
{
|
||||
/**
|
||||
* @var Zend_Tool_Framework_Client_Storage
|
||||
*/
|
||||
protected $_storage = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentPrefix = null;
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
* @param Zend_Tool_Framework_Client_Storage $storage
|
||||
* @param string $contentPrefix
|
||||
*/
|
||||
public function __construct(Zend_Tool_Framework_Client_Storage $storage, $contentPrefix)
|
||||
{
|
||||
$this->_storage = $storage;
|
||||
$this->_contentPrefix = $contentPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* hasContent()
|
||||
*
|
||||
* @param Zend_Tool_Project_Context_Interface $context
|
||||
* @param string $method
|
||||
* @return string
|
||||
*/
|
||||
public function hasContent(Zend_Tool_Project_Context_Interface $context, $method)
|
||||
{
|
||||
return $this->_storage->has($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
* @param Zend_Tool_Project_Context_Interface $context
|
||||
* @param string $method
|
||||
* @param mixed $parameters
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(Zend_Tool_Project_Context_Interface $context, $method, $parameters)
|
||||
{
|
||||
$streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php');
|
||||
|
||||
if (method_exists($context, 'getCodeGenerator')) {
|
||||
$codeGenerator = $context->getCodeGenerator();
|
||||
} else {
|
||||
$codeGenerator = new Zend_CodeGenerator_Php_File();
|
||||
}
|
||||
|
||||
$codeGenerator = include $streamUri;
|
||||
|
||||
if (!$codeGenerator instanceof Zend_CodeGenerator_Abstract) {
|
||||
throw new Zend_Tool_Project_Exception('Custom file at ' . $streamUri . ' did not return the $codeGenerator object.');
|
||||
}
|
||||
|
||||
return $codeGenerator->generate();
|
||||
}
|
||||
|
||||
|
||||
}
|
89
libs/Zend/Tool/Project/Context/Content/Engine/Phtml.php
Normal file
89
libs/Zend/Tool/Project/Context/Content/Engine/Phtml.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Zend_Tool_Framework_Client_Storage
|
||||
*/
|
||||
protected $_storage = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentPrefix = null;
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
* @param Zend_Tool_Framework_Client_Storage $storage
|
||||
* @param string $contentPrefix
|
||||
*/
|
||||
public function __construct(Zend_Tool_Framework_Client_Storage $storage, $contentPrefix)
|
||||
{
|
||||
$this->_storage = $storage;
|
||||
$this->_contentPrefix = $contentPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* hasContext()
|
||||
*
|
||||
* @param Zend_Tool_Project_Context_Interface $context
|
||||
* @param string $method
|
||||
* @return string
|
||||
*/
|
||||
public function hasContent(Zend_Tool_Project_Context_Interface $context, $method)
|
||||
{
|
||||
return $this->_storage->has($this->_contentPrefix . '/' . $context . '/' . $method . '.phtml');
|
||||
}
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
* @param Zend_Tool_Project_Context_Interface $context
|
||||
* @param string $method
|
||||
* @param mixed $parameters
|
||||
*/
|
||||
public function getContent(Zend_Tool_Project_Context_Interface $context, $method, $parameters)
|
||||
{
|
||||
$streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.phtml');
|
||||
|
||||
ob_start();
|
||||
include $streamUri;
|
||||
$content = ob_get_clean();
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,33 @@
|
||||
<?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
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once 'Zend/Tool/Project/Exception.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Exception extends Zend_Tool_Project_Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Directory.php 16972 2009-07-22 18:44:24Z ralph $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -60,7 +60,7 @@ abstract class Zend_Tool_Project_Context_Filesystem_Directory extends Zend_Tool_
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* delete()
|
||||
*
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: File.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,23 @@
|
||||
<?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
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for contexts
|
||||
@ -6,6 +25,10 @@
|
||||
* setResource() is an optional method that if the context supports
|
||||
* will be set with the resource at construction time
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Tool_Project_Context_Interface
|
||||
{
|
||||
|
@ -1,9 +1,34 @@
|
||||
<?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
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Repository.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once 'Zend/Tool/Project/Context/System/Interface.php';
|
||||
require_once 'Zend/Tool/Project/Context/System/TopLevelRestrictable.php';
|
||||
require_once 'Zend/Tool/Project/Context/System/NotOverwritable.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Repository implements Countable
|
||||
{
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: NotOverwritable.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ProjectDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ProjectProfileFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ProjectProvidersDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TopLevelRestrictable.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ActionMethod.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ApisDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ApplicationConfigFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ApplicationDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: BootstrapFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: CacheDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ConfigFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ConfigsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ControllerFile.php 16972 2009-07-22 18:44:24Z ralph $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -185,13 +185,22 @@ EOS
|
||||
*/
|
||||
public function addAction($actionName)
|
||||
{
|
||||
//require_once $this->getPath();
|
||||
//$codeGenFile = Zend_CodeGenerator_Php_File::fromReflection(new Zend_Reflection_File($this->getPath()));
|
||||
$codeGenFile = Zend_CodeGenerator_Php_File::fromReflectedFileName($this->getPath());
|
||||
$codeGenFileClasses = $codeGenFile->getClasses();
|
||||
$class = array_shift($codeGenFileClasses);
|
||||
$class = $this->getCodeGenerator();
|
||||
$class->setMethod(array('name' => $actionName . 'Action', 'body' => ' // action body here'));
|
||||
file_put_contents($this->getPath(), $codeGenFile->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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ControllersDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: DataDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: DbTableDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: DbTableFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: FormFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: FormsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: HtaccessFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
|
||||
|
||||
EOS;
|
||||
return $output;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: LayoutsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: LibraryDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: LocalesDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: LogsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ModelFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ModelsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ModuleDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ModulesDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ProjectProviderFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: PublicDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: PublicImagesDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: PublicIndexFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: PublicScriptsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: PublicStylesheetsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: SearchIndexesDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: SessionsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TemporaryDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestApplicationBootstrapFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestApplicationControllerDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestApplicationControllerFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestApplicationDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestLibraryBootstrapFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestLibraryDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestLibraryFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestLibraryNamespaceDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestPHPUnitConfigFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: TestsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: UploadsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewControllerScriptsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewFiltersDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewHelpersDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewScriptFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -124,23 +124,23 @@ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Cont
|
||||
</head>
|
||||
<body>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?= \$this->message ?></h2>
|
||||
<h2><?php echo \$this->message ?></h2>
|
||||
|
||||
<? if ('development' == APPLICATION_ENV): ?>
|
||||
<?php if ('development' == APPLICATION_ENV): ?>
|
||||
|
||||
<h3>Exception information:</h3>
|
||||
<p>
|
||||
<b>Message:</b> <?= \$this->exception->getMessage() ?>
|
||||
<b>Message:</b> <?php echo \$this->exception->getMessage() ?>
|
||||
</p>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
<pre><?= \$this->exception->getTraceAsString() ?>
|
||||
<pre><?php echo \$this->exception->getTraceAsString() ?>
|
||||
</pre>
|
||||
|
||||
<h3>Request Parameters:</h3>
|
||||
<pre><? var_dump(\$this->request->getParams()) ?>
|
||||
<pre><?php echo var_export(\$this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<? endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -150,7 +150,6 @@ EOS;
|
||||
|
||||
$contents =<<<EOS
|
||||
<style>
|
||||
|
||||
a:link,
|
||||
a:visited
|
||||
{
|
||||
@ -170,6 +169,7 @@ EOS;
|
||||
height: 400px;
|
||||
border: 2px solid #444444;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div#more-information
|
||||
@ -177,22 +177,21 @@ EOS;
|
||||
background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
<center>
|
||||
<div id="welcome">
|
||||
<br />
|
||||
<h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1>
|
||||
<h3>This is your project's main page</h3><br /><br />
|
||||
<div id="more-information">
|
||||
<br />
|
||||
<img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /><br /><br />
|
||||
<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>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
EOS;
|
||||
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewScriptsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ViewsDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ZfStandardLibraryDirectory.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Profile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -165,12 +165,14 @@ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Conta
|
||||
require_once 'Zend/Tool/Project/Exception.php';
|
||||
throw new Zend_Tool_Project_Exception('"projectProfileFile" was supplied but file was not found at location ' . $projectProfileFilePath);
|
||||
}
|
||||
$this->_attributes['projectDirectory'] = dirname($projectProfileFilePath);
|
||||
} else {
|
||||
$projectProfileFilePath = rtrim($this->_attributes['projectDirectory'], '/\\') . '/.zfproject.xml';
|
||||
if (!file_exists($projectProfileFilePath)) {
|
||||
require_once 'Zend/Tool/Project/Exception.php';
|
||||
throw new Zend_Tool_Project_Exception('"projectDirectory" was supplied but no profile file file was not found at location ' . $projectProfileFilePath);
|
||||
}
|
||||
$this->_attributes['projectProfileFile'] = $projectProfileFilePath;
|
||||
}
|
||||
|
||||
$profileData = file_get_contents($projectProfileFilePath);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Xml.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once 'Zend/Tool/Project/Profile/FileParser/Interface.php';
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ContextFilter.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: EnabledResourceFilter.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Resource.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Container.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: SearchConstraints.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Abstract.php 17795 2009-08-24 19:04:01Z ralph $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -105,25 +105,47 @@ abstract class Zend_Tool_Project_Provider_Abstract extends Zend_Tool_Framework_P
|
||||
* - if an enpoint variable has been registered in teh client registry - key=workingDirectory
|
||||
* - if an ENV variable with the key ZFPROJECT_PATH is found
|
||||
*
|
||||
* @
|
||||
* @param $loadProfileFlag bool Whether or not to throw an exception when no profile is found
|
||||
* @param $projectDirectory string The project directory to use to search
|
||||
* @param $searchParentDirectories bool Whether or not to search upper level direcotries
|
||||
* @return Zend_Tool_Project_Profile
|
||||
*/
|
||||
protected function _loadProfile($loadProfileFlag = self::NO_PROFILE_THROW_EXCEPTION, $projectDirectory = null)
|
||||
protected function _loadProfile($loadProfileFlag = self::NO_PROFILE_THROW_EXCEPTION, $projectDirectory = null, $searchParentDirectories = true)
|
||||
{
|
||||
|
||||
|
||||
// use the cwd if no directory was provided
|
||||
if ($projectDirectory == null) {
|
||||
$projectDirectory = getcwd();
|
||||
} elseif (realpath($projectDirectory) == false) {
|
||||
throw new Zend_Tool_Project_Provider_Exception('The $projectDirectory supplied does not exist.');
|
||||
}
|
||||
|
||||
$profile = new Zend_Tool_Project_Profile();
|
||||
$profile->setAttribute('projectDirectory', $projectDirectory);
|
||||
|
||||
if ($profile->isLoadableFromFile()) {
|
||||
$profile->loadFromFile();
|
||||
$this->_loadedProfile = $profile;
|
||||
|
||||
$parentDirectoriesArray = explode(DIRECTORY_SEPARATOR, ltrim($projectDirectory, DIRECTORY_SEPARATOR));
|
||||
while ($parentDirectoriesArray) {
|
||||
$projectDirectoryAssembled = implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray);
|
||||
|
||||
if (DIRECTORY_SEPARATOR !== "\\") {
|
||||
$projectDirectoryAssembled = DIRECTORY_SEPARATOR . $projectDirectoryAssembled;
|
||||
}
|
||||
|
||||
$profile->setAttribute('projectDirectory', $projectDirectoryAssembled);
|
||||
if ($profile->isLoadableFromFile()) {
|
||||
chdir($projectDirectoryAssembled);
|
||||
|
||||
$profile->loadFromFile();
|
||||
$this->_loadedProfile = $profile;
|
||||
break;
|
||||
}
|
||||
|
||||
// break after first run if we are not to check upper directories
|
||||
if ($searchParentDirectories == false) {
|
||||
break;
|
||||
}
|
||||
|
||||
array_pop($parentDirectoriesArray);
|
||||
}
|
||||
|
||||
|
||||
if ($this->_loadedProfile == null) {
|
||||
if ($loadProfileFlag == self::NO_PROFILE_THROW_EXCEPTION) {
|
||||
throw new Zend_Tool_Project_Provider_Exception('A project profile was not found.');
|
||||
@ -183,6 +205,21 @@ abstract class Zend_Tool_Project_Provider_Abstract extends Zend_Tool_Framework_P
|
||||
$projectProfileFile->getContext()->save();
|
||||
}
|
||||
|
||||
protected function _getContentForContext(Zend_Tool_Project_Context_Interface $context, $methodName, $parameters)
|
||||
{
|
||||
$storage = $this->_registry->getStorage();
|
||||
if (!$storage->isEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!class_exists('Zend_Tool_Project_Context_Content_Engine')) {
|
||||
require_once 'Zend/Tool/Project/Context/Content/Engine.php';
|
||||
}
|
||||
|
||||
$engine = new Zend_Tool_Project_Context_Content_Engine($storage);
|
||||
return $engine->getContent($context, $methodName, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* _loadContextClassesIntoRegistry() - This is called by the constructor
|
||||
* so that child providers can provide a list of contexts to load into the
|
||||
@ -198,4 +235,4 @@ abstract class Zend_Tool_Project_Provider_Abstract extends Zend_Tool_Framework_P
|
||||
$registry->addContextClass($contextClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Action.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Controller.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Form.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Manifest.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Model.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Module.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Profile.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Project.php 16972 2009-07-22 18:44:24Z ralph $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -34,12 +34,14 @@ require_once 'Zend/Tool/Project/Provider/Abstract.php';
|
||||
class Zend_Tool_Project_Provider_Project extends Zend_Tool_Project_Provider_Abstract
|
||||
{
|
||||
|
||||
protected $_specialties = array('Info');
|
||||
|
||||
/**
|
||||
* create()
|
||||
*
|
||||
* @param string $path
|
||||
*/
|
||||
public function create($path)
|
||||
public function create($path, $nameOfProfile = null, $fileOfProfile = null)
|
||||
{
|
||||
if ($path == null) {
|
||||
$path = getcwd();
|
||||
@ -62,9 +64,24 @@ class Zend_Tool_Project_Provider_Project extends Zend_Tool_Project_Provider_Abst
|
||||
throw new Zend_Tool_Framework_Client_Exception('A project already exists here');
|
||||
}
|
||||
|
||||
$profileData = null;
|
||||
|
||||
if ($fileOfProfile != null && file_exists($fileOfProfile)) {
|
||||
$profileData = file_get_contents($fileOfProfile);
|
||||
}
|
||||
|
||||
$storage = $this->_registry->getStorage();
|
||||
if ($profileData == '' && $nameOfProfile != null && $storage->isEnabled()) {
|
||||
$profileData = $storage->get('project/profiles/' . $nameOfProfile . '.xml');
|
||||
}
|
||||
|
||||
if ($profileData == '') {
|
||||
$profileData = $this->_getDefaultProfile();
|
||||
}
|
||||
|
||||
$newProfile = new Zend_Tool_Project_Profile(array(
|
||||
'projectDirectory' => $path,
|
||||
'profileData' => $this->_getDefaultProfile()
|
||||
'profileData' => $profileData
|
||||
));
|
||||
|
||||
$newProfile->loadFromData();
|
||||
@ -75,6 +92,21 @@ class Zend_Tool_Project_Provider_Project extends Zend_Tool_Project_Provider_Abst
|
||||
$resource->create();
|
||||
}
|
||||
}
|
||||
|
||||
public function show()
|
||||
{
|
||||
$this->_registry->getResponse()->appendContent('You probably meant to run "show project.info".', array('color' => 'yellow'));
|
||||
}
|
||||
|
||||
public function showInfo()
|
||||
{
|
||||
$profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE);
|
||||
if (!$profile) {
|
||||
$this->_registry->getResponse()->appendContent('No project found.');
|
||||
} else {
|
||||
$this->_registry->getResponse()->appendContent('Working with project located at: ' . $profile->getAttribute('projectDirectory'));
|
||||
}
|
||||
}
|
||||
|
||||
protected function _getDefaultProfile()
|
||||
{
|
||||
|
@ -1,99 +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
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/** Zend_Tool_Project_Provider_Abstract */
|
||||
require_once 'Zend/Tool/Project/Provider/Abstract.php';
|
||||
|
||||
/** Zend_Tool_Project_Provider_Exception */
|
||||
require_once 'Zend/Tool/Project/Provider/Exception.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Provider_ProjectProvider extends Zend_Tool_Project_Provider_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* createResource()
|
||||
*
|
||||
* @param Zend_Tool_Project_Profile $profile
|
||||
* @param string $projectProviderName
|
||||
* @param string $actionNames
|
||||
* @return Zend_Tool_Project_Profile_Resource
|
||||
*/
|
||||
public static function createResource(Zend_Tool_Project_Profile $profile, $projectProviderName, $actionNames = null)
|
||||
{
|
||||
|
||||
if (!is_string($projectProviderName)) {
|
||||
/**
|
||||
* @see Zend_Tool_Project_Provider_Exception
|
||||
*/
|
||||
require_once 'Zend/Tool/Project/Provider/Exception.php';
|
||||
throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_Controller::createResource() expects \"projectProviderName\" is the name of a project provider resource to create.');
|
||||
}
|
||||
|
||||
$profileSearchParams = array();
|
||||
$profileSearchParams[] = 'projectProvidersDirectory';
|
||||
|
||||
$projectProvider = $profile->createResourceAt($profileSearchParams, 'projectProviderFile', array('projectProviderName' => $projectProviderName, 'actionNames' => $actionNames));
|
||||
|
||||
return $projectProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* getName()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'ProjectProvider';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stub for Zend_Tool Project Provider
|
||||
*
|
||||
* @var string $name class name for new Zend_Tool Project Provider
|
||||
* @var array|string $actions list of provider methods
|
||||
* @throws Zend_Tool_Project_Provider_Exception
|
||||
*/
|
||||
public function create($name, $actions = null)
|
||||
{
|
||||
$profile = $this->_loadProfileRequired();
|
||||
|
||||
$projectProvider = self::createResource($profile, $name, $actions);
|
||||
|
||||
if ($this->_registry->getRequest()->isPretend()) {
|
||||
$this->_registry->getResponse()->appendContent('Would create a project provider named ' . $name
|
||||
. ' in location ' . $projectProvider->getPath()
|
||||
);
|
||||
} else {
|
||||
$this->_registry->getResponse()->appendContent('Creating a project provider named ' . $name
|
||||
. ' in location ' . $projectProvider->getPath()
|
||||
);
|
||||
$projectProvider->create();
|
||||
$this->_storeProfile();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
<?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
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ProjectProvider.php 17452 2009-08-08 08:27:54Z yoshida@zend.co.jp $
|
||||
*/
|
||||
|
||||
/** @see Zend_Tool_Project_Provider_Abstract */
|
||||
require_once 'Zend/Tool/Project/Provider/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Tool_Project_Provider_ProjectProvider extends Zend_Tool_Project_Provider_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* createResource()
|
||||
*
|
||||
* @param Zend_Tool_Project_Profile $profile
|
||||
* @param string $projectProviderName
|
||||
* @param string $actionNames
|
||||
* @return Zend_Tool_Project_Profile_Resource
|
||||
*/
|
||||
public static function createResource(Zend_Tool_Project_Profile $profile, $projectProviderName, $actionNames = null)
|
||||
{
|
||||
|
||||
if (!is_string($projectProviderName)) {
|
||||
/**
|
||||
* @see Zend_Tool_Project_Provider_Exception
|
||||
*/
|
||||
require_once 'Zend/Tool/Project/Provider/Exception.php';
|
||||
throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_Controller::createResource() expects \"projectProviderName\" is the name of a project provider resource to create.');
|
||||
}
|
||||
|
||||
$profileSearchParams = array();
|
||||
$profileSearchParams[] = 'projectProvidersDirectory';
|
||||
|
||||
$projectProvider = $profile->createResourceAt($profileSearchParams, 'projectProviderFile', array('projectProviderName' => $projectProviderName, 'actionNames' => $actionNames));
|
||||
|
||||
return $projectProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* getName()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'ProjectProvider';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stub for Zend_Tool Project Provider
|
||||
*
|
||||
* @var string $name class name for new Zend_Tool Project Provider
|
||||
* @var array|string $actions list of provider methods
|
||||
* @throws Zend_Tool_Project_Provider_Exception
|
||||
*/
|
||||
public function create($name, $actions = null)
|
||||
{
|
||||
$profile = $this->_loadProfileRequired();
|
||||
|
||||
$projectProvider = self::createResource($profile, $name, $actions);
|
||||
|
||||
if ($this->_registry->getRequest()->isPretend()) {
|
||||
$this->_registry->getResponse()->appendContent('Would create a project provider named ' . $name
|
||||
. ' in location ' . $projectProvider->getPath()
|
||||
);
|
||||
} else {
|
||||
$this->_registry->getResponse()->appendContent('Creating a project provider named ' . $name
|
||||
. ' in location ' . $projectProvider->getPath()
|
||||
);
|
||||
$projectProvider->create();
|
||||
$this->_storeProfile();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Test.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: View.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user