* Print a message, if possible to STDERR.
* Use this in command line mode only (see isCommandLine)
*
+ * @suppress SecurityCheck-XSS
* @param string $message Failure text
*/
private static function printError( $message ) {
htmlspecialchars( $e->getTraceAsString() ) . '</pre>';
}
- $html .= '<hr />';
- $html .= self::googleSearchForm();
$html .= '</body></html>';
echo $html;
}
-
- /**
- * @return string
- */
- private static function googleSearchForm() {
- global $wgSitename, $wgCanonicalServer, $wgRequest;
-
- $usegoogle = htmlspecialchars( self::msg(
- 'dberr-usegoogle',
- 'You can try searching via Google in the meantime.'
- ) );
- $outofdate = htmlspecialchars( self::msg(
- 'dberr-outofdate',
- 'Note that their indexes of our content may be out of date.'
- ) );
- $googlesearch = htmlspecialchars( self::msg( 'searchbutton', 'Search' ) );
- $search = htmlspecialchars( $wgRequest->getVal( 'search' ) );
- $server = htmlspecialchars( $wgCanonicalServer );
- $sitename = htmlspecialchars( $wgSitename );
- $trygoogle = <<<EOT
-<div style="margin: 1.5em">$usegoogle<br />
-<small>$outofdate</small>
-</div>
-<form method="get" action="//www.google.com/search" id="googlesearch">
- <input type="hidden" name="domains" value="$server" />
- <input type="hidden" name="num" value="50" />
- <input type="hidden" name="ie" value="UTF-8" />
- <input type="hidden" name="oe" value="UTF-8" />
- <input type="text" name="q" size="31" maxlength="255" value="$search" />
- <input type="submit" name="btnG" value="$googlesearch" />
- <p>
- <label><input type="radio" name="sitesearch" value="$server" checked="checked" />$sitename</label>
- <label><input type="radio" name="sitesearch" value="" />WWW</label>
- </p>
-</form>
-EOT;
- return $trygoogle;
- }
}