X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FgetText.php;h=7d7c1cc48078ba317a73c065290eb475add8eca2;hb=b66bb911b57fbbd39df97fc1878aaa46dea7590f;hp=34558b66f9465c45858ef7b7f113bb346eaf375e;hpb=2ceb322bc6e6b8db7d3b57008f83c4e72f092302;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/getText.php b/maintenance/getText.php index 34558b66f9..7d7c1cc480 100644 --- a/maintenance/getText.php +++ b/maintenance/getText.php @@ -23,7 +23,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that outputs page text to stdout. @@ -52,14 +52,17 @@ class GetTextMaint extends Maintenance { $titleText = $title->getPrefixedText(); $this->error( "Page $titleText does not exist.\n", true ); } - $text = $rev->getText( $this->hasOption( 'show-private' ) ? Revision::RAW : Revision::FOR_PUBLIC ); - if ( $text === false ) { + $content = $rev->getContent( $this->hasOption( 'show-private' ) + ? Revision::RAW + : Revision::FOR_PUBLIC ); + + if ( $content === false ) { $titleText = $title->getPrefixedText(); $this->error( "Couldn't extract the text from $titleText.\n", true ); } - $this->output( $text ); + $this->output( $content->serialize() ); } } $maintClass = "GetTextMaint"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;