+ /**
+ * Environment prep for the server hostname.
+ */
+ protected function envPrepServer() {
+ $server = $this->envGetDefaultServer();
+ if ( $server !== null ) {
+ $this->setVar( 'wgServer', $server );
+ }
+ }
+
+ /**
+ * Helper function to be called from envPrepServer()
+ * @return string
+ */
+ abstract protected function envGetDefaultServer();
+
+ /**
+ * Environment prep for setting the preferred PHP file extension.
+ */
+ protected function envPrepExtension() {
+ // @todo FIXME: Detect this properly
+ if ( defined( 'MW_INSTALL_PHP5_EXT' ) ) {
+ $ext = '.php5';
+ } else {
+ $ext = '.php';
+ }
+ $this->setVar( 'wgScriptExtension', $ext );
+ }
+
+ /**
+ * Environment prep for setting $IP and $wgScriptPath.
+ */
+ protected function envPrepPath() {
+ global $IP;
+ $IP = dirname( dirname( __DIR__ ) );
+ $this->setVar( 'IP', $IP );
+ }
+