r89166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89165‎ | r89166 | r89167 >
Date:13:49, 30 May 2011
Author:tstarling
Status:resolved (Comments)
Tags:
Comment:
HipHop improvements:
* Added the ability to compile extensions. The build process is bootstrapped by running MediaWiki in interpreted mode. Extension setup file inclusions are slightly modified in a way that makes them register themselves for compilation. Then the same LocalSettings.php uses the compiled extension setup file when the compiled binary runs.
* Tested with Cite and ParserFunctions. The code which lets you have an extensions directory in a place other than $IP/../extensions is untested.
* Simplified WebStart.php slightly by using a custom $_SERVER variable to mark compiled mode. It will break if you don't use the supplied server.conf, but that will break a lot of things so don't do that.
* Fixed the core web entry points to include WebStart.php in compiled mode instead of interpreted.
* Made the build directory configurable. This is mostly so that I can grep the source tree without seeing loads of generated C++.
* In server.conf, added a rewrite rule allowing a /wiki/$1 article path.
* Removed server.conf log file location "/dev/stdout", breaks when you switch user
* Disable static content cache, breaks horribly when you set SourceRoot to a directory containing 7GB of files.
* Rewrote the run-server script in PHP, mostly to support the configurable build directory feature.
* Added an option to the run-server script to allow running in interpreted (hphpi) mode.
Modified paths:
  • /trunk/phase3/api.php (modified) (history)
  • /trunk/phase3/img_auth.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Init.php (modified) (history)
  • /trunk/phase3/includes/WebStart.php (modified) (history)
  • /trunk/phase3/index.php (modified) (history)
  • /trunk/phase3/load.php (modified) (history)
  • /trunk/phase3/maintenance/doMaintenance.php (modified) (history)
  • /trunk/phase3/maintenance/hiphop/make (modified) (history)
  • /trunk/phase3/maintenance/hiphop/run-server (modified) (history)
  • /trunk/phase3/maintenance/hiphop/server.conf (modified) (history)
  • /trunk/phase3/mw-config/index.php (modified) (history)
  • /trunk/phase3/profileinfo.php (modified) (history)
  • /trunk/phase3/redirect.php (modified) (history)
  • /trunk/phase3/thumb.php (modified) (history)
  • /trunk/phase3/trackback.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/doMaintenance.php
@@ -54,18 +54,10 @@
5555 $self = $maintenance->getName();
5656
5757 // Detect compiled mode
58 -try {
59 - $r = new ReflectionFunction( 'wfHipHopCompilerVersion' );
60 -} catch ( ReflectionException $e ) {
61 - $r = false;
62 -}
63 -
64 -if ( $r ) {
 58+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
6559 define( 'MW_COMPILED', 1 );
66 -}
67 -
68 -# Get the MWInit class
69 -if ( !defined( 'MW_COMPILED' ) ) {
 60+} else {
 61+ # Get the MWInit class
7062 require_once( "$IP/includes/Init.php" );
7163 require_once( "$IP/includes/AutoLoader.php" );
7264 }
@@ -77,7 +69,7 @@
7870 if ( !defined( 'MW_COMPILED' ) ) {
7971 require_once( "$IP/includes/Defines.php" );
8072 }
81 -require_once( "$IP/includes/DefaultSettings.php" );
 73+require_once( MWInit::compiledPath( 'includes/DefaultSettings.php' ) );
8274
8375 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
8476 # Use a callback function to configure MediaWiki
Index: trunk/phase3/maintenance/hiphop/run-server
@@ -1,12 +1,72 @@
2 -#!/bin/bash
 2+#!/usr/bin/hphpi -f
 3+<?php
34
4 -sourceDir=`dirname "$0"`
5 -sourceRoot=`readlink -f "$sourceDir/../.."`
 5+require( dirname( __FILE__ ) . '/../Maintenance.php' );
66
7 -"$sourceDir"/build/persistent/mediawiki-hphp \
8 - -c "$sourceDir/server.conf" \
9 - -v Server.SourceRoot="$sourceRoot" \
10 - --mode=server \
11 - --port=8080
 7+class RunHipHopServer extends Maintenance {
 8+ function __construct() {
 9+ parent::__construct();
 10+ $this->addOption( 'interpret', 'Run in interpreted mode' );
 11+ }
1212
 13+ function execute() {
 14+ if ( $this->hasOption( 'interpret' ) ) {
 15+ $this->runInterpreted();
 16+ } else {
 17+ $this->runCompiled();
 18+ }
 19+ }
1320
 21+ function runCompiled() {
 22+ global $wgHipHopBuildDirectory;
 23+ $thisDir = realpath( dirname( __FILE__ ) );
 24+ $IP = realpath( "$thisDir/../.." );
 25+ if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
 26+ $buildDir = $wgHipHopBuildDirectory;
 27+ } else {
 28+ $buildDir = "$thisDir/build";
 29+ }
 30+
 31+ if ( file_exists( "$buildDir/source" ) ) {
 32+ $sourceBase = "$buildDir/source";
 33+ } else {
 34+ $sourceBase = realpath( "$IP/.." );
 35+ }
 36+
 37+ passthru(
 38+ 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " .
 39+ 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' .
 40+ wfEscapeShellArg(
 41+ "$buildDir/persistent/mediawiki-hphp",
 42+ '-c', "$thisDir/server.conf",
 43+ '-v', "Server.SourceRoot=$sourceBase",
 44+ '-v', "Server.IncludeSearchPaths.0=$sourceBase",
 45+ '--mode=server',
 46+ '--port=8080'
 47+ ),
 48+ $ret
 49+ );
 50+ exit( $ret );
 51+ }
 52+
 53+ function runInterpreted() {
 54+ $thisDir = realpath( dirname( __FILE__ ) );
 55+ $IP = realpath( "$thisDir/../.." );
 56+ $sourceBase = realpath( "$IP/.." );
 57+
 58+ passthru(
 59+ wfEscapeShellArg(
 60+ 'hphpi',
 61+ '-c', "$thisDir/server.conf",
 62+ '-v', "Server.SourceRoot=$sourceBase",
 63+ '-v', "Server.IncludeSearchPaths.0=$sourceBase",
 64+ '--mode=server',
 65+ '--port=8080'
 66+ ),
 67+ $ret
 68+ );
 69+ exit( $ret );
 70+ }
 71+}
 72+$maintClass = 'RunHipHopServer';
 73+require_once( RUN_MAINTENANCE_IF_MAIN );
Index: trunk/phase3/maintenance/hiphop/server.conf
@@ -1,7 +1,6 @@
22 Log {
33 Level = Warning
44 UseLogFile = true
5 - File = /dev/stdout
65 NativeStackTrace = true
76 InjectedStackTrace = true
87 }
@@ -12,5 +11,23 @@
1312 TranslateSource = true
1413 }
1514 Server {
16 - EnableStaticContentFromDisk = true
 15+ EnableStaticContentCache = false
 16+ EnableStaticContentFromDisk = false
 17+ AlwaysUseRelativePath = true
1718 }
 19+ServerVariables {
 20+ MW_COMPILED = 1
 21+}
 22+VirtualHost {
 23+ * {
 24+ ServerName = localhost
 25+ Pattern = .
 26+ RewriteRules {
 27+ * {
 28+ pattern = ^/wiki/(.*)$
 29+ to = /phase3/index.php?title=$1
 30+ }
 31+ }
 32+ }
 33+}
 34+
Index: trunk/phase3/maintenance/hiphop/make
@@ -5,13 +5,20 @@
66
77 class MakeHipHop extends Maintenance {
88 function execute() {
 9+ global $wgHipHopBuildDirectory;
 10+
911 $startTime = time();
1012
11 - $sourceDir = realpath( dirname( __FILE__ ) );
12 - $IP = realpath( "$sourceDir/../.." );
13 - $buildDir = "$sourceDir/build";
 13+ $thisDir = realpath( dirname( __FILE__ ) );
 14+ $IP = realpath( "$thisDir/../.." );
 15+ if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
 16+ $buildDir = $wgHipHopBuildDirectory;
 17+ } else {
 18+ $buildDir = "$thisDir/build";
 19+ }
 20+ $extensionsDir = realpath( MWInit::getExtensionsDirectory() );
1421 $outDir = "$buildDir/hiphop-output";
15 - $persistentDir = "$buildDir/persistent" ;
 22+ $persistentDir = "$buildDir/persistent";
1623
1724 if ( !is_dir( $buildDir ) ) {
1825 mkdir( $buildDir, 0777, true );
@@ -20,6 +27,17 @@
2128 mkdir( $persistentDir, 0777, true );
2229 }
2330
 31+ if ( realpath( "$IP/../phase3" ) !== $IP
 32+ || realpath( "$IP/../extensions" ) !== $extensionsDir )
 33+ {
 34+ # Set up a fake source directory with the correct layout
 35+ $sourceBase = "$buildDir/source";
 36+ $this->setupFakeSourceBase( $IP, $extensionsDir, $sourceBase );
 37+ } else {
 38+ $sourceBase = realpath( "$IP/.." );
 39+ unlink( "$buildDir/source" );
 40+ }
 41+
2442 # With the CentOS RPMs, you just get g++44, no g++, so we have to
2543 # use the environment
2644 if ( isset( $_ENV['CXX'] ) ) {
@@ -39,13 +57,8 @@
4058 "}\n"
4159 );
4260
43 - # Generate the file list from the autoloader
44 - global $wgAutoloadLocalClasses;
45 - $files = array_merge(
46 - array_values( $wgAutoloadLocalClasses ),
47 - array_map( 'trim', file( "$sourceDir/extra-files" ) )
48 - );
49 - $files = array_unique( $files );
 61+ # Generate the file list
 62+ $files = $this->getFileList();
5063 file_put_contents(
5164 "$buildDir/file-list",
5265 implode( "\n", $files ) . "\n" );
@@ -55,10 +68,10 @@
5669 'hphp' .
5770 ' --target=cpp' .
5871 ' --format=file' .
59 - ' --input-dir=' . wfEscapeShellArg( $IP ) .
 72+ ' --input-dir=' . wfEscapeShellArg( $sourceBase ) .
6073 ' --input-list=' . wfEscapeShellArg( "$buildDir/file-list" ) .
6174 ' --inputs=' . wfEscapeShellArg( "$buildDir/HipHopCompilerVersion.php" ) .
62 - ' -c ' . wfEscapeShellArg( "$sourceDir/compiler.conf" ) .
 75+ ' -c ' . wfEscapeShellArg( "$thisDir/compiler.conf" ) .
6376 ' --parse-on-demand=false' .
6477 ' --program=mediawiki-hphp' .
6578 ' --output-dir=' . wfEscapeShellArg( $outDir ) .
@@ -181,7 +194,7 @@
182195 $elapsed -= $minutes * 60;
183196 }
184197 echo $elapsed . "s\n";
185 - echo "The MediaWiki executable is at build/persistent/mediawiki-hphp\n";
 198+ echo "The MediaWiki executable is at $buildDir/persistent/mediawiki-hphp\n";
186199 }
187200
188201 function checkVolatileClasses( $dir ) {
@@ -224,6 +237,71 @@
225238 return 1;
226239 }
227240 }
 241+
 242+ function setupFakeSourceBase( $phase3, $extensions, $dest ) {
 243+ if ( !file_exists( $dest ) ) {
 244+ mkdir( $dest, 0777, true );
 245+ }
 246+
 247+ $this->forceCreateLink( "$dest/phase3", $phase3 );
 248+ $this->forceCreateLink( "$dest/extensions", $extensions );
 249+ }
 250+
 251+ function forceCreateLink( $target, $link ) {
 252+ if ( file_exists( $target ) ) {
 253+ if ( readlink( $target ) === $link ) {
 254+ return;
 255+ }
 256+ unlink( $target );
 257+ }
 258+ symlink( $target, $link );
 259+ }
 260+
 261+ function getFileList() {
 262+ global $wgAutoloadClasses, $wgAutoloadLocalClasses, $wgCompiledFiles;
 263+ $inputFiles = array_merge(
 264+ array_values( $wgAutoloadClasses ),
 265+ array_values( $wgAutoloadLocalClasses ),
 266+ $wgCompiledFiles
 267+ );
 268+ $processedFiles = array();
 269+ foreach ( $inputFiles as $file ) {
 270+ if ( substr( $file, 0, 1 ) === '/' ) {
 271+ $processedFiles[] = $this->absoluteToRelative( $file );
 272+ } elseif ( preg_match( '/^extensions/', $file ) ) {
 273+ $processedFiles[] = $file;
 274+ } else {
 275+ $processedFiles[] = "phase3/$file";
 276+ }
 277+ }
 278+
 279+ $extraCoreFiles = array_map( 'trim', file( dirname( __FILE__ ) . '/extra-files' ) );
 280+ foreach ( $extraCoreFiles as $file ) {
 281+ if ( $file === '' ) {
 282+ continue;
 283+ }
 284+ $processedFiles[] = "phase3/$file";
 285+ }
 286+ return array_unique( $processedFiles );
 287+ }
 288+
 289+ function absoluteToRelative( $file ) {
 290+ global $IP;
 291+
 292+ $coreBase = realpath( $IP ) . '/';
 293+ $extBase = realpath( MWInit::getExtensionsDirectory() ) . '/';
 294+ $file = realpath( $file );
 295+
 296+ if ( substr( $file, 0, strlen( $extBase ) ) === $extBase ) {
 297+ return 'extensions/' . substr( $file, strlen( $extBase ) );
 298+ } elseif ( substr( $file, 0, strlen( $coreBase ) ) === $coreBase ) {
 299+ return 'phase3/' . substr( $file, strlen( $coreBase ) );
 300+ } else {
 301+ $this->error( "The following file is registered for compilation but is not in \$IP or " .
 302+ "\$wgExtensionsDirectory: $file \n" );
 303+ exit( 1 );
 304+ }
 305+ }
228306 }
229307
230308 $maintClass = 'MakeHipHop';
Index: trunk/phase3/includes/Init.php
@@ -61,13 +61,63 @@
6262 global $IP;
6363
6464 if ( defined( 'MW_COMPILED' ) ) {
65 - return $file;
 65+ return "phase3/$file";
6666 } else {
6767 return "$IP/$file";
6868 }
6969 }
7070
7171 /**
 72+ * The equivalent of MWInit::interpretedPath() but for files relative to the
 73+ * extensions directory.
 74+ */
 75+ static function extInterpretedPath( $file ) {
 76+ return getExtensionsDirectory() . '/' . $file;
 77+ }
 78+
 79+ /**
 80+ * The equivalent of MWInit::compiledPath() but for files relative to the
 81+ * extensions directory. Any files referenced in this way must be registered
 82+ * for compilation by including them in $wgCompiledFiles.
 83+ */
 84+ static function extCompiledPath( $file ) {
 85+ if ( defined( 'MW_COMPILED' ) ) {
 86+ return "extensions/$file";
 87+ } else {
 88+ return getExtensionsDirectory() . '/' . $file;
 89+ }
 90+ }
 91+
 92+ /**
 93+ * Register an extension setup file and return its path for compiled
 94+ * inclusion. Use this function in LocalSettings.php to add extensions
 95+ * to the build. For example:
 96+ *
 97+ * require( MWInit::extSetupPath( 'ParserFunctions/ParserFunctions.php' ) );
 98+ *
 99+ * @param $path The path relative to the extensions directory, as defined by
 100+ * $wgExtensionsDirectory.
 101+ */
 102+ static function extSetupPath( $extRel ) {
 103+ $baseRel = "extensions/$extRel";
 104+ if ( defined( 'MW_COMPILED' ) ) {
 105+ return $baseRel;
 106+ } else {
 107+ global $wgCompiledFiles;
 108+ $wgCompiledFiles[] = $baseRel;
 109+ return self::getExtensionsDirectory() . '/' . $extRel;
 110+ }
 111+ }
 112+
 113+ static function getExtensionsDirectory() {
 114+ global $wgExtensionsDirectory, $IP;
 115+ if ( $wgExtensionsDirectory === false ) {
 116+ $wgExtensionsDirectory = "$IP/../extensions";
 117+ }
 118+ return $wgExtensionsDirectory;
 119+ }
 120+
 121+ /**
72122 * Determine whether a class exists, using a method which works under HipHop.
73123 *
74124 * Note that it's not possible to implement this with any variant of
Index: trunk/phase3/includes/WebStart.php
@@ -8,22 +8,6 @@
99 * @file
1010 */
1111
12 -/**
13 - * Detect compiled mode by looking for a function that only exists if compiled
14 - * in. Note that we can't use function_exists(), because it is terribly broken
15 - * under HipHop due to the "volatile" feature.
16 - *
17 - * @return bool
18 - */
19 -function wfDetectCompiledMode() {
20 - try {
21 - $r = new ReflectionFunction( 'wfHipHopCompilerVersion' );
22 - } catch ( ReflectionException $e ) {
23 - $r = false;
24 - }
25 - return $r !== false;
26 -}
27 -
2812 # Protect against register_globals
2913 # This must be done before any globals are set by the code
3014 if ( ini_get( 'register_globals' ) ) {
@@ -88,11 +72,9 @@
8973 $IP = realpath( '.' );
9074 }
9175
92 -if ( wfDetectCompiledMode() ) {
 76+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
9377 define( 'MW_COMPILED', 1 );
94 -}
95 -
96 -if ( !defined( 'MW_COMPILED' ) ) {
 78+} else {
9779 # Get MWInit class
9880 require_once( "$IP/includes/Init.php" );
9981
Index: trunk/phase3/includes/DefaultSettings.php
@@ -5314,6 +5314,12 @@
53155315 */
53165316
53175317 /**
 5318+ * The build directory for HipHop compilation.
 5319+ * Defaults to $IP/maintenance/hiphop/build.
 5320+ */
 5321+$wgHipHopBuildDirectory = false;
 5322+
 5323+/**
53185324 * The HipHop build type. Can be either "Debug" or "Release".
53195325 */
53205326 $wgHipHopBuildType = 'Debug';
@@ -5324,6 +5330,31 @@
53255331 */
53265332 $wgHipHopCompilerProcs = 'detect';
53275333
 5334+/**
 5335+ * Filesystem extensions directory. Defaults to $IP/../extensions.
 5336+ *
 5337+ * To compile extensions with HipHop, set $wgExtensionsDirectory correctly,
 5338+ * and use code like:
 5339+ *
 5340+ * require( MWInit::extensionSetupPath( 'Extension/Extension.php' ) );
 5341+ *
 5342+ * to include the extension setup file from LocalSettings.php. It is not
 5343+ * necessary to set this variable unless you use MWInit::extensionSetupPath().
 5344+ */
 5345+$wgExtensionsDirectory = false;
 5346+
 5347+/**
 5348+ * A list of files that should be compiled into a HipHop build, in addition to
 5349+ * those listed in $wgAutoloadClasses. Add to this array in an extension setup
 5350+ * file in order to add files to the build.
 5351+ *
 5352+ * The files listed here must either be either absolute paths under $IP or
 5353+ * under $wgExtensionsDirectory, or paths relative to the virtual source root
 5354+ * "$IP/..", i.e. starting with "phase3" for core files, and "extensions" for
 5355+ * extension files.
 5356+ */
 5357+$wgCompiledFiles = array();
 5358+
53285359 /** @} */ # End of HipHop compilation }
53295360
53305361
Index: trunk/phase3/trackback.php
@@ -5,7 +5,11 @@
66 * @ingroup SpecialPage
77 */
88
9 -require_once( './includes/WebStart.php' );
 9+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 10+ require ( 'phase3/includes/WebStart.php' );
 11+} else {
 12+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 13+}
1014
1115 class TrackBack {
1216
Index: trunk/phase3/img_auth.php
@@ -26,7 +26,11 @@
2727 **/
2828
2929 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
30 -require_once( dirname( __FILE__ ) . '/includes/WebStart.php' );
 30+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 31+ require ( 'phase3/includes/WebStart.php' );
 32+} else {
 33+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 34+}
3135 wfProfileIn( 'img_auth.php' );
3236 require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' );
3337
Index: trunk/phase3/mw-config/index.php
@@ -9,7 +9,11 @@
1010 define( 'MEDIAWIKI_INSTALL', true );
1111
1212 chdir( dirname( dirname( __FILE__ ) ) );
13 -require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
 13+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 14+ require ( 'phase3/includes/WebStart.php' );
 15+} else {
 16+ require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
 17+}
1418
1519 wfInstallerMain();
1620
Index: trunk/phase3/redirect.php
@@ -6,8 +6,12 @@
77 *
88 * @file
99 */
 10+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 11+ require ( 'phase3/includes/WebStart.php' );
 12+} else {
 13+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 14+}
1015
11 -require_once( './includes/WebStart.php' );
1216 global $wgArticlePath;
1317
1418 $page = $wgRequest->getVal( 'wpDropdown' );
Index: trunk/phase3/index.php
@@ -64,7 +64,11 @@
6565 # Initialise common code. This gives us access to GlobalFunctions, the AutoLoader, and
6666 # the globals $wgRequest, $wgOut, $wgUser, $wgLang and $wgContLang, amongst others; it
6767 # does *not* load $wgTitle
68 -require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 68+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 69+ require ( 'phase3/includes/WebStart.php' );
 70+} else {
 71+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 72+}
6973
7074 try {
7175 wfIndexMain();
Index: trunk/phase3/api.php
@@ -51,7 +51,11 @@
5252 }
5353
5454 // Initialise common code.
55 -require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 55+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 56+ require ( 'phase3/includes/WebStart.php' );
 57+} else {
 58+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 59+}
5660
5761 wfProfileIn( 'api.php' );
5862 $starttime = microtime( true );
Index: trunk/phase3/profileinfo.php
@@ -28,8 +28,12 @@
2929 ini_set( 'zlib.output_compression', 'off' );
3030
3131 $wgEnableProfileInfo = $wgProfileToDatabase = false;
 32+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 33+ require ( 'phase3/includes/WebStart.php' );
 34+} else {
 35+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 36+}
3237
33 -require_once( './includes/WebStart.php' );
3438
3539 header( 'Content-Type: text/html; charset=utf-8' );
3640
Index: trunk/phase3/load.php
@@ -36,7 +36,12 @@
3737 wfDie( "MediaWiki $version requires at least PHP version 5.2.3." );
3838 }
3939
40 -require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 40+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 41+ require ( 'phase3/includes/WebStart.php' );
 42+} else {
 43+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 44+}
 45+
4146 wfProfileIn( 'load.php' );
4247
4348 // URL safety checks
Index: trunk/phase3/thumb.php
@@ -7,7 +7,11 @@
88 * @ingroup Media
99 */
1010 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
11 -require_once( './includes/WebStart.php' );
 11+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
 12+ require ( 'phase3/includes/WebStart.php' );
 13+} else {
 14+ require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
 15+}
1216
1317 $wgTrivialMimeDetection = true; //don't use fancy mime detection, just check the file extension for jpg/gif/png.
1418

Follow-up revisions

RevisionCommit summaryAuthorDate
r89387Fix for r89166: need selfdemon03:36, 3 June 2011

Comments

#Comment by Platonides (talk | contribs)   15:31, 2 June 2011

Uses of getExtensionsDirectory() instead of self::getExtensionsDirectory()

Unavailable function getExtensionsDirectory in line 75
Unavailable function getExtensionsDirectory in line 87
#Comment by Platonides (talk | contribs)   20:18, 2 June 2011

You are hardcoding phase3 all over the place. Can't it be kept in just one place?

#Comment by Tim Starling (talk | contribs)   02:00, 3 June 2011

I'm not sure I understand the problem. It's not necessary for the source to actually be in a directory called phase3, only the virtual directory layout of the files in the compiled binary is fixed. Why would you want to change that?

#Comment by Platonides (talk | contribs)   21:14, 3 June 2011

That looks better. Sigh, all these hiphop directories are a nightmare. Why can't HipHop have a switch where it always uses the compiled files, no matter how we call it?

#Comment by Tim Starling (talk | contribs)   03:48, 7 June 2011

Marking new then. The getExtensionsDirectory() thing was fixed in r89387.

Status & tagging log