Commit 73b8b827 authored by chenchuanwen's avatar chenchuanwen

realeaseInstance

parent b08f2864
...@@ -114,12 +114,15 @@ class IndexController extends \Our\Controller_Abstract { ...@@ -114,12 +114,15 @@ class IndexController extends \Our\Controller_Abstract {
public function testRelease(){ public function testRelease(){
$obj=\Business\Order\OrderServiceModel::getInstance(); $obj=\Business\Order\OrderServiceModel::getInstance();
$obj->order='abc'; $obj->order='abc';
//\Business\Order\OrderServiceModel::realeaseInstance();
} }
public function indexAction() { public function indexAction() {
$this->testRelease(); $this->testRelease();
$obj=\Business\Order\OrderServiceModel::getInstance(); $obj=\Business\Order\OrderServiceModel::getInstance();
echo $obj->order;exit; echo $obj->order;
exit;
$getKey=$_GET['key']; $getKey=$_GET['key'];
if($getKey!='~!@#$`1234qwert'){ if($getKey!='~!@#$`1234qwert'){
throw new Exception('非法',-1111); throw new Exception('非法',-1111);
......
...@@ -1790,7 +1790,11 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -1790,7 +1790,11 @@ class OrderServiceModel extends \Business\AbstractModel
* @var \DAO\UserModel * @var \DAO\UserModel
*/ */
private static $_instance = null; private static $_instance = null;
public static function realeaseInstance(){
if(!empty(self::$_instance)){
self::$_instance=null;
}
}
/** /**
* 单例模式获取类实例 * 单例模式获取类实例
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment