Cache user id instead of full user object in the userlogins cache. Props charleshooper. fixes #3716

git-svn-id: https://develop.svn.wordpress.org/trunk@4859 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-02-02 00:00:36 +00:00
parent 26f5beaa3d
commit 609db68a78
2 changed files with 6 additions and 6 deletions

View File

@ -96,8 +96,7 @@ function get_userdata( $user_id ) {
$user->user_description = $user->description; $user->user_description = $user->description;
wp_cache_add($user_id, $user, 'users'); wp_cache_add($user_id, $user, 'users');
wp_cache_add($user->user_login, $user, 'userlogins'); wp_cache_add($user->user_login, $user_id, 'userlogins');
return $user; return $user;
} }
endif; endif;
@ -116,7 +115,9 @@ function get_userdatabylogin($user_login) {
if ( empty( $user_login ) ) if ( empty( $user_login ) )
return false; return false;
$userdata = wp_cache_get($user_login, 'userlogins'); $user_id = wp_cache_get($user_login, 'userlogins');
$userdata = wp_cache_get($user_id, 'users');
if ( $userdata ) if ( $userdata )
return $userdata; return $userdata;
@ -147,8 +148,7 @@ function get_userdatabylogin($user_login) {
$user->user_description = $user->description; $user->user_description = $user->description;
wp_cache_add($user->ID, $user, 'users'); wp_cache_add($user->ID, $user, 'users');
wp_cache_add($user->user_login, $user, 'userlogins'); wp_cache_add($user->user_login, $user->ID, 'userlogins');
return $user; return $user;
} }

View File

@ -3,6 +3,6 @@
// This holds the version number in a separate file so we can bump it without cluttering the SVN // This holds the version number in a separate file so we can bump it without cluttering the SVN
$wp_version = '2.2-bleeding'; $wp_version = '2.2-bleeding';
$wp_db_version = 4774; $wp_db_version = 4859;
?> ?>