return $ret;
}
+ /**
+ * @inheritDoc
+ */
public function store( $location, $data ) {
$dbw = $this->getMaster( $location );
$dbw->insert( $this->getTable( $dbw ),
return "DB://$location/$id";
}
+ /**
+ * @inheritDoc
+ */
public function isReadOnly( $location ) {
- return ( $this->getLoadBalancer( $location )->getReadOnlyReason() !== false );
+ $lb = $this->getLoadBalancer( $location );
+ $domainId = $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) );
+ return ( $lb->getReadOnlyReason( $domainId ) !== false );
}
/**
* @return string|bool Database domain ID or false
*/
private function getDomainId( array $server ) {
- if ( isset( $this->params['wiki'] ) ) {
+ if ( isset( $this->params['wiki'] ) && $this->params['wiki'] !== false ) {
return $this->params['wiki']; // explicit domain
}