本文整理汇总了PHP中Zend\Registry::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::getInstance方法的具体用法?PHP Registry::getInstance怎么用?PHP Registry::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Registry
的用法示例。
在下文中一共展示了Registry::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearRegistry
public function clearRegistry()
{
if (Registry::isRegistered('Zend_Translator')) {
$registry = Registry::getInstance();
unset($registry['Zend_Translator']);
}
}
示例2: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
$registry = \Zend\Registry::getInstance();
if (isset($registry[Registry::REGISTRY_KEY])) {
unset($registry[Registry::REGISTRY_KEY]);
}
$this->registry = new Registry();
}
示例3: clearRegistry
public function clearRegistry()
{
$regKey = 'Zend_Currency';
if (\Zend\Registry::isRegistered($regKey)) {
$registry = \Zend\Registry::getInstance();
unset($registry[$regKey]);
}
}
示例4: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
$registry = Registry::getInstance();
if (isset($registry['Zend\\Dojo\\View\\Helper\\Dojo'])) {
unset($registry['Zend\\Dojo\\View\\Helper\\Dojo']);
}
$this->view = new View\PhpRenderer();
\Zend\Dojo\Dojo::enableView($this->view);
}
示例5: setUp
/**
* Creates a new Zend_Validator_Float object for each test method
*
* @return void
*/
public function setUp()
{
$this->_locale = setlocale(LC_ALL, 0);
//backup locale
if (\Zend\Registry::isRegistered('Zend_Locale')) {
\Zend\Registry::getInstance()->offsetUnset('Zend_Locale');
}
$this->_validator = new Validator\Float();
}
示例6: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
$regKey = 'Zend_View_Helper_Doctype';
if (\Zend\Registry::isRegistered($regKey)) {
$registry = \Zend\Registry::getInstance();
unset($registry[$regKey]);
}
$this->helper = new Helper\Doctype();
}
示例7: setup
public function setup()
{
Reader\Reader::reset();
if (\Zend\Registry::isRegistered('Zend_Locale')) {
$registry = \Zend\Registry::getInstance();
unset($registry['Zend_Locale']);
}
$this->_feedSamplePath = dirname(__FILE__) . '/_files/Common';
}
示例8: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
if (\Zend\Registry::isRegistered('Zend_View_Helper_Doctype')) {
$registry = \Zend\Registry::getInstance();
unset($registry['Zend_View_Helper_Doctype']);
}
$this->view = new \Zend\View\View();
$this->helper = new \Zend\View\Helper\FormReset();
$this->helper->setView($this->view);
}
示例9: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
$regKey = Registry\Registry::REGISTRY_KEY;
if (\Zend\Registry::isRegistered($regKey)) {
$registry = \Zend\Registry::getInstance();
unset($registry[$regKey]);
}
$this->basePath = dirname(__FILE__) . '/_files/modules';
$this->helper = new Helper\HeadTitle();
}
示例10: setUp
public function setUp()
{
if (Registry::isRegistered('Zend_Locale')) {
$registry = Registry::getInstance();
unset($registry['Zend_Locale']);
}
Cldr::removeCache();
$this->_locale = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de');
}
示例11: __construct
/**
* Initialize helper
*
* Retrieve container from registry or create new container and store in
* registry.
*
* @return void
*/
public function __construct()
{
$registry = Registry::getInstance();
$key = __CLASS__;
if (!isset($registry[$key])) {
$container = new Dojo\Container();
$registry[$key] = $container;
}
$this->_container = $registry[$key];
}
示例12: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
if (Registry::isRegistered('Zend_View_Helper_Doctype')) {
$registry = Registry::getInstance();
unset($registry['Zend_View_Helper_Doctype']);
}
$this->view = new View();
$this->helper = new FormMultiCheckbox();
$this->helper->setView($this->view);
}
示例13: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (Registry::isRegistered('Zend_View_Helper_Doctype')) {
$registry = Registry::getInstance();
unset($registry['Zend_View_Helper_Doctype']);
}
$this->view = new View();
$this->helper = new FormTextHelper();
$this->helper->setView($this->view);
}
示例14: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (\Zend\Registry::isRegistered('Zend_View_Helper_Doctype')) {
$registry = \Zend\Registry::getInstance();
unset($registry['Zend_View_Helper_Doctype']);
}
$this->view = new \Zend\View\PhpRenderer();
$this->helper = new \Zend\View\Helper\FormFile();
$this->helper->setView($this->view);
}
示例15: setUp
public function setUp()
{
// Necessary to ensure placeholders do not persist between individual tests
if (Registry::isRegistered(PlaceholderRegistry::REGISTRY_KEY)) {
Registry::getInstance()->offsetUnset(PlaceholderRegistry::REGISTRY_KEY);
}
$this->renderer = new PhpRenderer();
$this->strategy = new PhpRendererStrategy($this->renderer);
$this->event = new ViewEvent();
$this->response = new HttpResponse();
}