}
public function doesWrites() {
- return true;
+ return false;
}
public function requiresWrite() {
if ( !is_writable( dirname( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) ) {
throw new ErrorPageError( 'lockdb', 'lockfilenotwritable' );
}
+ if ( file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) {
+ throw new ErrorPageError( 'lockdb', 'databaselocked' );
+ }
}
protected function getFormFields() {
return Status::newFatal( 'locknoconfirm' );
}
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$fp = fopen( $this->getConfig()->get( 'ReadOnlyFile' ), 'w' );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( false === $fp ) {
# This used to show a file not found error, but the likeliest reason for fopen()