Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

事件CWebApplication.onendrequest 附加一个无效的handler "NULL"讨论笔记 #12

Open
yinhe opened this issue Jan 10, 2014 · 3 comments

Comments

@yinhe
Copy link
Member

yinhe commented Jan 10, 2014

qq20140110091404
qq20140110091337
补图

亦清(61391362) 20:48:27
上次 那个 onbeginrequest 问题可能是
php版本 跟yii版本问题引起的

亦清(61391362) 20:48:39
我今天也碰到了

54xiaosu(87753586) 22:25:35
这个是yii的bug

54xiaosu(87753586) 22:26:42
saveglobalstate 里面居然还detach掉

亦清(61391362) 22:27:31
根源在于 给事件监听器 弄了个匿名函数的缘故

亦清(61391362) 22:28:09
1

亦清(61391362) 22:28:21
在php 某些版本上会表现不同

亦清(61391362) 22:28:38
5.3是可以的 但到5.4 就出错

54xiaosu(87753586) 22:29:13
wait

54xiaosu(87753586) 22:30:50
qq20140110084712

54xiaosu (87753586) 22:30:52
就好似这个

54xiaosu(87753586) 22:32:44
可以去掉里面的detach 或者将listiterator改为非引用

54xiaosu(87753586) 22:33:30
一般不用 global 那玩意

54xiaosu(87753586) 22:34:13
或者配置里面将 securitymanager 的两个key 自己配置上 就不用管那个bug了 也别用那个 global

亦清(61391362) 22:35:44
3

54xiaosu(87753586) 22:37:34
开启 request的那写个 valication

54xiaosu(87753586) 22:37:54
然后删除 runtime/state.bin

54xiaosu(87753586) 22:38:31
不要设置securitymanager的key

54xiaosu(87753586) 22:39:50
执行
Yii::app()->request->cookies; #这个为了是global哪里发生改变 添加 onendrequest 事件
然后再添加个 onendrequest 事件

54xiaosu(87753586) 22:39:55
问题就会再现

54xiaosu(87753586) 22:41:20
'securityManager' => array(
'class' => 'CSecurityManager',
'validationKey' => '5e99dbc544c55a9fe39dac8f5417cb74',
'encryptionKey' => 'd21f7c15998be10c06b543d6416874fa',
),

54xiaosu(87753586) 22:41:51
配置里加上这个,然后不要使用那globalstate那玩意 除非你修复那bug

@yinhe
Copy link
Member Author

yinhe commented Jan 10, 2014

第一次进入后台的时候会报这个错误,刷新之后就不会再出现

@qiansen1386
Copy link

@qiansen1386
Copy link

有一个外国小伙伴帮我们简化了https://github.com/yincart/basic/blob/master/backend.php#L3
然后德国大神现身,指出该问题应该是yiisoft/yii#1191 Issue的重复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants