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
437 public function getSession( $name, $default = null ) {
438 if ( !isset( $this->session
[$name] ) ) {
441 return $this->session
[$name];
446 * Set a session variable.
447 * @param $name String key for the variable
448 * @param $value Mixed
450 public function setSession( $name, $value ) {
451 $this->session
[$name] = $value;
455 * Get the next tabindex attribute value.
458 public function nextTabIndex() {
459 return $this->tabIndex++
;
463 * Initializes language-related variables.
465 public function setupLanguage() {
466 global $wgLang, $wgContLang, $wgLanguageCode;
468 if ( $this->getSession( 'test' ) === null && !$this->request
->wasPosted() ) {
469 $wgLanguageCode = $this->getAcceptLanguage();
470 $wgLang = $wgContLang = Language
::factory( $wgLanguageCode );
471 $this->setVar( 'wgLanguageCode', $wgLanguageCode );
472 $this->setVar( '_UserLang', $wgLanguageCode );
474 $wgLanguageCode = $this->getVar( 'wgLanguageCode' );
475 $wgContLang = Language
::factory( $wgLanguageCode );
480 * Retrieves MediaWiki language from Accept-Language HTTP header.
484 public function getAcceptLanguage() {
485 global $wgLanguageCode, $wgRequest;
487 $mwLanguages = Language
::getLanguageNames();
488 $headerLanguages = array_keys( $wgRequest->getAcceptLang() );
490 foreach ( $headerLanguages as $lang ) {
491 if ( isset( $mwLanguages[$lang] ) ) {
496 return $wgLanguageCode;
500 * Called by execute() before page output starts, to show a page list.
502 * @param $currentPageName String
504 private function startPageWrapper( $currentPageName ) {
505 $s = "<div class=\"config-page-wrapper\">\n";
506 $s .= "<div class=\"config-page\">\n";
507 $s .= "<div class=\"config-page-list\"><ul>\n";
510 foreach ( $this->pageSequence
as $id => $pageName ) {
511 $happy = !empty( $this->happyPages
[$id] );
512 $s .= $this->getPageListItem(
514 $happy ||
$lastHappy == $id - 1,
523 $s .= "</ul><br/><ul>\n";
524 $s .= $this->getPageListItem( 'Restart', true, $currentPageName );
525 $s .= "</ul></div>\n"; // end list pane
526 $s .= Html
::element( 'h2', array(),
527 wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
529 $this->output
->addHTMLNoFlush( $s );
533 * Get a list item for the page list.
535 * @param $pageName String
536 * @param $enabled Boolean
537 * @param $currentPageName String
541 private function getPageListItem( $pageName, $enabled, $currentPageName ) {
542 $s = "<li class=\"config-page-list-item\">";
543 $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
546 $query = array( 'page' => $pageName );
548 if ( !in_array( $pageName, $this->pageSequence
) ) {
549 if ( in_array( $currentPageName, $this->pageSequence
) ) {
550 $query['lastPage'] = $currentPageName;
553 $link = Html
::element( 'a',
555 'href' => $this->getUrl( $query )
560 $link = htmlspecialchars( $name );
563 if ( $pageName == $currentPageName ) {
564 $s .= "<span class=\"config-page-current\">$link</span>";
569 $s .= Html
::element( 'span',
571 'class' => 'config-page-disabled'
583 * Output some stuff after a page is finished.
585 private function endPageWrapper() {
586 $this->output
->addHTMLNoFlush(
587 "<div class=\"visualClear\"></div>\n" .
589 "<div class=\"visualClear\"></div>\n" .
594 * Get HTML for an error box with an icon.
596 * @param $text String: wikitext, get this with wfMsgNoTrans()
600 public function getErrorBox( $text ) {
601 return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' );
605 * Get HTML for a warning box with an icon.
607 * @param $text String: wikitext, get this with wfMsgNoTrans()
611 public function getWarningBox( $text ) {
612 return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' );
616 * Get HTML for an info box with an icon.
618 * @param $text String: wikitext, get this with wfMsgNoTrans()
619 * @param $icon String: icon name, file in skins/common/images
620 * @param $class String: additional class name to add to the wrapper div
624 public function getInfoBox( $text, $icon = false, $class = false ) {
625 $text = $this->parse( $text, true );
626 $icon = ( $icon == false ) ?
'../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
627 $alt = wfMsg( 'config-information' );
628 return Html
::infoBox( $text, $icon, $alt, $class, false );
632 * Get small text indented help for a preceding form field.
633 * Parameters like wfMsg().
638 public function getHelpBox( $msg /*, ... */ ) {
639 $args = func_get_args();
640 array_shift( $args );
641 $args = array_map( 'htmlspecialchars', $args );
642 $text = wfMsgReal( $msg, $args, false, false, false );
643 $html = $this->parse( $text, true );
645 return "<div class=\"mw-help-field-container\">\n" .
646 "<span class=\"mw-help-field-hint\">" . wfMsgHtml( 'config-help' ) . "</span>\n" .
647 "<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
653 * @param $msg String key for wfMsg()
655 public function showHelpBox( $msg /*, ... */ ) {
656 $args = func_get_args();
657 $html = call_user_func_array( array( $this, 'getHelpBox' ), $args );
658 $this->output
->addHTML( $html );
662 * Show a short informational message.
663 * Output looks like a list.
667 public function showMessage( $msg /*, ... */ ) {
668 $args = func_get_args();
669 array_shift( $args );
670 $html = '<div class="config-message">' .
671 $this->parse( wfMsgReal( $msg, $args, false, false, false ) ) .
673 $this->output
->addHTML( $html );
677 * @param $status Status
679 public function showStatusMessage( Status
$status ) {
680 $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
681 foreach ( $errors as $error ) {
682 call_user_func_array( array( $this, 'showMessage' ), $error );
687 * Label a control by wrapping a config-input div around it and putting a
693 * @param $helpData string
696 public function label( $msg, $forId, $contents, $helpData = "" ) {
697 if ( strval( $msg ) == '' ) {
698 $labelText = ' ';
700 $labelText = wfMsgHtml( $msg );
703 $attributes = array( 'class' => 'config-label' );
706 $attributes['for'] = $forId;
710 "<div class=\"config-block\">\n" .
711 " <div class=\"config-block-label\">\n" .
714 $labelText ) . "\n" .
717 " <div class=\"config-block-elements\">\n" .
724 * Get a labelled text box to configure a variable.
726 * @param $params Array
728 * var: The variable to be configured (required)
729 * label: The message name for the label (required)
730 * attribs: Additional attributes for the input element (optional)
731 * controlName: The name for the input element (optional)
732 * value: The current value of the variable (optional)
733 * help: The html for the help text (optional)
737 public function getTextBox( $params ) {
738 if ( !isset( $params['controlName'] ) ) {
739 $params['controlName'] = 'config_' . $params['var'];
742 if ( !isset( $params['value'] ) ) {
743 $params['value'] = $this->getVar( $params['var'] );
746 if ( !isset( $params['attribs'] ) ) {
747 $params['attribs'] = array();
749 if ( !isset( $params['help'] ) ) {
750 $params['help'] = "";
755 $params['controlName'],
757 $params['controlName'],
758 30, // intended to be overridden by CSS
760 $params['attribs'] +
array(
761 'id' => $params['controlName'],
762 'class' => 'config-input-text',
763 'tabindex' => $this->nextTabIndex()
771 * Get a labelled textarea to configure a variable
773 * @param $params Array
775 * var: The variable to be configured (required)
776 * label: The message name for the label (required)
777 * attribs: Additional attributes for the input element (optional)
778 * controlName: The name for the input element (optional)
779 * value: The current value of the variable (optional)
780 * help: The html for the help text (optional)
784 public function getTextArea( $params ) {
785 if ( !isset( $params['controlName'] ) ) {
786 $params['controlName'] = 'config_' . $params['var'];
789 if ( !isset( $params['value'] ) ) {
790 $params['value'] = $this->getVar( $params['var'] );
793 if ( !isset( $params['attribs'] ) ) {
794 $params['attribs'] = array();
796 if ( !isset( $params['help'] ) ) {
797 $params['help'] = "";
802 $params['controlName'],
804 $params['controlName'],
808 $params['attribs'] +
array(
809 'id' => $params['controlName'],
810 'class' => 'config-input-text',
811 'tabindex' => $this->nextTabIndex()
819 * Get a labelled password box to configure a variable.
821 * Implements password hiding
822 * @param $params Array
824 * var: The variable to be configured (required)
825 * label: The message name for the label (required)
826 * attribs: Additional attributes for the input element (optional)
827 * controlName: The name for the input element (optional)
828 * value: The current value of the variable (optional)
829 * help: The html for the help text (optional)
833 public function getPasswordBox( $params ) {
834 if ( !isset( $params['value'] ) ) {
835 $params['value'] = $this->getVar( $params['var'] );
838 if ( !isset( $params['attribs'] ) ) {
839 $params['attribs'] = array();
842 $params['value'] = $this->getFakePassword( $params['value'] );
843 $params['attribs']['type'] = 'password';
845 return $this->getTextBox( $params );
849 * Get a labelled checkbox to configure a boolean variable.
851 * @param $params Array
853 * var: The variable to be configured (required)
854 * label: The message name for the label (required)
855 * attribs: Additional attributes for the input element (optional)
856 * controlName: The name for the input element (optional)
857 * value: The current value of the variable (optional)
858 * help: The html for the help text (optional)
862 public function getCheckBox( $params ) {
863 if ( !isset( $params['controlName'] ) ) {
864 $params['controlName'] = 'config_' . $params['var'];
867 if ( !isset( $params['value'] ) ) {
868 $params['value'] = $this->getVar( $params['var'] );
871 if ( !isset( $params['attribs'] ) ) {
872 $params['attribs'] = array();
874 if ( !isset( $params['help'] ) ) {
875 $params['help'] = "";
877 if( isset( $params['rawtext'] ) ) {
878 $labelText = $params['rawtext'];
880 $labelText = $this->parse( wfMsg( $params['label'] ) );
884 "<div class=\"config-input-check\">\n" .
888 $params['controlName'],
890 $params['attribs'] +
array(
891 'id' => $params['controlName'],
892 'tabindex' => $this->nextTabIndex(),
901 * Get a set of labelled radio buttons.
903 * @param $params Array
905 * var: The variable to be configured (required)
906 * label: The message name for the label (required)
907 * itemLabelPrefix: The message name prefix for the item labels (required)
908 * values: List of allowed values (required)
909 * itemAttribs Array of attribute arrays, outer key is the value name (optional)
910 * commonAttribs Attribute array applied to all items
911 * controlName: The name for the input element (optional)
912 * value: The current value of the variable (optional)
913 * help: The html for the help text (optional)
917 public function getRadioSet( $params ) {
918 if ( !isset( $params['controlName'] ) ) {
919 $params['controlName'] = 'config_' . $params['var'];
922 if ( !isset( $params['value'] ) ) {
923 $params['value'] = $this->getVar( $params['var'] );
926 if ( !isset( $params['label'] ) ) {
929 $label = $params['label'];
931 if ( !isset( $params['help'] ) ) {
932 $params['help'] = "";
935 foreach ( $params['values'] as $value ) {
936 $itemAttribs = array();
938 if ( isset( $params['commonAttribs'] ) ) {
939 $itemAttribs = $params['commonAttribs'];
942 if ( isset( $params['itemAttribs'][$value] ) ) {
943 $itemAttribs = $params['itemAttribs'][$value] +
$itemAttribs;
946 $checked = $value == $params['value'];
947 $id = $params['controlName'] . '_' . $value;
948 $itemAttribs['id'] = $id;
949 $itemAttribs['tabindex'] = $this->nextTabIndex();
953 Xml
::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
955 Xml
::tags( 'label', array( 'for' => $id ), $this->parse(
956 wfMsgNoTrans( $params['itemLabelPrefix'] . strtolower( $value ) )
963 return $this->label( $label, $params['controlName'], $s, $params['help'] );
967 * Output an error or warning box using a Status object.
969 * @param $status Status
971 public function showStatusBox( $status ) {
972 if( !$status->isGood() ) {
973 $text = $status->getWikiText();
975 if( $status->isOk() ) {
976 $box = $this->getWarningBox( $text );
978 $box = $this->getErrorBox( $text );
981 $this->output
->addHTML( $box );
986 * Convenience function to set variables based on form data.
987 * Assumes that variables containing "password" in the name are (potentially
990 * @param $varNames Array
991 * @param $prefix String: the prefix added to variables to obtain form names
995 public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
996 $newValues = array();
998 foreach ( $varNames as $name ) {
999 $value = trim( $this->request
->getVal( $prefix . $name ) );
1000 $newValues[$name] = $value;
1002 if ( $value === null ) {
1004 $this->setVar( $name, false );
1006 if ( stripos( $name, 'password' ) !== false ) {
1007 $this->setPassword( $name, $value );
1009 $this->setVar( $name, $value );
1018 * Helper for Installer::docLink()
1023 protected function getDocUrl( $page ) {
1024 $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
1026 if ( in_array( $this->currentPageName
, $this->pageSequence
) ) {
1027 $url .= '&lastPage=' . urlencode( $this->currentPageName
);
1034 * Extension tag hook for a documentation link.
1041 public function docLink( $linkText, $attribs, $parser ) {
1042 $url = $this->getDocUrl( $attribs['href'] );
1043 return '<a href="' . htmlspecialchars( $url ) . '">' .
1044 htmlspecialchars( $linkText ) .
1049 * Helper for "Download LocalSettings" link on WebInstall_Complete
1054 * @return String Html for download link
1056 public function downloadLinkHook( $text, $attribs, $parser ) {
1057 $img = Html
::element( 'img', array(
1058 'src' => '../skins/common/images/download-32.png',
1062 $anchor = Html
::rawElement( 'a',
1063 array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
1064 $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
1065 return Html
::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
1071 public function envCheckPath( ) {
1072 // PHP_SELF isn't available sometimes, such as when PHP is CGI but
1073 // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME
1074 // to get the path to the current script... hopefully it's reliable. SIGH
1076 if ( !empty( $_SERVER['PHP_SELF'] ) ) {
1077 $path = $_SERVER['PHP_SELF'];
1078 } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) {
1079 $path = $_SERVER['SCRIPT_NAME'];
1081 if ($path !== false) {
1082 $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path );
1083 $this->setVar( 'wgScriptPath', $uri );
1085 $this->showError( 'config-no-uri' );
1088 return parent
::envCheckPath();
1091 protected function envGetDefaultServer() {
1092 return WebRequest
::detectServer();