当前位置: 首页>>代码示例>>PHP>>正文


PHP Registry::getInstance方法代码示例

本文整理汇总了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']);
     }
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:7,代码来源:FormTest.php

示例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();
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:14,代码来源:RegistryTest.php

示例3: clearRegistry

 public function clearRegistry()
 {
     $regKey = 'Zend_Currency';
     if (\Zend\Registry::isRegistered($regKey)) {
         $registry = \Zend\Registry::getInstance();
         unset($registry[$regKey]);
     }
 }
开发者ID:niallmccrudden,项目名称:zf2,代码行数:8,代码来源:CurrencyTest.php

示例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);
 }
开发者ID:RomanShumkov,项目名称:zf2,代码行数:15,代码来源:BuildLayerTest.php

示例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();
 }
开发者ID:nevvermind,项目名称:zf2,代码行数:14,代码来源:FloatTest.php

示例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();
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:15,代码来源:DoctypeTest.php

示例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';
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:9,代码来源:CommonTest.php

示例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);
 }
开发者ID:stunti,项目名称:zf2,代码行数:16,代码来源:FormResetTest.php

示例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();
 }
开发者ID:stunti,项目名称:zf2,代码行数:16,代码来源:HeadTitleTest.php

示例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');
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:10,代码来源:TemperatureTest.php

示例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];
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:18,代码来源:Dojo.php

示例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);
 }
开发者ID:navtis,项目名称:xerxes-pazpar2,代码行数:16,代码来源:FormMultiCheckboxTest.php

示例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);
 }
开发者ID:navtis,项目名称:xerxes-pazpar2,代码行数:16,代码来源:FormTextTest.php

示例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);
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:16,代码来源:FormFileTest.php

示例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();
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:11,代码来源:PhpRendererStrategyTest.php


注:本文中的Zend\Registry::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。