protected $bufferSize = 524288; // In bytes. Maximum size to read from the stub in on go.
- protected $php = "php";
+ /** @var array */
+ protected $php = [];
protected $spawn = false;
/**
protected $spawnProc = false;
/**
- * @var bool|resource
+ * @var resource
*/
- protected $spawnWrite = false;
+ protected $spawnWrite;
/**
- * @var bool|resource
+ * @var resource
*/
- protected $spawnRead = false;
+ protected $spawnRead;
/**
* @var bool|resource
protected $firstPageWritten = false;
protected $lastPageWritten = false;
protected $checkpointJustWritten = false;
+ /** @var string[] */
protected $checkpointFiles = [];
/**
* This function resets $this->lb and closes all connections on it.
*
* @throws MWException
+ * @suppress PhanTypeObjectUnsetDeclaredProperty
*/
function rotateDb() {
// Cleaning up old connections
}
try {
- $this->db = $this->lb->getConnection( DB_REPLICA, 'dump' );
+ $this->db = $this->lb->getMaintenanceConnectionRef( DB_REPLICA, 'dump' );
} catch ( Exception $e ) {
throw new MWException( __METHOD__
. " rotating DB failed to obtain new database (" . $e->getMessage() . ")" );
$param = $split[1];
}
$fileURIs = explode( ';', $param );
+ $newFileURIs = [];
foreach ( $fileURIs as $URI ) {
switch ( $val ) {
case "file":
/**
* @throws MWException Failure to parse XML input
- * @param string $input
+ * @param resource $input
* @return bool
*/
function readDump( $input ) {
if ( $this->spawnRead ) {
fclose( $this->spawnRead );
}
- $this->spawnRead = false;
+ $this->spawnRead = null;
if ( $this->spawnWrite ) {
fclose( $this->spawnWrite );
}
- $this->spawnWrite = false;
+ $this->spawnWrite = null;
if ( $this->spawnErr ) {
fclose( $this->spawnErr );
}