Example #1
0
 public static final function getInstance()
 {
     if (!static::$_instance) {
         static::$_instance = new self();
     }
     return static::$_instance;
 }
Example #2
0
 public static function _i()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #3
0
 /**
  * Returns an instance of the singleton.
  * 
  * Passes args to constructor
  */
 public static final function instance()
 {
     if (null === static::$_instance) {
         static::$_instance = new self(func_get_args());
     }
     return self::$_instance;
 }
Example #4
0
 /**
  * Creates a new instance for static use of the class.
  *
  * @return  Image_Driver
  */
 protected static function instance()
 {
     if (static::$_instance == null) {
         static::$_instance = static::forge(static::$_config);
     }
     return static::$_instance;
 }
Example #5
0
 public static function instance()
 {
     if (static::$_instance == null) {
         static::$_instance = static::factory();
     }
     return static::$_instance;
 }
 public static function getInstance()
 {
     if (static::$_instance === null || !static::$_instance instanceof static) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #7
0
 /**
  * Get instance of \Hoa\Registry.
  *
  * @return  object
  */
 protected static function getInstance()
 {
     if (null === static::$_instance) {
         static::$_instance = new parent();
     }
     return static::$_instance;
 }
Example #8
0
 public static function getInstance($config)
 {
     if (!static::$_instance instanceof static) {
         static::$_instance = new static($config);
     }
     return static::$_instance;
 }
Example #9
0
 /**
  * Create a new instance of the current cache driver, using the given settings.
  * 
  * @param array $config
  * @return void
  */
 public static function getInstance(array $config)
 {
     if (static::$_instance === null) {
         static::$_instance = new static($config);
     }
     return static::$_instance;
 }
Example #10
0
 /**
  * 获取Pandaphp单例
  * @access public
  * @author songdengtao <http://www.songdengtao.cn>
  * @return object
  */
 public static function getInstance()
 {
     if (is_null(static::$_instance)) {
         static::$_instance = new Pandaphp();
     }
     return static::$_instance;
 }
Example #11
0
 public static function instance()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new Event();
     }
     return static::$_instance;
 }
Example #12
0
 /**
  * Returns an instance of this class.
  *
  * Useful when we need to use some of the trait methods.
  *
  * @return \Field\Utility\TextToolbox
  */
 public static function getInstance()
 {
     if (!static::$_instance) {
         static::$_instance = new TextToolBox();
     }
     return static::$_instance;
 }
Example #13
0
 public static function instance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new self();
     }
     return static::$_instance;
 }
Example #14
0
 public static function getInstance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new FUFRoute();
     }
     return static::$_instance;
 }
Example #15
0
 public static final function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #16
0
 public static function getInstance($host, $db, $user, $pass)
 {
     if (static::$_instance === null) {
         static::$_instance = new static($host, $db, $user, $pass);
     }
     return static::$_instance;
 }
 /**
  * @return ProfilerLogger
  */
 public static function getInstance()
 {
     if (static::$_instance == null) {
         static::$_instance = new ProfilerLogger();
     }
     return static::$_instance;
 }
Example #18
0
 public static function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new Model();
     }
     return static::$_instance;
 }
 /**
  * Checks, instantiates and returns the only instance of the using class.
  *
  * @return object
  */
 public static function getinstance()
 {
     if (!static::$_instance instanceof static) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #20
0
 public static function forge()
 {
     if (static::$_instance == null) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #21
0
 /**
  * Creates singleton instance if it does not exist otherwise returns
  * an existing instance without having to instantiate a new object
  * 
  * @return Singleton Returns a singleton instance
  * 
  */
 public static function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new Database();
     }
     return static::$_instance->databaseHandler;
 }
Example #22
0
 public static function getInstance()
 {
     if (static::$_instance) {
         return static::$_instance;
     }
     return static::$_instance = new self();
 }
 /**
  * Get the singleton instance
  *
  * @return Auth
  */
 public static function getInstance()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new Auth();
     }
     return static::$_instance;
 }
Example #24
0
 /**
  *
  * @return mixed|static
  */
 public static function getInstance()
 {
     if (!is_object(static::$_instance)) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
 /**
  * Returns an instance of this class.
  *
  * Useful when we need to use some of the trait methods.
  *
  * @return \Taxonomy\Utility\TaxonomyToolbox
  */
 public static function getInstance()
 {
     if (!static::$_instance) {
         static::$_instance = new TaxonomyToolbox();
     }
     return static::$_instance;
 }
Example #26
0
 /**
  * Create Client object
  *
  * @param   string    Identifier for this client's instence
  * @param   array     Configuration array
  * @return  Fieldset
  */
 public static function client($name = 'default', $config = array())
 {
     if (is_array($name)) {
         $config = $name;
         $name = 'default';
     }
     if ($exists = static::instance($name)) {
         return $exists;
     }
     if (!isset($config['driver']) || empty($config['driver'])) {
         throw new Exception('No Tapioca driver given.');
     }
     $driver = 'Tapioca\\Driver_' . ucfirst($config['driver']);
     if (!class_exists($driver, true)) {
         throw new Exception('Could not find Tapioca driver: ' . $config['driver'] . ' (' . $driver . ')');
     }
     // Default config
     // DO NOT EDIT
     $_defaults = array('driver' => 'Rest', 'slug' => false, 'url' => true, 'clientId' => false, 'clientSecret' => false, 'fileStorage' => false, 'mongo' => array('dsn' => 'mongodb://*****:*****@localhost:27017/databaseName', 'persist' => true, 'persist_key' => 'tapioca', 'replica_set' => false), 'cache' => array('ttl' => 3600, 'path' => false), 'collections' => array('apps' => 'apps', 'library' => 'library', 'previews' => 'previews'));
     static::config($config, $_defaults);
     static::$_instances[$name] = new $driver($config);
     if ($name == 'default') {
         static::$_instance = static::$_instances[$name];
     }
     return static::$_instances[$name];
 }
Example #27
0
 /**
  * Retrieve the active instance.
  *
  * @return Authentication
  */
 public static function instance()
 {
     if (!static::$_instance) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #28
0
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         static::$_instance = new static();
     }
     return self::$_instance;
 }
 /**
  * Returns the *Singleton* instance of this class.
  *
  * @return HighchartGlobalOptions The *Singleton* instance.
  */
 public static function getInstance()
 {
     if (null === static::$_instance) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
Example #30
0
 /**
  * Get HTTP instance
  *
  * @return \ezote\lib\HTTP
  */
 public static function instance()
 {
     if (static::$_instance === false) {
         static::$_instance = new static(eZHTTPTool::instance(), $_SERVER);
     }
     return static::$_instance;
 }