public static function instance($path = '/tmp/') { if (!self::$_instance instanceof self) { self::$_instance = new self($path); } return self::$_instance; }
/** * 静态方法, 单例统一访问入口 * @return object 返回对象的唯一实例 */ public static function getInstance() { if (is_null(self::$_instance) || !isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }