Advertisement
Guest User

Untitled

a guest
May 24th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2.  
  3.         namespace net\snapserv;
  4.  
  5.         trait Singleton {
  6.                 /**
  7.                  * @var self
  8.                  */
  9.                 private static $instance;
  10.  
  11.                 /**
  12.                  * @return self
  13.                  */
  14.                 public static function getInstance() {
  15.                         if(!self::$instance)
  16.                                 self::$instance = new self;
  17.                         return self::$instance;
  18.                 }
  19.  
  20.                 private function __construct() {}
  21.         }
  22.  
  23.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement