$id = FALSE;
if( $wgLinkCacheMemcached )
$id = $wgMemc->get( $key = $this->getKey( $title ) );
- if( $id === FALSE ) {
+ if( ! $id ) {
$sql = "SELECT cur_id FROM cur WHERE cur_namespace=" .
"{$ns} AND cur_title='" . wfStrencode( $t ) . "'";
$res = wfQuery( $sql, DB_READ, "LinkCache::addLink" );
function memsess_read( $id ) {
global $wgMemc;
$data = $wgMemc->get( memsess_key( $id ) );
- if( $data === FALSE ) return "";
+ if( ! $data ) return "";
return $data;
}
global $wgDBname, $wgMemc;
$key = "$wgDBname:newtalk:ip:{$this->mName}";
$newtalk = $wgMemc->get( $key );
- if($newtalk === false) {
+ if( ! is_integer($newtalk) ) {
$sql = "SELECT 1 FROM user_newtalk WHERE user_ip='{$this->mName}'";
$res = wfQuery ($sql, DB_READ, "User::loadFromDatabase" );
global $wgMemc;
$key = $this->watchKey();
$iswatched = $wgMemc->get( $key );
- if( $iswatched !== false ) return $iswatched;
+ if( is_integer( $iswatched ) ) return $iswatched;
$sql = "SELECT 1 FROM watchlist WHERE wl_user=$this->id AND wl_namespace=$this->ns AND wl_title='$this->eti'";
$res = wfQuery( $sql, DB_READ );
- $iswatched = (wfNumRows( $res ) > 0);
+ $iswatched = (wfNumRows( $res ) > 0) ? 1 : 0;
$wgMemc->set( $key, $iswatched );
return $iswatched;
}