X7ROOT File Manager
Current Path:
/home/gfecatvj/4abetter.us-old/Engine/Pattern
home
/
gfecatvj
/
4abetter.us-old
/
Engine
/
Pattern
/
📁
..
📄
Base.trait.php
(415 B)
📄
Singleton.trait.php
(727 B)
Editing: Singleton.trait.php
<?php /** * @author Pierre-Henry Soria <phy@hizup.uk> * @copyright (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved. * @license Lesser General Public License <http://www.gnu.org/copyleft/lesser.html> * @link http://hizup.uk */ namespace TestProject\Engine\Pattern; trait Singleton { use Base; protected static $_oInstance = null; /** * Get instance of class. * * @access public * @static * @return object Return the instance class or create first instance of the class. */ public static function getInstance() { return (null === static::$_oInstance) ? static::$_oInstance = new static : static::$_oInstance; } }
Upload File
Create Folder