4 require( __DIR__ . '/../Maintenance.php' );
6 class RunHipHopServer extends Maintenance {
7 function __construct() {
9 $this->addOption( 'interpret', 'Run in interpreted mode' );
13 if ( $this->hasOption( 'interpret' ) ) {
14 $this->runInterpreted();
20 function runCompiled() {
21 global $wgHipHopBuildDirectory;
22 $thisDir = realpath( __DIR__ );
23 $IP = realpath( "$thisDir/../.." );
24 if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
25 $buildDir = $wgHipHopBuildDirectory;
27 $buildDir = "$thisDir/build";
30 if ( file_exists( "$buildDir/source" ) ) {
31 $sourceBase = "$buildDir/source";
33 $sourceBase = realpath( "$IP/.." );
37 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " .
38 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' .
40 "$buildDir/persistent/mediawiki-hphp",
41 '-c', "$thisDir/server.conf",
42 '-v', "Server.SourceRoot=$sourceBase",
43 '-v', "Server.IncludeSearchPaths.0=$sourceBase",
44 '-v', 'ServerVariables.MW_COMPILED=1',
53 function runInterpreted() {
54 $thisDir = realpath( __DIR__ );
55 $IP = realpath( "$thisDir/../.." );
56 $sourceBase = realpath( "$IP/.." );
59 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " .
60 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' .
63 '-c', "$thisDir/server.conf",
64 '-v', "Server.SourceRoot=$sourceBase",
65 '-v', "Server.IncludeSearchPaths.0=$sourceBase",
74 $maintClass = 'RunHipHopServer';
75 require_once( RUN_MAINTENANCE_IF_MAIN );