4 require( dirname( __FILE__ ) . '/../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( dirname( __FILE__ ) );
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",
52 function runInterpreted() {
53 $thisDir = realpath( dirname( __FILE__ ) );
54 $IP = realpath( "$thisDir/../.." );
55 $sourceBase = realpath( "$IP/.." );
60 '-c', "$thisDir/server.conf",
61 '-v', "Server.SourceRoot=$sourceBase",
62 '-v', "Server.IncludeSearchPaths.0=$sourceBase",
71 $maintClass = 'RunHipHopServer';
72 require_once( RUN_MAINTENANCE_IF_MAIN );