문제

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

도움이 되었습니까?

해결책

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top