File indexing completed on 2025-02-02 05:49:01
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_EventManager 0017 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0018 * @license http://framework.zend.com/license/new-bsd New BSD License 0019 */ 0020 0021 // require_once 'Zend/EventManager/EventManager.php'; 0022 // require_once 'Zend/EventManager/SharedEventManager.php'; 0023 // require_once 'Zend/Stdlib/CallbackHandler.php'; 0024 0025 /** 0026 * Static version of EventManager 0027 * 0028 * @category Zend 0029 * @package Zend_EventManager 0030 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0031 * @license http://framework.zend.com/license/new-bsd New BSD License 0032 */ 0033 class Zend_EventManager_StaticEventManager extends Zend_EventManager_SharedEventManager 0034 { 0035 /** 0036 * @var Zend_EventManager_StaticEventManager 0037 */ 0038 protected static $instance; 0039 0040 /** 0041 * Singleton 0042 * 0043 * @return void 0044 */ 0045 protected function __construct() 0046 { 0047 } 0048 0049 /** 0050 * Singleton 0051 * 0052 * @return void 0053 */ 0054 private function __clone() 0055 { 0056 } 0057 0058 /** 0059 * Retrieve instance 0060 * 0061 * @return Zend_EventManager_StaticEventManager 0062 */ 0063 public static function getInstance() 0064 { 0065 if (null === self::$instance) { 0066 self::$instance = new self(); 0067 } 0068 return self::$instance; 0069 } 0070 0071 /** 0072 * Reset the singleton instance 0073 * 0074 * @return void 0075 */ 0076 public static function resetInstance() 0077 { 0078 self::$instance = null; 0079 } 0080 }