3 * Core installer web interface.
10 * Class for the core installer web interface.
15 class WebInstaller
extends Installer
{
18 * @var WebInstallerOutput
30 * Cached session array.
37 * Captured PHP error text. Temporary.
43 * The main sequence of page names. These will be displayed in turn.
46 * * Add a config-page-<name> message
47 * * Add a WebInstaller_<name> class
50 public $pageSequence = array(
64 * Out of sequence pages, selectable by the user at any time.
67 protected $otherPages = array(
72 'UpgradeDoc', // Can't use Upgrade due to Upgrade step
76 * Array of pages which have declared that they have been submitted, have validated
77 * their input, and need no further processing.
80 protected $happyPages;
83 * List of "skipped" pages. These are pages that will automatically continue
84 * to the next page on any GET request. To avoid breaking the "back" button,
85 * they need to be skipped during a back operation.
88 protected $skippedPages;
91 * Flag indicating that session data may have been lost.
94 public $showSessionWarning = false;
97 * Numeric index of the page we're on
100 protected $tabIndex = 1;
103 * Name of the page we're on
106 protected $currentPageName;
111 * @param $request WebRequest
113 public function __construct( WebRequest
$request ) {
114 parent
::__construct();
115 $this->output
= new WebInstallerOutput( $this );
116 $this->request
= $request;
120 $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );
121 $wgParser->setHook( 'doclink', array( $this, 'docLink' ) );
127 * @param $session Array: initial session array
129 * @return Array: new session array
131 public function execute( array $session ) {
132 $this->session
= $session;
134 if ( isset( $session['settings'] ) ) {
135 $this->settings
= $session['settings'] +
$this->settings
;
139 $this->setupLanguage();
141 if( ( $this->getVar( '_InstallDone' ) ||
$this->getVar( '_UpgradeDone' ) )
142 && $this->request
->getVal( 'localsettings' ) )
144 $this->request
->response()->header( 'Content-type: application/x-httpd-php' );
145 $this->request
->response()->header(
146 'Content-Disposition: attachment; filename="LocalSettings.php"'
149 $ls = new LocalSettingsGenerator( $this );
150 $rightsProfile = $this->rightsProfiles
[$this->getVar( '_RightsProfile' )];
151 foreach( $rightsProfile as $group => $rightsArr ) {
152 $ls->setGroupRights( $group, $rightsArr );
155 return $this->session
;
158 $cssDir = $this->request
->getVal( 'css' );
160 $cssDir = ( $cssDir == 'rtl' ?
'rtl' : 'ltr' );
161 $this->request
->response()->header( 'Content-type: text/css' );
162 echo $this->output
->getCSS( $cssDir );
163 return $this->session
;
166 if ( isset( $session['happyPages'] ) ) {
167 $this->happyPages
= $session['happyPages'];
169 $this->happyPages
= array();
172 if ( isset( $session['skippedPages'] ) ) {
173 $this->skippedPages
= $session['skippedPages'];
175 $this->skippedPages
= array();
178 $lowestUnhappy = $this->getLowestUnhappy();
180 # Special case for Creative Commons partner chooser box.
181 if ( $this->request
->getVal( 'SubmitCC' ) ) {
182 $page = $this->getPageByName( 'Options' );
183 $this->output
->useShortHeader();
184 $this->output
->allowFrames();
186 return $this->finish();
189 if ( $this->request
->getVal( 'ShowCC' ) ) {
190 $page = $this->getPageByName( 'Options' );
191 $this->output
->useShortHeader();
192 $this->output
->allowFrames();
193 $this->output
->addHTML( $page->getCCDoneBox() );
194 return $this->finish();
198 $pageName = $this->request
->getVal( 'page' );
200 if ( in_array( $pageName, $this->otherPages
) ) {
203 $page = $this->getPageByName( $pageName );
206 if ( !$pageName ||
!in_array( $pageName, $this->pageSequence
) ) {
207 $pageId = $lowestUnhappy;
209 $pageId = array_search( $pageName, $this->pageSequence
);
212 # If necessary, move back to the lowest-numbered unhappy page
213 if ( $pageId > $lowestUnhappy ) {
214 $pageId = $lowestUnhappy;
215 if ( $lowestUnhappy == 0 ) {
216 # Knocked back to start, possible loss of session data.
217 $this->showSessionWarning
= true;
221 $pageName = $this->pageSequence
[$pageId];
222 $page = $this->getPageByName( $pageName );
225 # If a back button was submitted, go back without submitting the form data.
226 if ( $this->request
->wasPosted() && $this->request
->getBool( 'submit-back' ) ) {
227 if ( $this->request
->getVal( 'lastPage' ) ) {
228 $nextPage = $this->request
->getVal( 'lastPage' );
229 } elseif ( $pageId !== false ) {
231 # Skip the skipped pages
232 $nextPageId = $pageId;
236 $nextPage = $this->pageSequence
[$nextPageId];
237 } while( isset( $this->skippedPages
[$nextPage] ) );
239 $nextPage = $this->pageSequence
[$lowestUnhappy];
242 $this->output
->redirect( $this->getUrl( array( 'page' => $nextPage ) ) );
243 return $this->finish();
247 $this->currentPageName
= $page->getName();
248 $this->startPageWrapper( $pageName );
250 if( $page->isSlow() ) {
251 $this->disableTimeLimit();
254 $result = $page->execute();
256 $this->endPageWrapper();
258 if ( $result == 'skip' ) {
259 # Page skipped without explicit submission.
260 # Skip it when we click "back" so that we don't just go forward again.
261 $this->skippedPages
[$pageName] = true;
262 $result = 'continue';
264 unset( $this->skippedPages
[$pageName] );
267 # If it was posted, the page can request a continue to the next page.
268 if ( $result === 'continue' && !$this->output
->headerDone() ) {
269 if ( $pageId !== false ) {
270 $this->happyPages
[$pageId] = true;
273 $lowestUnhappy = $this->getLowestUnhappy();
275 if ( $this->request
->getVal( 'lastPage' ) ) {
276 $nextPage = $this->request
->getVal( 'lastPage' );
277 } elseif ( $pageId !== false ) {
278 $nextPage = $this->pageSequence
[$pageId +
1];
280 $nextPage = $this->pageSequence
[$lowestUnhappy];
283 if ( array_search( $nextPage, $this->pageSequence
) > $lowestUnhappy ) {
284 $nextPage = $this->pageSequence
[$lowestUnhappy];
287 $this->output
->redirect( $this->getUrl( array( 'page' => $nextPage ) ) );
290 return $this->finish();
294 * Find the next page in sequence that hasn't been completed
297 public function getLowestUnhappy() {
298 if ( count( $this->happyPages
) == 0 ) {
301 return max( array_keys( $this->happyPages
) ) +
1;
306 * Start the PHP session. This may be called before execute() to start the PHP session.
310 public function startSession() {
311 if( wfIniGetBool( 'session.auto_start' ) ||
session_id() ) {
316 $this->phpErrors
= array();
317 set_error_handler( array( $this, 'errorHandler' ) );
319 restore_error_handler();
321 if ( $this->phpErrors
) {
322 $this->showError( 'config-session-error', $this->phpErrors
[0] );
330 * Get a hash of data identifying this MW installation.
332 * This is used by mw-config/index.php to prevent multiple installations of MW
333 * on the same cookie domain from interfering with each other.
337 public function getFingerprint() {
338 // Get the base URL of the installation
339 $url = $this->request
->getFullRequestURL();
340 if ( preg_match( '!^(.*\?)!', $url, $m) ) {
344 if ( preg_match( '!^(.*)/[^/]*/[^/]*$!', $url, $m ) ) {
345 // This... seems to try to get the base path from
346 // the /mw-config/index.php. Kinda scary though?
349 return md5( serialize( array(
350 'local path' => dirname( dirname( __FILE__
) ),
352 'version' => $GLOBALS['wgVersion']
357 * Show an error message in a box. Parameters are like wfMsg().
360 public function showError( $msg /*...*/ ) {
361 $args = func_get_args();
362 array_shift( $args );
363 $args = array_map( 'htmlspecialchars', $args );
364 $msg = wfMsgReal( $msg, $args, false, false, false );
365 $this->output
->addHTML( $this->getErrorBox( $msg ) );
369 * Temporary error handler for session start debugging.
371 * @param $errstr string
373 public function errorHandler( $errno, $errstr ) {
374 $this->phpErrors
[] = $errstr;
378 * Clean up from execute()
382 public function finish() {
383 $this->output
->output();
385 $this->session
['happyPages'] = $this->happyPages
;
386 $this->session
['skippedPages'] = $this->skippedPages
;
387 $this->session
['settings'] = $this->settings
;
389 return $this->session
;
393 * We're restarting the installation, reset the session, happyPages, etc
395 public function reset() {
396 $this->session
= array();
397 $this->happyPages
= array();
398 $this->settings
= array();
402 * Get a URL for submission back to the same script.
404 * @param $query array
407 public function getUrl( $query = array() ) {
408 $url = $this->request
->getRequestURL();
409 # Remove existing query
410 $url = preg_replace( '/\?.*$/', '', $url );
413 $url .= '?' . wfArrayToCGI( $query );
420 * Get a WebInstallerPage by name.
422 * @param $pageName String
423 * @return WebInstallerPage
425 public function getPageByName( $pageName ) {
426 $pageClass = 'WebInstaller_' . $pageName;
428 return new $pageClass( $this );
432 * Get a session variable.
434 * @param $name String
438 public function getSession( $name, $default = null ) {
439 if ( !isset( $this->session
[$name] ) ) {
442 return $this->session
[$name];
447 * Set a session variable.
448 * @param $name String key for the variable
449 * @param $value Mixed
451 public function setSession( $name, $value ) {
452 $this->session
[$name] = $value;
456 * Get the next tabindex attribute value.
459 public function nextTabIndex() {
460 return $this->tabIndex++
;
464 * Initializes language-related variables.
466 public function setupLanguage() {
467 global $wgLang, $wgContLang, $wgLanguageCode;
469 if ( $this->getSession( 'test' ) === null && !$this->request
->wasPosted() ) {
470 $wgLanguageCode = $this->getAcceptLanguage();
471 $wgLang = $wgContLang = Language
::factory( $wgLanguageCode );
472 $this->setVar( 'wgLanguageCode', $wgLanguageCode );
473 $this->setVar( '_UserLang', $wgLanguageCode );
475 $wgLanguageCode = $this->getVar( 'wgLanguageCode' );
476 $wgContLang = Language
::factory( $wgLanguageCode );
481 * Retrieves MediaWiki language from Accept-Language HTTP header.
485 public function getAcceptLanguage() {
486 global $wgLanguageCode, $wgRequest;
488 $mwLanguages = Language
::fetchLanguageNames();
489 $headerLanguages = array_keys( $wgRequest->getAcceptLang() );
491 foreach ( $headerLanguages as $lang ) {
492 if ( isset( $mwLanguages[$lang] ) ) {
497 return $wgLanguageCode;
501 * Called by execute() before page output starts, to show a page list.
503 * @param $currentPageName String
505 private function startPageWrapper( $currentPageName ) {
506 $s = "<div class=\"config-page-wrapper\">\n";
507 $s .= "<div class=\"config-page\">\n";
508 $s .= "<div class=\"config-page-list\"><ul>\n";
511 foreach ( $this->pageSequence
as $id => $pageName ) {
512 $happy = !empty( $this->happyPages
[$id] );
513 $s .= $this->getPageListItem(
515 $happy ||
$lastHappy == $id - 1,
524 $s .= "</ul><br/><ul>\n";
525 $s .= $this->getPageListItem( 'Restart', true, $currentPageName );
526 $s .= "</ul></div>\n"; // end list pane
527 $s .= Html
::element( 'h2', array(),
528 wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
530 $this->output
->addHTMLNoFlush( $s );
534 * Get a list item for the page list.
536 * @param $pageName String
537 * @param $enabled Boolean
538 * @param $currentPageName String
542 private function getPageListItem( $pageName, $enabled, $currentPageName ) {
543 $s = "<li class=\"config-page-list-item\">";
544 $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
547 $query = array( 'page' => $pageName );
549 if ( !in_array( $pageName, $this->pageSequence
) ) {
550 if ( in_array( $currentPageName, $this->pageSequence
) ) {
551 $query['lastPage'] = $currentPageName;
554 $link = Html
::element( 'a',
556 'href' => $this->getUrl( $query )
561 $link = htmlspecialchars( $name );
564 if ( $pageName == $currentPageName ) {
565 $s .= "<span class=\"config-page-current\">$link</span>";
570 $s .= Html
::element( 'span',
572 'class' => 'config-page-disabled'
584 * Output some stuff after a page is finished.
586 private function endPageWrapper() {
587 $this->output
->addHTMLNoFlush(
588 "<div class=\"visualClear\"></div>\n" .
590 "<div class=\"visualClear\"></div>\n" .
595 * Get HTML for an error box with an icon.
597 * @param $text String: wikitext, get this with wfMsgNoTrans()
601 public function getErrorBox( $text ) {
602 return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' );
606 * Get HTML for a warning box with an icon.
608 * @param $text String: wikitext, get this with wfMsgNoTrans()
612 public function getWarningBox( $text ) {
613 return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' );
617 * Get HTML for an info box with an icon.
619 * @param $text String: wikitext, get this with wfMsgNoTrans()
620 * @param $icon String: icon name, file in skins/common/images
621 * @param $class String: additional class name to add to the wrapper div
625 public function getInfoBox( $text, $icon = false, $class = false ) {
626 $text = $this->parse( $text, true );
627 $icon = ( $icon == false ) ?
'../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
628 $alt = wfMsg( 'config-information' );
629 return Html
::infoBox( $text, $icon, $alt, $class, false );
633 * Get small text indented help for a preceding form field.
634 * Parameters like wfMsg().
639 public function getHelpBox( $msg /*, ... */ ) {
640 $args = func_get_args();
641 array_shift( $args );
642 $args = array_map( 'htmlspecialchars', $args );
643 $text = wfMsgReal( $msg, $args, false, false, false );
644 $html = $this->parse( $text, true );
646 return "<div class=\"mw-help-field-container\">\n" .
647 "<span class=\"mw-help-field-hint\">" . wfMsgHtml( 'config-help' ) . "</span>\n" .
648 "<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
654 * @param $msg String key for wfMsg()
656 public function showHelpBox( $msg /*, ... */ ) {
657 $args = func_get_args();
658 $html = call_user_func_array( array( $this, 'getHelpBox' ), $args );
659 $this->output
->addHTML( $html );
663 * Show a short informational message.
664 * Output looks like a list.
668 public function showMessage( $msg /*, ... */ ) {
669 $args = func_get_args();
670 array_shift( $args );
671 $html = '<div class="config-message">' .
672 $this->parse( wfMsgReal( $msg, $args, false, false, false ) ) .
674 $this->output
->addHTML( $html );
678 * @param $status Status
680 public function showStatusMessage( Status
$status ) {
681 $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
682 foreach ( $errors as $error ) {
683 call_user_func_array( array( $this, 'showMessage' ), $error );
688 * Label a control by wrapping a config-input div around it and putting a
694 * @param $helpData string
697 public function label( $msg, $forId, $contents, $helpData = "" ) {
698 if ( strval( $msg ) == '' ) {
699 $labelText = ' ';
701 $labelText = wfMsgHtml( $msg );
704 $attributes = array( 'class' => 'config-label' );
707 $attributes['for'] = $forId;
711 "<div class=\"config-block\">\n" .
712 " <div class=\"config-block-label\">\n" .
715 $labelText ) . "\n" .
718 " <div class=\"config-block-elements\">\n" .
725 * Get a labelled text box to configure a variable.
727 * @param $params Array
729 * var: The variable to be configured (required)
730 * label: The message name for the label (required)
731 * attribs: Additional attributes for the input element (optional)
732 * controlName: The name for the input element (optional)
733 * value: The current value of the variable (optional)
734 * help: The html for the help text (optional)
738 public function getTextBox( $params ) {
739 if ( !isset( $params['controlName'] ) ) {
740 $params['controlName'] = 'config_' . $params['var'];
743 if ( !isset( $params['value'] ) ) {
744 $params['value'] = $this->getVar( $params['var'] );
747 if ( !isset( $params['attribs'] ) ) {
748 $params['attribs'] = array();
750 if ( !isset( $params['help'] ) ) {
751 $params['help'] = "";
756 $params['controlName'],
758 $params['controlName'],
759 30, // intended to be overridden by CSS
761 $params['attribs'] +
array(
762 'id' => $params['controlName'],
763 'class' => 'config-input-text',
764 'tabindex' => $this->nextTabIndex()
772 * Get a labelled textarea to configure a variable
774 * @param $params Array
776 * var: The variable to be configured (required)
777 * label: The message name for the label (required)
778 * attribs: Additional attributes for the input element (optional)
779 * controlName: The name for the input element (optional)
780 * value: The current value of the variable (optional)
781 * help: The html for the help text (optional)
785 public function getTextArea( $params ) {
786 if ( !isset( $params['controlName'] ) ) {
787 $params['controlName'] = 'config_' . $params['var'];
790 if ( !isset( $params['value'] ) ) {
791 $params['value'] = $this->getVar( $params['var'] );
794 if ( !isset( $params['attribs'] ) ) {
795 $params['attribs'] = array();
797 if ( !isset( $params['help'] ) ) {
798 $params['help'] = "";
803 $params['controlName'],
805 $params['controlName'],
809 $params['attribs'] +
array(
810 'id' => $params['controlName'],
811 'class' => 'config-input-text',
812 'tabindex' => $this->nextTabIndex()
820 * Get a labelled password box to configure a variable.
822 * Implements password hiding
823 * @param $params Array
825 * var: The variable to be configured (required)
826 * label: The message name for the label (required)
827 * attribs: Additional attributes for the input element (optional)
828 * controlName: The name for the input element (optional)
829 * value: The current value of the variable (optional)
830 * help: The html for the help text (optional)
834 public function getPasswordBox( $params ) {
835 if ( !isset( $params['value'] ) ) {
836 $params['value'] = $this->getVar( $params['var'] );
839 if ( !isset( $params['attribs'] ) ) {
840 $params['attribs'] = array();
843 $params['value'] = $this->getFakePassword( $params['value'] );
844 $params['attribs']['type'] = 'password';
846 return $this->getTextBox( $params );
850 * Get a labelled checkbox to configure a boolean variable.
852 * @param $params Array
854 * var: The variable to be configured (required)
855 * label: The message name for the label (required)
856 * attribs: Additional attributes for the input element (optional)
857 * controlName: The name for the input element (optional)
858 * value: The current value of the variable (optional)
859 * help: The html for the help text (optional)
863 public function getCheckBox( $params ) {
864 if ( !isset( $params['controlName'] ) ) {
865 $params['controlName'] = 'config_' . $params['var'];
868 if ( !isset( $params['value'] ) ) {
869 $params['value'] = $this->getVar( $params['var'] );
872 if ( !isset( $params['attribs'] ) ) {
873 $params['attribs'] = array();
875 if ( !isset( $params['help'] ) ) {
876 $params['help'] = "";
878 if( isset( $params['rawtext'] ) ) {
879 $labelText = $params['rawtext'];
881 $labelText = $this->parse( wfMsg( $params['label'] ) );
885 "<div class=\"config-input-check\">\n" .
889 $params['controlName'],
891 $params['attribs'] +
array(
892 'id' => $params['controlName'],
893 'tabindex' => $this->nextTabIndex(),
902 * Get a set of labelled radio buttons.
904 * @param $params Array
906 * var: The variable to be configured (required)
907 * label: The message name for the label (required)
908 * itemLabelPrefix: The message name prefix for the item labels (required)
909 * values: List of allowed values (required)
910 * itemAttribs Array of attribute arrays, outer key is the value name (optional)
911 * commonAttribs Attribute array applied to all items
912 * controlName: The name for the input element (optional)
913 * value: The current value of the variable (optional)
914 * help: The html for the help text (optional)
918 public function getRadioSet( $params ) {
919 if ( !isset( $params['controlName'] ) ) {
920 $params['controlName'] = 'config_' . $params['var'];
923 if ( !isset( $params['value'] ) ) {
924 $params['value'] = $this->getVar( $params['var'] );
927 if ( !isset( $params['label'] ) ) {
930 $label = $params['label'];
932 if ( !isset( $params['help'] ) ) {
933 $params['help'] = "";
936 foreach ( $params['values'] as $value ) {
937 $itemAttribs = array();
939 if ( isset( $params['commonAttribs'] ) ) {
940 $itemAttribs = $params['commonAttribs'];
943 if ( isset( $params['itemAttribs'][$value] ) ) {
944 $itemAttribs = $params['itemAttribs'][$value] +
$itemAttribs;
947 $checked = $value == $params['value'];
948 $id = $params['controlName'] . '_' . $value;
949 $itemAttribs['id'] = $id;
950 $itemAttribs['tabindex'] = $this->nextTabIndex();
954 Xml
::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
956 Xml
::tags( 'label', array( 'for' => $id ), $this->parse(
957 wfMsgNoTrans( $params['itemLabelPrefix'] . strtolower( $value ) )
964 return $this->label( $label, $params['controlName'], $s, $params['help'] );
968 * Output an error or warning box using a Status object.
970 * @param $status Status
972 public function showStatusBox( $status ) {
973 if( !$status->isGood() ) {
974 $text = $status->getWikiText();
976 if( $status->isOk() ) {
977 $box = $this->getWarningBox( $text );
979 $box = $this->getErrorBox( $text );
982 $this->output
->addHTML( $box );
987 * Convenience function to set variables based on form data.
988 * Assumes that variables containing "password" in the name are (potentially
991 * @param $varNames Array
992 * @param $prefix String: the prefix added to variables to obtain form names
996 public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
997 $newValues = array();
999 foreach ( $varNames as $name ) {
1000 $value = trim( $this->request
->getVal( $prefix . $name ) );
1001 $newValues[$name] = $value;
1003 if ( $value === null ) {
1005 $this->setVar( $name, false );
1007 if ( stripos( $name, 'password' ) !== false ) {
1008 $this->setPassword( $name, $value );
1010 $this->setVar( $name, $value );
1019 * Helper for Installer::docLink()
1024 protected function getDocUrl( $page ) {
1025 $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
1027 if ( in_array( $this->currentPageName
, $this->pageSequence
) ) {
1028 $url .= '&lastPage=' . urlencode( $this->currentPageName
);
1035 * Extension tag hook for a documentation link.
1042 public function docLink( $linkText, $attribs, $parser ) {
1043 $url = $this->getDocUrl( $attribs['href'] );
1044 return '<a href="' . htmlspecialchars( $url ) . '">' .
1045 htmlspecialchars( $linkText ) .
1050 * Helper for "Download LocalSettings" link on WebInstall_Complete
1055 * @return String Html for download link
1057 public function downloadLinkHook( $text, $attribs, $parser ) {
1058 $img = Html
::element( 'img', array(
1059 'src' => '../skins/common/images/download-32.png',
1063 $anchor = Html
::rawElement( 'a',
1064 array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
1065 $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
1066 return Html
::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
1072 public function envCheckPath( ) {
1073 // PHP_SELF isn't available sometimes, such as when PHP is CGI but
1074 // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME
1075 // to get the path to the current script... hopefully it's reliable. SIGH
1077 if ( !empty( $_SERVER['PHP_SELF'] ) ) {
1078 $path = $_SERVER['PHP_SELF'];
1079 } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) {
1080 $path = $_SERVER['SCRIPT_NAME'];
1082 if ($path !== false) {
1083 $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path );
1084 $this->setVar( 'wgScriptPath', $uri );
1086 $this->showError( 'config-no-uri' );
1089 return parent
::envCheckPath();
1092 protected function envGetDefaultServer() {
1093 return WebRequest
::detectServer();