mirror of
https://github.com/php/web-wiki.git
synced 2025-08-13 13:33:46 +00:00
Cache querying for user information, as that requires an HTTP call to main.php.net
This commit is contained in:
@ -69,7 +69,11 @@ class auth_plugin_phpcvs extends auth_plugin_authplain {
|
||||
*
|
||||
* @return bool true or int error code
|
||||
*/
|
||||
function _checkCVSPass($user,$pass = ''){
|
||||
function _checkCVSPass($user, $pass = '')
|
||||
{
|
||||
static $userCache = [];
|
||||
|
||||
if (!array_key_exists($user, $userCache)) {
|
||||
$post = http_build_query(
|
||||
array(
|
||||
"token" => getenv("dokuwikitoken"),
|
||||
@ -89,6 +93,10 @@ class auth_plugin_phpcvs extends auth_plugin_authplain {
|
||||
$s = file_get_contents("https://main.php.net/fetch/cvsauth.php", false, $ctx);
|
||||
|
||||
$a = unserialize($s);
|
||||
$userCache[$user] = $a;
|
||||
} else {
|
||||
$a = $userCache[$user];
|
||||
}
|
||||
/*
|
||||
define("E_UNKNOWN", 0);
|
||||
define("E_USERNAME", 1);
|
||||
|
Reference in New Issue
Block a user