$all = false;
}
+ if ( isset( $row->user_id ) && isset( $row->user_name ) ) {
+ self::$idCacheByName[$row->user_name] = $row->user_id;
+ }
+
if ( isset( $row->user_editcount ) ) {
$this->mEditCount = $row->user_editcount;
} else {
// Anon newtalk disabled by configuration.
$this->mNewtalk = false;
} else {
- global $wgMemc;
- $key = wfMemcKey( 'newtalk', 'ip', $this->getName() );
- $newtalk = $wgMemc->get( $key );
- if ( strval( $newtalk ) !== '' ) {
- $this->mNewtalk = (bool)$newtalk;
- } else {
- // Since we are caching this, make sure it is up to date by getting it
- // from the master
- $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName(), true );
- $wgMemc->set( $key, (int)$this->mNewtalk, 1800 );
- }
+ $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName() );
}
} else {
$this->mNewtalk = $this->checkNewtalk( 'user_id', $this->mId );
* @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
* is passed.
*/
- protected function setCookie( $name, $value, $exp = 0, $secure = null, $params = array(), $request = null ) {
+ protected function setCookie(
+ $name, $value, $exp = 0, $secure = null, $params = array(), $request = null
+ ) {
if ( $request === null ) {
$request = $this->getRequest();
}
/**
* Get a list of all available permissions.
- * @return array Array of permission names
+ * @return string[] Array of permission names
*/
public static function getAllRights() {
if ( self::$mAllRights === false ) {