r100053 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100052‎ | r100053 | r100054 >
Date:17:03, 17 October 2011
Author:dasch
Status:deferred (Comments)
Tags:
Comment:
all tabs
improved PHP check
Modified paths:
  • /trunk/extensions/Diagnosis/Diagnosis.i18n.php (modified) (history)
  • /trunk/extensions/Diagnosis/Diagnosis.php (modified) (history)
  • /trunk/extensions/Diagnosis/SpecialDiagnosis.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Diagnosis/Diagnosis.i18n.php
@@ -16,28 +16,28 @@
1717
1818 /* *** English *** */
1919 $aliases['en'] = array(
20 - 'Diagnosis' => array( 'Diagnosis' ),
 20+ 'Diagnosis' => array( 'Diagnosis' ),
2121 );
2222 $messages['en'] = array(
23 - 'diagnosis' => 'Diagnosis',
24 - 'diagnosis-desc' => 'Extension to find possible problems and errors or security risks',
 23+ 'diagnosis' => 'Diagnosis',
 24+ 'diagnosis-desc' => 'Extension to find possible problems and errors or security risks',
2525 );
2626
2727 /** Message documentation (Message documentation) */
2828 $aliases['qqq'] = array(
29 - 'Diagnosis' => array( 'Diagnosis' ),
 29+ 'Diagnosis' => array( 'Diagnosis' ),
3030 );
3131
3232 $messages['qqq'] = array(
33 - 'diagnosis' => 'Diagnosis',
34 - 'diagnosis-desc' => 'Extensions description',
 33+ 'diagnosis' => 'Diagnosis',
 34+ 'diagnosis-desc' => 'Extensions description',
3535 );
3636
3737 /* *** German (Deutsch) *** */
3838 $aliases['de'] = array(
39 - 'Diagnosis' => array( 'Diagnose' ),
 39+ 'Diagnosis' => array( 'Diagnose' ),
4040 );
4141 $messages['de'] = array(
42 - 'diagnosis' => 'Diagnose',
43 - 'diagnosis-desc' => 'Erweiterung um Probleme, Fehler oder Sicherheitsl�cken zu finden',
 42+ 'diagnosis' => 'Diagnose',
 43+ 'diagnosis-desc' => 'Erweiterung um Probleme, Fehler oder Sicherheitslücken zu finden',
4444 );
\ No newline at end of file
Index: trunk/extensions/Diagnosis/Diagnosis.php
@@ -1,20 +1,20 @@
22 <?php
33 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
44 if (!defined('MEDIAWIKI')) {
5 - echo <<<EOT
 5+ echo <<<EOT
66 To install my extension, put the following line in LocalSettings.php:
77 require_once( "\$IP/extensions/Diagnosis/Diagnosis.php" );
88 EOT;
9 - exit( 1 );
 9+ exit( 1 );
1010 }
1111
1212 $wgExtensionCredits['specialpage'][] = array(
1313 'path' => __FILE__,
14 - 'name' => 'Diagnosis',
15 - 'author' => '[http://www.dasch-tour.de DaSch]',
16 - 'url' => 'http://www.mediawiki.org/wiki/Extension:Diagnosis',
17 - 'descriptionmsg' => 'diagnosis-desc',
18 - 'version' => '0.0.1',
 14+ 'name' => 'Diagnosis',
 15+ 'author' => '[http://www.dasch-tour.de DaSch]',
 16+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Diagnosis',
 17+ 'descriptionmsg' => 'diagnosis-desc',
 18+ 'version' => '0.0.1',
1919 );
2020
2121 $dir = dirname(__FILE__) . '/';
Index: trunk/extensions/Diagnosis/SpecialDiagnosis.php
@@ -1,15 +1,13 @@
22 <?php
33 class SpecialDiagnosis extends SpecialPage {
4 - function __construct() {
5 - parent::__construct( 'Diagnosis', 'diagnosis-access' );
6 - wfLoadExtensionMessages('Diagnosis');
7 - }
 4+ function __construct() {
 5+ parent::__construct( 'Diagnosis', 'diagnosis-access' );
 6+ }
 7+ function execute( $par ) {
 8+ global $wgRequest, $wgOut, $wgShellLocale, $wgImageMagickConvertCommand ,$wgSVGConverterPath, $wgSVGConverters;
89
9 - function execute( $par ) {
10 - global $wgRequest, $wgOut, $wgShellLocale, $wgImageMagickConvertCommand ,$wgSVGConverterPath, $wgSVGConverters;
11 -
12 - $this->setHeaders();
13 -
 10+ $this->setHeaders();
 11+
1412 $wgOut->addHTML( '<table class=wikitable>' );
1513 $wgOut->addHTML( '<tr>' );
1614 $wgOut->addHTML( '<th>Parameter</th>' );
@@ -71,23 +69,36 @@
7270 $wgOut->addHTML( '<tr>' );
7371 $wgOut->addHTML( '<td>PHP Extensions</td>' );
7472 $sdPHPExtensions = get_loaded_extensions();
75 - $wgOut->addHTML( '<td colspan=2>' );
 73+ $wgOut->addHTML( '<td>' );
7674 foreach ($sdPHPExtensions as $value) {
7775 $wgOut->addHTML($value . '<br/>');
7876 }
7977 $wgOut->addHTML('</td>' );
 78+ $wgOut->addHTML( '<td> Minimum:<br/>SPL<br/>pcre</td>' );
8079 $wgOut->addHTML( '<td> Loaded PHP Extensions </td>' );
81 - if ( true ) {
82 - $sdSVGPathStatus='OK';
 80+ if ( in_array('SPL',$sdPHPExtensions) ) {
 81+ $sdSPL = true;
 82+ }
 83+ else {
 84+ $sdSPL = false;
 85+ }
 86+ if ( in_array('pcre',$sdPHPExtensions) ) {
 87+ $sdpcre = true;
 88+ }
 89+ else {
 90+ $sdpcre = false;
 91+ }
 92+ if ( $sdpcre and $sdSPL ) {
 93+ $sdPHPStatus='OK';
8394 }
8495 else {
85 - $sdSVGPathStatus='ERROR';
 96+ $sdPHPStatus='ERROR';
8697 }
87 - $wgOut->addHTML( '<td>' . $sdSVGPathStatus . '</td>' );
 98+ $wgOut->addHTML( '<td>' . $sdPHPStatus . '</td>' );
8899 $wgOut->addHTML( '</tr>' );
89100
90101
91102 ### End Table ###
92103 $wgOut->addHTML( '</table>' );
93 - }
 104+ }
94105 }
\ No newline at end of file

Comments

#Comment by Raymond (talk | contribs)   18:04, 17 October 2011

This looks over-tabbed now.

Status & tagging log