6492fad0e9b3dbbf0ea12a1334019c3efab4f167
4 * Communications protocol...
7 require "commandLine.inc";
9 $db = wfGetDB( DB_SLAVE
);
10 $stdin = fopen( "php://stdin", "rt" );
11 while( !feof( $stdin ) ) {
12 $line = fgets( $stdin );
13 if( $line === false ) {
14 // We appear to have lost contact...
17 $textId = intval( $line );
18 $text = doGetText( $db, $textId );
19 echo strlen( $text ) . "\n";
24 * May throw a database error if, say, the server dies during query.
26 function doGetText( $db, $id ) {
28 $row = $db->selectRow( 'text',
29 array( 'old_text', 'old_flags' ),
30 array( 'old_id' => $id ),
31 'TextPassDumper::getText' );
32 $text = Revision
::getRevisionText( $row );
33 if( $text === false ) {