我尝试在UserLoadFromSession挂钩上以编程方式创建媒体wiki用户。 我使用follwing代码来创建用户
$user12 = new User(); $user12->setToken(); $user12->mEmail = $email; $user12->mName = $userName; // Redundant given use of loadDefaults...? $user12->mRealName = $RealName; $mystatus = $user12->addToDatabase();当我检查状态确定我在DatabaseMysql上调试upQuery函数,但它不是在我的mysql数据库上创建用户。 这对我的开发环境(带有mysql服务器的Windows计算机)以及生产(Linux和亚马逊RDS)都有影响
请帮我解决这个问题
I'm try to create media wiki user programmatically on UserLoadFromSession hooks. I use follwing code to create user
$user12 = new User(); $user12->setToken(); $user12->mEmail = $email; $user12->mName = $userName; // Redundant given use of loadDefaults...? $user12->mRealName = $RealName; $mystatus = $user12->addToDatabase();when i check status ok i debug upto doQuery function on DatabaseMysql but it's not create a user on my mysql database. this heppn both on my development environment (Windows computer with mysql server) as well as production (Linux and amazon RDS)
please help me to sort out this
最满意答案
对于任何有相同问题的人,我找到了一个解决方案,因为使用UserLoadFromSession钩子内部不需要再次创建用户对象,使用相同的用户对象。 并且也不要忘记使用更新站点统计信息。
$ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 ); $ssUpdate->doUpdate();For anyone who has same problem i found a solution since this using inside UserLoadFromSession hooks no need to create user object again, use same user object. and also don't forget to update site statistics too using.
$ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 ); $ssUpdate->doUpdate();更多推荐
发布评论