Created
January 11, 2013 06:04
Revisions
-
jaceju created this gist
Jan 11, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <?php trait Singleton { protected static $_instance = null; public static function getInstance() { if (static::$_instance === null || !(static::$_instance instanceof static)) { static::$_instance = new static(); } return static::$_instance; } }