コード例 #1
0
ファイル: Bootstrap.php プロジェクト: jenky/serapia
 public static final function getInstance()
 {
     if (!static::$_instance) {
         static::$_instance = new self();
     }
     return static::$_instance;
 }
コード例 #2
0
ファイル: YPdo.php プロジェクト: sm115/SYFramework
 public static function _i()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #3
0
ファイル: singleton.php プロジェクト: prggmr/xpspl
 /**
  * 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;
 }
コード例 #4
0
ファイル: image.php プロジェクト: rocketyang/mincms
 /**
  * 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;
 }
コード例 #5
0
ファイル: transaction.php プロジェクト: hymns/fuel
 public static function instance()
 {
     if (static::$_instance == null) {
         static::$_instance = static::factory();
     }
     return static::$_instance;
 }
コード例 #6
0
 public static function getInstance()
 {
     if (static::$_instance === null || !static::$_instance instanceof static) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #7
0
ファイル: Registry.php プロジェクト: Grummfy/Central
 /**
  * Get instance of \Hoa\Registry.
  *
  * @return  object
  */
 protected static function getInstance()
 {
     if (null === static::$_instance) {
         static::$_instance = new parent();
     }
     return static::$_instance;
 }
コード例 #8
0
 public static function getInstance($config)
 {
     if (!static::$_instance instanceof static) {
         static::$_instance = new static($config);
     }
     return static::$_instance;
 }
コード例 #9
0
ファイル: file.php プロジェクト: rhymix/rhymix
 /**
  * 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;
 }
コード例 #10
0
ファイル: Pandaphp.php プロジェクト: songdent/pandaphp
 /**
  * 获取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;
 }
コード例 #11
0
ファイル: Event.php プロジェクト: ArmSALArmy/Banants
 public static function instance()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new Event();
     }
     return static::$_instance;
 }
コード例 #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;
 }
コード例 #13
0
ファイル: ServiceContainer.php プロジェクト: perftools/xhgui
 public static function instance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new self();
     }
     return static::$_instance;
 }
コード例 #14
0
 public static function getInstance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new FUFRoute();
     }
     return static::$_instance;
 }
コード例 #15
0
ファイル: test.php プロジェクト: laubosslink/lab
 public static final function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #16
0
ファイル: Database.php プロジェクト: endever/PHPancy
 public static function getInstance($host, $db, $user, $pass)
 {
     if (static::$_instance === null) {
         static::$_instance = new static($host, $db, $user, $pass);
     }
     return static::$_instance;
 }
コード例 #17
0
 /**
  * @return ProfilerLogger
  */
 public static function getInstance()
 {
     if (static::$_instance == null) {
         static::$_instance = new ProfilerLogger();
     }
     return static::$_instance;
 }
コード例 #18
0
ファイル: Model.php プロジェクト: camael24/sohapi
 public static function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new Model();
     }
     return static::$_instance;
 }
コード例 #19
0
 /**
  * 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;
 }
コード例 #20
0
ファイル: router.php プロジェクト: josemaripl/GasPHP
 public static function forge()
 {
     if (static::$_instance == null) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #21
0
ファイル: Database.php プロジェクト: puiu91/Learning-MVC
 /**
  * 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;
 }
コード例 #22
0
ファイル: bootstrap.php プロジェクト: aaroncox/epicmongo
 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;
 }
コード例 #24
0
ファイル: Abstract.php プロジェクト: vzina/yaf-api
 /**
  *
  * @return mixed|static
  */
 public static function getInstance()
 {
     if (!is_object(static::$_instance)) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #25
0
 /**
  * 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;
 }
コード例 #26
0
ファイル: Client.php プロジェクト: tapioca/client-php
 /**
  * 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];
 }
コード例 #27
0
ファイル: Authentication.php プロジェクト: mmanos/laravel-api
 /**
  * Retrieve the active instance.
  *
  * @return Authentication
  */
 public static function instance()
 {
     if (!static::$_instance) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
コード例 #28
0
ファイル: Parameters.php プロジェクト: vladyslav-p01/edu.com
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         static::$_instance = new static();
     }
     return self::$_instance;
 }
コード例 #29
0
 /**
  * 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;
 }
コード例 #30
0
ファイル: HTTP.php プロジェクト: keyteqlabs/ezote
 /**
  * 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;
 }