Index: trunk/phase3/maintenance/parserTestsParserHook.php |
— | — | @@ -1,5 +1,6 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI')) die(); |
| 3 | +if ( ! defined( 'MEDIAWIKI' ) ) |
| 4 | + die(); |
4 | 5 | /** |
5 | 6 | * A basic extension that's used by the parser tests to test whether input and |
6 | 7 | * arguments are passed to extensions properly. |
— | — | @@ -8,6 +9,7 @@ |
9 | 10 | * @subpackage Maintenance |
10 | 11 | * |
11 | 12 | * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> |
| 13 | + * @copyright Copyright © 2005, 2006 Ævar Arnfjörð Bjarmason |
12 | 14 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 15 | */ |
14 | 16 | |
— | — | @@ -18,8 +20,12 @@ |
19 | 21 | } |
20 | 22 | |
21 | 23 | function wfParserTestHook( $in, $argv ) { |
22 | | - if ( count( $argv ) ) |
23 | | - return "<pre>\n" . print_r( $argv, true ) . '</pre>'; |
24 | | - else |
25 | | - return $in; |
| 24 | + ob_start(); |
| 25 | + var_dump( |
| 26 | + $in, |
| 27 | + $argv |
| 28 | + ); |
| 29 | + $ret = ob_get_clean(); |
| 30 | + |
| 31 | + return "<pre>\n$ret</pre>"; |
26 | 32 | } |