Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

StaticEventManager.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.63 KiB


 01  <?php
 02  /**
 03   * Zend Framework (http://framework.zend.com/)
 04   *
 05   * @link      http://github.com/zendframework/zf2 for the canonical source repository
 06   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 07   * @license   http://framework.zend.com/license/new-bsd New BSD License
 08   */
 09   
 10  namespace Zend\EventManager;
 11   
 12  /**
 13   * Static version of EventManager
 14   */
 15  class StaticEventManager extends SharedEventManager
 16  {
 17      /**
 18       * @var SharedEventManagerInterface
 19       */
 20      protected static $instance;
 21   
 22      /**
 23       * Singleton
 24       */
 25      protected function __construct()
 26      {
 27      }
 28   
 29      /**
 30       * Singleton
 31       *
 32       * @return void
 33       */
 34      private function __clone()
 35      {
 36      }
 37   
 38      /**
 39       * Retrieve instance
 40       *
 41       * @return StaticEventManager
 42       */
 43      public static function getInstance()
 44      {
 45          if (null === static::$instance) {
 46              static::setInstance(new static());
 47          }
 48          return static::$instance;
 49      }
 50   
 51      /**
 52       * Set the singleton to a specific SharedEventManagerInterface instance
 53       *
 54       * @param SharedEventManagerInterface $instance
 55       * @return void
 56       */
 57      public static function setInstance(SharedEventManagerInterface $instance)
 58      {
 59          static::$instance = $instance;
 60      }
 61   
 62      /**
 63       * Is a singleton instance defined?
 64       *
 65       * @return bool
 66       */
 67      public static function hasInstance()
 68      {
 69          return (static::$instance instanceof SharedEventManagerInterface);
 70      }
 71   
 72      /**
 73       * Reset the singleton instance
 74       *
 75       * @return void
 76       */
 77      public static function resetInstance()
 78      {
 79          static::$instance = null;
 80      }
 81  }
 82