dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ae2763
)
Don't fall into an infinite loop o' death if the pipes get broken.
author
Brion Vibber
<brion@users.mediawiki.org>
Mon, 19 May 2008 15:49:05 +0000
(15:49 +0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Mon, 19 May 2008 15:49:05 +0000
(15:49 +0000)
Exit out if we can't read from stdin anymore, instead of interpreting the 'false' error code as text ID 0...
maintenance/fetchText.php
patch
|
blob
|
history
diff --git
a/maintenance/fetchText.php
b/maintenance/fetchText.php
index
3b745c0
..
6492fad
100644
(file)
--- a/
maintenance/fetchText.php
+++ b/
maintenance/fetchText.php
@@
-10,6
+10,10
@@
$db = wfGetDB( DB_SLAVE );
$stdin = fopen( "php://stdin", "rt" );
while( !feof( $stdin ) ) {
$line = fgets( $stdin );
+ if( $line === false ) {
+ // We appear to have lost contact...
+ break;
+ }
$textId = intval( $line );
$text = doGetText( $db, $textId );
echo strlen( $text ) . "\n";
@@
-31,6
+35,3
@@
function doGetText( $db, $id ) {
}
return $text;
}
-
-
-?>
\ No newline at end of file