import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
@ -35,7 +35,7 @@ require_once 'Zend/Tool/Project/Context/Content/Engine/Phtml.php';
|
||||
*
|
||||
* 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)
|
||||
@ -47,17 +47,17 @@ 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()
|
||||
*
|
||||
@ -71,7 +71,7 @@ class Zend_Tool_Project_Context_Content_Engine
|
||||
new Zend_Tool_Project_Context_Content_Engine_Phtml($storage, $this->_keyInStorage),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
@ -83,24 +83,24 @@ class Zend_Tool_Project_Context_Content_Engine
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
*
|
||||
* 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)
|
||||
@ -37,12 +37,12 @@ class Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
* @var Zend_Tool_Framework_Client_Storage
|
||||
*/
|
||||
protected $_storage = null;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentPrefix = null;
|
||||
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
@ -54,7 +54,7 @@ class Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
$this->_storage = $storage;
|
||||
$this->_contentPrefix = $contentPrefix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* hasContent()
|
||||
*
|
||||
@ -66,7 +66,7 @@ class Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
{
|
||||
return $this->_storage->has($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
@ -78,21 +78,21 @@ class Zend_Tool_Project_Context_Content_Engine_CodeGenerator
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
*
|
||||
* 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)
|
||||
@ -33,17 +33,17 @@
|
||||
*/
|
||||
class Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var Zend_Tool_Framework_Client_Storage
|
||||
*/
|
||||
protected $_storage = null;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentPrefix = null;
|
||||
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
@ -55,7 +55,7 @@ class Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
$this->_storage = $storage;
|
||||
$this->_contentPrefix = $contentPrefix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* hasContext()
|
||||
*
|
||||
@ -67,7 +67,7 @@ class Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
{
|
||||
return $this->_storage->has($this->_contentPrefix . '/' . $context . '/' . $method . '.phtml');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getContent()
|
||||
*
|
||||
@ -78,12 +78,12 @@ class Zend_Tool_Project_Context_Content_Engine_Phtml
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user