當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。