Exemplo n.º 1
0
 /**
  * Clears the list of sites stored in the database.
  *
  * @see SiteStore::clear()
  *
  * @return bool Success
  */
 public function clear()
 {
     $dbw = $this->dbLoadBalancer->getConnection(DB_MASTER);
     $dbw->startAtomic(__METHOD__);
     $ok = $dbw->delete('sites', '*', __METHOD__);
     $ok = $dbw->delete('site_identifiers', '*', __METHOD__) && $ok;
     $dbw->endAtomic(__METHOD__);
     $this->dbLoadBalancer->reuseConnection($dbw);
     $this->reset();
     return $ok;
 }
Exemplo n.º 2
0
 /**
  * Clean up the connection when out of scope
  */
 function __destruct()
 {
     if ($this->conn !== null) {
         $this->lb->reuseConnection($this->conn);
     }
 }
Exemplo n.º 3
0
 /**
  * @param DatabaseBase $connection
  *
  * @throws MWException
  */
 private function reuseConnection($connection)
 {
     $this->loadBalancer->reuseConnection($connection);
 }