Index: trunk/extensions/Diagnosis/Diagnosis.i18n.php |
— | — | @@ -16,28 +16,28 @@ |
17 | 17 | |
18 | 18 | /* *** English *** */ |
19 | 19 | $aliases['en'] = array( |
20 | | - 'Diagnosis' => array( 'Diagnosis' ), |
| 20 | + 'Diagnosis' => array( 'Diagnosis' ), |
21 | 21 | ); |
22 | 22 | $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', |
25 | 25 | ); |
26 | 26 | |
27 | 27 | /** Message documentation (Message documentation) */ |
28 | 28 | $aliases['qqq'] = array( |
29 | | - 'Diagnosis' => array( 'Diagnosis' ), |
| 29 | + 'Diagnosis' => array( 'Diagnosis' ), |
30 | 30 | ); |
31 | 31 | |
32 | 32 | $messages['qqq'] = array( |
33 | | - 'diagnosis' => 'Diagnosis', |
34 | | - 'diagnosis-desc' => 'Extensions description', |
| 33 | + 'diagnosis' => 'Diagnosis', |
| 34 | + 'diagnosis-desc' => 'Extensions description', |
35 | 35 | ); |
36 | 36 | |
37 | 37 | /* *** German (Deutsch) *** */ |
38 | 38 | $aliases['de'] = array( |
39 | | - 'Diagnosis' => array( 'Diagnose' ), |
| 39 | + 'Diagnosis' => array( 'Diagnose' ), |
40 | 40 | ); |
41 | 41 | $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', |
44 | 44 | ); |
\ No newline at end of file |
Index: trunk/extensions/Diagnosis/Diagnosis.php |
— | — | @@ -1,20 +1,20 @@ |
2 | 2 | <?php |
3 | 3 | # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly. |
4 | 4 | if (!defined('MEDIAWIKI')) { |
5 | | - echo <<<EOT |
| 5 | + echo <<<EOT |
6 | 6 | To install my extension, put the following line in LocalSettings.php: |
7 | 7 | require_once( "\$IP/extensions/Diagnosis/Diagnosis.php" ); |
8 | 8 | EOT; |
9 | | - exit( 1 ); |
| 9 | + exit( 1 ); |
10 | 10 | } |
11 | 11 | |
12 | 12 | $wgExtensionCredits['specialpage'][] = array( |
13 | 13 | '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', |
19 | 19 | ); |
20 | 20 | |
21 | 21 | $dir = dirname(__FILE__) . '/'; |
Index: trunk/extensions/Diagnosis/SpecialDiagnosis.php |
— | — | @@ -1,15 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | 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; |
8 | 9 | |
9 | | - function execute( $par ) { |
10 | | - global $wgRequest, $wgOut, $wgShellLocale, $wgImageMagickConvertCommand ,$wgSVGConverterPath, $wgSVGConverters; |
11 | | - |
12 | | - $this->setHeaders(); |
13 | | - |
| 10 | + $this->setHeaders(); |
| 11 | + |
14 | 12 | $wgOut->addHTML( '<table class=wikitable>' ); |
15 | 13 | $wgOut->addHTML( '<tr>' ); |
16 | 14 | $wgOut->addHTML( '<th>Parameter</th>' ); |
— | — | @@ -71,23 +69,36 @@ |
72 | 70 | $wgOut->addHTML( '<tr>' ); |
73 | 71 | $wgOut->addHTML( '<td>PHP Extensions</td>' ); |
74 | 72 | $sdPHPExtensions = get_loaded_extensions(); |
75 | | - $wgOut->addHTML( '<td colspan=2>' ); |
| 73 | + $wgOut->addHTML( '<td>' ); |
76 | 74 | foreach ($sdPHPExtensions as $value) { |
77 | 75 | $wgOut->addHTML($value . '<br/>'); |
78 | 76 | } |
79 | 77 | $wgOut->addHTML('</td>' ); |
| 78 | + $wgOut->addHTML( '<td> Minimum:<br/>SPL<br/>pcre</td>' ); |
80 | 79 | $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'; |
83 | 94 | } |
84 | 95 | else { |
85 | | - $sdSVGPathStatus='ERROR'; |
| 96 | + $sdPHPStatus='ERROR'; |
86 | 97 | } |
87 | | - $wgOut->addHTML( '<td>' . $sdSVGPathStatus . '</td>' ); |
| 98 | + $wgOut->addHTML( '<td>' . $sdPHPStatus . '</td>' ); |
88 | 99 | $wgOut->addHTML( '</tr>' ); |
89 | 100 | |
90 | 101 | |
91 | 102 | ### End Table ### |
92 | 103 | $wgOut->addHTML( '</table>' ); |
93 | | - } |
| 104 | + } |
94 | 105 | } |
\ No newline at end of file |