r69529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69528‎ | r69529 | r69530 >
Date:04:15, 19 July 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Clarified field and method visibility
Modified paths:
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -78,7 +78,8 @@
7979 }
8080
8181 class WebInstaller_Language extends WebInstallerPage {
82 - function execute() {
 82+
 83+ public function execute() {
8384 global $wgLang;
8485 $r = $this->parent->request;
8586 $userLang = $r->getVal( 'UserLang' );
@@ -141,9 +142,9 @@
142143 }
143144
144145 /**
145 - * Get a <select> for selecting languages
 146+ * Get a <select> for selecting languages.
146147 */
147 - function getLanguageSelector( $name, $label, $selectedCode ) {
 148+ public function getLanguageSelector( $name, $label, $selectedCode ) {
148149 global $wgDummyLanguageCodes;
149150 $s = Xml::openElement( 'select', array( 'id' => $name, 'name' => $name ) ) . "\n";
150151
@@ -157,10 +158,12 @@
158159 $s .= "\n</select>\n";
159160 return $this->parent->label( $label, $name, $s );
160161 }
 162+
161163 }
162164
163165 class WebInstaller_Welcome extends WebInstallerPage {
164 - function execute() {
 166+
 167+ public function execute() {
165168 if ( $this->parent->request->wasPosted() ) {
166169 if ( $this->getVar( '_Environment' ) ) {
167170 return 'continue';
@@ -174,10 +177,12 @@
175178 $this->endForm();
176179 }
177180 }
 181+
178182 }
179183
180184 class WebInstaller_DBConnect extends WebInstallerPage {
181 - function execute() {
 185+
 186+ public function execute() {
182187 $r = $this->parent->request;
183188 if ( $r->wasPosted() ) {
184189 $status = $this->submit();
@@ -189,7 +194,6 @@
190195 }
191196 }
192197
193 -
194198 $this->startForm();
195199
196200 $types = "<ul class=\"config-settings-block\">\n";
@@ -225,7 +229,7 @@
226230 $this->endForm();
227231 }
228232
229 - function submit() {
 233+ public function submit() {
230234 $r = $this->parent->request;
231235 $type = $r->getVal( 'DBType' );
232236 $this->setVar( 'wgDBtype', $type );
@@ -235,10 +239,12 @@
236240 }
237241 return $installer->submitConnectForm();
238242 }
 243+
239244 }
240245
241246 class WebInstaller_Upgrade extends WebInstallerPage {
242 - function execute() {
 247+
 248+ public function execute() {
243249 if ( $this->getVar( '_UpgradeDone' ) ) {
244250 if ( $this->parent->request->wasPosted() ) {
245251 // Done message acknowledged
@@ -285,7 +291,7 @@
286292 $this->endForm();
287293 }
288294
289 - function showDoneMessage() {
 295+ public function showDoneMessage() {
290296 $this->startForm();
291297 $this->addHTML(
292298 $this->parent->getInfoBox(
@@ -298,10 +304,12 @@
299305 );
300306 $this->endForm( 'regenerate' );
301307 }
 308+
302309 }
303310
304311 class WebInstaller_DBSettings extends WebInstallerPage {
305 - function execute() {
 312+
 313+ public function execute() {
306314 $installer = $this->parent->getDBInstaller( $this->getVar( 'wgDBtype' ) );
307315
308316 $r = $this->parent->request;
@@ -329,7 +337,8 @@
330338 }
331339
332340 class WebInstaller_Name extends WebInstallerPage {
333 - function execute() {
 341+
 342+ public function execute() {
334343 $r = $this->parent->request;
335344 if ( $r->wasPosted() ) {
336345 if ( $this->submit() ) {
@@ -407,7 +416,7 @@
408417 return 'output';
409418 }
410419
411 - function submit() {
 420+ public function submit() {
412421 $retVal = true;
413422 $this->parent->setVarsFromRequest( array( 'wgSitename', '_NamespaceType',
414423 '_AdminName', '_AdminPassword', '_AdminPassword2', '_AdminEmail',
@@ -494,10 +503,12 @@
495504 }
496505 return $retVal;
497506 }
 507+
498508 }
499509
500510 class WebInstaller_Options extends WebInstallerPage {
501 - function execute() {
 511+
 512+ public function execute() {
502513 if ( $this->getVar( '_SkipOptional' ) == 'skip' ) {
503514 return 'skip';
504515 }
@@ -643,7 +654,7 @@
644655 $this->endForm();
645656 }
646657
647 - function getCCPartnerUrl() {
 658+ public function getCCPartnerUrl() {
648659 global $wgServer;
649660 $exitUrl = $wgServer . $this->parent->getUrl( array(
650661 'page' => 'Options',
@@ -665,7 +676,7 @@
666677 return $iframeUrl;
667678 }
668679
669 - function getCCChooser() {
 680+ public function getCCChooser() {
670681 $iframeAttribs = array(
671682 'class' => 'config-cc-iframe',
672683 'name' => 'config-cc-iframe',
@@ -686,7 +697,7 @@
687698 "</div>\n";
688699 }
689700
690 - function getCCDoneBox() {
 701+ public function getCCDoneBox() {
691702 $js = "parent.document.getElementById('config-cc-wrapper').style.height = '$1';";
692703 // If you change this height, also change it in config.css
693704 $expandJs = str_replace( '$1', '54em', $js );
@@ -713,8 +724,7 @@
714725 "</script>\n";
715726 }
716727
717 -
718 - function submitCC() {
 728+ public function submitCC() {
719729 $newValues = $this->parent->setVarsFromRequest(
720730 array( 'wgRightsUrl', 'wgRightsText', 'wgRightsIcon' ) );
721731 if ( count( $newValues ) != 3 ) {
@@ -725,7 +735,7 @@
726736 $this->addHTML( $this->getCCDoneBox() );
727737 }
728738
729 - function submit() {
 739+ public function submit() {
730740 $this->parent->setVarsFromRequest( array( '_RightsProfile', '_LicenseCode',
731741 'wgEnableEmail', 'wgPasswordSender', 'wgEnableUpload', 'wgLogo',
732742 'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
@@ -769,11 +779,12 @@
770780 $this->parent->setVar( '_Extensions', $exts );
771781 return true;
772782 }
 783+
773784 }
774785
775786 class WebInstaller_Install extends WebInstallerPage {
776787
777 - function execute() {
 788+ public function execute() {
778789 if( $this->parent->request->wasPosted() ) {
779790 return 'continue';
780791 } elseif( $this->getVar( '_InstallDone' ) ) {
@@ -810,9 +821,11 @@
811822 $this->parent->showStatusBox( $status );
812823 }
813824 }
 825+
814826 }
815827
816828 class WebInstaller_Complete extends WebInstallerPage {
 829+
817830 public function execute() {
818831 global $IP;
819832 $this->startForm();
@@ -831,7 +844,8 @@
832845 }
833846
834847 class WebInstaller_Restart extends WebInstallerPage {
835 - function execute() {
 848+
 849+ public function execute() {
836850 $r = $this->parent->request;
837851 if ( $r->wasPosted() ) {
838852 $really = $r->getVal( 'submit-restart' );
@@ -848,19 +862,21 @@
849863 $this->addHTML( $s );
850864 $this->endForm( 'restart' );
851865 }
 866+
852867 }
853868
854869 abstract class WebInstaller_Document extends WebInstallerPage {
855 - abstract function getFileName();
 870+
 871+ protected abstract function getFileName();
856872
857 - function execute() {
 873+ public function execute() {
858874 $text = $this->getFileContents();
859875 $this->parent->output->addWikiText( $text );
860876 $this->startForm();
861877 $this->endForm( false );
862878 }
863879
864 - function getFileContents() {
 880+ public function getFileContents() {
865881 return file_get_contents( dirname( __FILE__ ) . '/../../' . $this->getFileName() );
866882 }
867883
@@ -895,36 +911,44 @@
896912 return '<span class="config-plainlink">[http://www.mediawiki.org/wiki/Manual:' .
897913 $matches[1] . ' ' . $matches[1] . ']</span>';
898914 }
 915+
899916 }
900917
901918 class WebInstaller_Readme extends WebInstaller_Document {
902 - function getFileName() { return 'README'; }
 919+
 920+ protected function getFileName() { return 'README'; }
903921
904 - function getFileContents() {
 922+ public function getFileContents() {
905923 return $this->formatTextFile( parent::getFileContents() );
906924 }
 925+
907926 }
908927
909928 class WebInstaller_ReleaseNotes extends WebInstaller_Document {
910 - function getFileName() { return 'RELEASE-NOTES'; }
 929+
 930+ protected function getFileName() { return 'RELEASE-NOTES'; }
911931
912 - function getFileContents() {
 932+ public function getFileContents() {
913933 return $this->formatTextFile( parent::getFileContents() );
914934 }
 935+
915936 }
916937
917938 class WebInstaller_UpgradeDoc extends WebInstaller_Document {
918 - function getFileName() { return 'UPGRADE'; }
 939+
 940+ protected function getFileName() { return 'UPGRADE'; }
919941
920 - function getFileContents() {
 942+ public function getFileContents() {
921943 return $this->formatTextFile( parent::getFileContents() );
922944 }
 945+
923946 }
924947
925948 class WebInstaller_Copying extends WebInstaller_Document {
926 - function getFileName() { return 'COPYING'; }
 949+
 950+ protected function getFileName() { return 'COPYING'; }
927951
928 - function getFileContents() {
 952+ public function getFileContents() {
929953 $text = parent::getFileContents();
930954 $text = str_replace( "\x0C", '', $text );
931955 $text = preg_replace_callback( '/\n[ \t]+/m', array( 'WebInstaller_Copying', 'replaceLeadingSpaces' ), $text );
@@ -935,4 +959,5 @@
936960 private static function replaceLeadingSpaces( $matches ) {
937961 return "\n" . str_repeat( '&#160;', strlen( $matches[0] ) );
938962 }
 963+
939964 }
\ No newline at end of file

Status & tagging log