}
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 array(
- 'Reason' => array(
+ return [
+ 'Reason' => [
'type' => 'textarea',
'rows' => 4,
'vertical-label' => true,
'label-message' => 'enterlockreason',
- ),
- 'Confirm' => array(
+ ],
+ 'Confirm' => [
'type' => 'toggle',
'label-message' => 'lockconfirm',
- ),
- );
+ ],
+ ];
}
protected function alterForm( HTMLForm $form ) {
- $form->setWrapperLegend( false );
- $form->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() );
- $form->setSubmitTextMsg( 'lockbtn' );
+ $form->setWrapperLegend( false )
+ ->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() )
+ ->setSubmitTextMsg( 'lockbtn' );
}
public function onSubmit( array $data ) {
$out->addWikiMsg( 'lockdbsuccesstext' );
}
+ protected function getDisplayFormat() {
+ return 'ooui';
+ }
+
protected function getGroupName() {
return 'wiki';
}