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