/** * 静态方法, 单例统一访问入口 * @return object 返回对象的唯一实例 */ public static function getInstance() { if (is_null(self::$_instance) || !isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
/** * 删除域名 */ public function delete() { $id = MiniHttp::getParam('id', ''); //域名所对应的id $item = MiniChooserDomain::getInstance()->getById($id); MiniChooserDomain::getInstance()->deleteDomain($item['id']); $value = array(); $value['success'] = true; return $value; }
/** * 根据Domain,app_key来获取结果 */ public function validKey($domain, $appKey) { $chooser = MiniChooser::getInstance()->getByKey($appKey); if (empty($chooser)) { return false; } $chooserId = $chooser['id']; $item = MiniChooserDomain::getInstance()->getByDomain($chooserId, $domain); if (empty($item)) { return false; } return true; }