|
@@ -39,27 +39,6 @@ class Resp extends Object_ext {
|
|
|
*/
|
|
|
public $tag;
|
|
|
|
|
|
- /**
|
|
|
- * 实例方法, 将静态变量上累积的数据转移到自己身上
|
|
|
- */
|
|
|
- public function AfterProc() {
|
|
|
- $this->tag = arr2obj(array_merge((array) $this->tag, (array) self::$ext_tag)); # 合并附加tag,
|
|
|
- self::$ext_tag = ObjectInit();
|
|
|
- $this->events = self::$ext_events;
|
|
|
- self::$ext_events = array();
|
|
|
- if (count($this->events) > 0) {
|
|
|
- if (is_array($this->result)) {
|
|
|
- if (!array_key_exists('store', (array) $this->result)) {
|
|
|
- $this->result['store'] = ctx()->store;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (!array_key_exists('store', (array) $this->result)) {
|
|
|
- $this->result->store = ctx()->store;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 产生服务端应答
|
|
|
* @param Req $req
|
|
@@ -92,6 +71,30 @@ class Resp extends Object_ext {
|
|
|
return $resp;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 实例方法, 将静态变量上累积的数据转移到自己身上
|
|
|
+ */
|
|
|
+ public function AfterProc() {
|
|
|
+ $this->tag = arr2obj(array_merge((array) $this->tag, (array) self::$ext_tag)); # 合并附加tags
|
|
|
+ self::$ext_tag = ObjectInit();
|
|
|
+ $this->events = self::$ext_events; # 合并附加events
|
|
|
+ self::$ext_events = array();
|
|
|
+ if (count($this->events) > 0) { # 对于出现event的情况下自动附带store到客户端.
|
|
|
+ if (is_array($this->result)) {
|
|
|
+ if (!array_key_exists('store', (array) $this->result)) {
|
|
|
+ $this->result['store'] = ctx()->store;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!array_key_exists('store', (array) $this->result)) {
|
|
|
+ $this->result->store = ctx()->store;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // <editor-fold defaultstate="collapsed" desc="附加event带回">
|
|
|
+
|
|
|
+
|
|
|
static $ext_events = array();
|
|
|
|
|
|
public static function AddEvent($name, $arg1, $arg2) {
|
|
@@ -102,6 +105,10 @@ class Resp extends Object_ext {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+// </editor-fold>
|
|
|
+ // <editor-fold defaultstate="collapsed" desc="附加Tags带回">
|
|
|
+
|
|
|
+
|
|
|
static $ext_tag = null;
|
|
|
|
|
|
/**
|
|
@@ -116,4 +123,5 @@ class Resp extends Object_ext {
|
|
|
self::$ext_tag->$name = $value;
|
|
|
}
|
|
|
|
|
|
+// </editor-fold>
|
|
|
}
|