Closed damyon closed 7 years ago
I don't know if it's me but this is crazy slow! ... never mind...
PHP Warning: file_get_contents(https://randomuser.me/api/): failed to open stream: Connection timed out in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 23
PHP Warning: reset() expects parameter 1 to be array, null given in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 25
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 70
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 70
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 70
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 70
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 73
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 73
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 74
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 74
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 36
PHP Notice: Trying to get property of non-object in /home/fred/moodles/sm/moodle/mdkscriptrun.php on line 36
I'd like to merge this with the other script generator, but I don't want to badly affect performance. I guess we could try to curl with a timeout of 2 seconds and fallback on the other users when it fails.
Thanks Damyon.
I've merged your patch and then merged all in one users file. It now fallsback on the old behaviour should the API be down like it happened to me. I also added the city and country to the users.
The admin user only gets its email filled in now.
Thanks! Fred
Also will fix an incomplete admin user from a new install.