Index: trunk/phase3/maintenance/edit.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | $wgArticle = new Article( $wgTitle ); |
63 | 63 | |
64 | 64 | # Read the text |
65 | | - $text = $this->getStdin(); |
| 65 | + $text = $this->getStdin( Maintenance::STDIN_ALL ); |
66 | 66 | |
67 | 67 | # Do the edit |
68 | 68 | $this->output( "Saving... " ); |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -45,6 +45,9 @@ |
46 | 46 | const DB_NONE = 0; |
47 | 47 | const DB_STD = 1; |
48 | 48 | const DB_ADMIN = 2; |
| 49 | + |
| 50 | + // Const for getStdin() |
| 51 | + const STDIN_ALL = 'all'; |
49 | 52 | |
50 | 53 | // This is the desired params |
51 | 54 | private $mParams = array(); |
— | — | @@ -178,14 +181,16 @@ |
179 | 182 | /** |
180 | 183 | * Return input from stdin. |
181 | 184 | * @param $length int The number of bytes to read. If null, |
182 | | - * just return the handle |
| 185 | + * just return the handle. Maintenance::STDIN_ALL returns |
| 186 | + * the full length |
183 | 187 | * @return mixed |
184 | 188 | */ |
185 | 189 | protected function getStdin( $len = null ) { |
| 190 | + if ( $len == Maintenance::STDIN_ALL ) |
| 191 | + return file_get_contents( 'php://stdin' ); |
186 | 192 | $f = fopen( 'php://stdin', 'rt' ); |
187 | | - if( !$len ) { |
| 193 | + if( !$len ) |
188 | 194 | return $f; |
189 | | - } |
190 | 195 | $input = fgets( $f, $len ); |
191 | 196 | fclose ( $f ); |
192 | 197 | return rtrim( $input ); |
Index: trunk/phase3/maintenance/initEditCount.php |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | public function execute() { |
| 39 | + global $wgDBservers; |
39 | 40 | $dbw = wfGetDB( DB_MASTER ); |
40 | 41 | $user = $dbw->tableName( 'user' ); |
41 | 42 | $revision = $dbw->tableName( 'revision' ); |