use Wikimedia\Timestamp\ConvertibleTimestamp;
use Wikimedia\WaitConditionLoop;
-use Wikimedia;
+use Wikimedia\AtEase\AtEase;
use Exception;
/**
);
}
+ $this->close();
+
$this->server = $server;
$this->user = $user;
$this->password = $password;
}
$this->connectString = $this->makeConnectionString( $connectVars );
- $this->close();
- $this->installErrorHandler();
+ $this->installErrorHandler();
try {
// Use new connections to let LoadBalancer/LBFactory handle reuse
$this->conn = pg_connect( $this->connectString, PGSQL_CONNECT_FORCE_NEW );
$this->restoreErrorHandler();
throw $ex;
}
-
$phpError = $this->restoreErrorHandler();
if ( !$this->conn ) {
}
public function freeResult( $res ) {
- Wikimedia\suppressWarnings();
+ AtEase::suppressWarnings();
$ok = pg_free_result( ResultWrapper::unwrap( $res ) );
- Wikimedia\restoreWarnings();
+ AtEase::restoreWarnings();
if ( !$ok ) {
throw new DBUnexpectedError( $this, "Unable to free Postgres result\n" );
}
}
public function fetchObject( $res ) {
- Wikimedia\suppressWarnings();
+ AtEase::suppressWarnings();
$row = pg_fetch_object( ResultWrapper::unwrap( $res ) );
- Wikimedia\restoreWarnings();
+ AtEase::restoreWarnings();
# @todo FIXME: HACK HACK HACK HACK debug
# @todo hashar: not sure if the following test really trigger if the object
}
public function fetchRow( $res ) {
- Wikimedia\suppressWarnings();
+ AtEase::suppressWarnings();
$row = pg_fetch_array( ResultWrapper::unwrap( $res ) );
- Wikimedia\restoreWarnings();
+ AtEase::restoreWarnings();
$conn = $this->getBindingHandle();
if ( pg_last_error( $conn ) ) {
return 0;
}
- Wikimedia\suppressWarnings();
+ AtEase::suppressWarnings();
$n = pg_num_rows( ResultWrapper::unwrap( $res ) );
- Wikimedia\restoreWarnings();
+ AtEase::restoreWarnings();
$conn = $this->getBindingHandle();
if ( pg_last_error( $conn ) ) {
// See https://www.postgresql.org/docs/8.3/sql-set.html
throw new DBUnexpectedError(
$this,
- __METHOD__ . ": a transaction is currently active."
+ __METHOD__ . ": a transaction is currently active"
);
}