コード例 #1
0
 /**
  * Return the single allowed instance of this class.  The instance will be created if necessary.
  *
  * @returns object.
  */
 public static function get_instance()
 {
     if (!isset(self::$_instance)) {
         $c = __CLASS__;
         self::$_instance = new $c();
     }
     return self::$_instance;
 }
コード例 #2
0
ファイル: class.CmsApp.php プロジェクト: rainbow-studio/cmsms
 public function __get($key)
 {
     switch ($key) {
         case 'config':
             return cms_config::get_instance();
             break;
         case 'variables':
             return cms_variables::get_instance();
             break;
     }
 }