summaryrefslogtreecommitdiff
path: root/maintenance/hiphop/run-server
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/hiphop/run-server')
-rw-r--r--maintenance/hiphop/run-server61
1 files changed, 7 insertions, 54 deletions
diff --git a/maintenance/hiphop/run-server b/maintenance/hiphop/run-server
index 1adfe29f..2d71b871 100644
--- a/maintenance/hiphop/run-server
+++ b/maintenance/hiphop/run-server
@@ -1,68 +1,21 @@
-#!/usr/bin/hphpi -f
+#!/usr/bin/hhvm -f
<?php
-require( __DIR__ . '/../Maintenance.php' );
+require __DIR__ . '/../Maintenance.php';
class RunHipHopServer extends Maintenance {
function __construct() {
parent::__construct();
- $this->addOption( 'interpret', 'Run in interpreted mode' );
}
function execute() {
- if ( $this->hasOption( 'interpret' ) ) {
- $this->runInterpreted();
- } else {
- $this->runCompiled();
- }
- }
-
- function runCompiled() {
- global $wgHipHopBuildDirectory;
- $thisDir = realpath( __DIR__ );
- $IP = realpath( "$thisDir/../.." );
- if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
- $buildDir = $wgHipHopBuildDirectory;
- } else {
- $buildDir = "$thisDir/build";
- }
-
- if ( file_exists( "$buildDir/source" ) ) {
- $sourceBase = "$buildDir/source";
- } else {
- $sourceBase = realpath( "$IP/.." );
- }
-
- passthru(
- 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " .
- 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' .
- wfEscapeShellArg(
- "$buildDir/persistent/mediawiki-hphp",
- '-c', "$thisDir/server.conf",
- '-v', "Server.SourceRoot=$sourceBase",
- '-v', "Server.IncludeSearchPaths.0=$sourceBase",
- '-v', 'ServerVariables.MW_COMPILED=1',
- '--mode=server',
- '--port=8080'
- ),
- $ret
- );
- exit( $ret );
- }
-
- function runInterpreted() {
- $thisDir = realpath( __DIR__ );
- $IP = realpath( "$thisDir/../.." );
- $sourceBase = realpath( "$IP/.." );
+ global $IP;
passthru(
- 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " .
- 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' .
+ 'cd ' . wfEscapeShellArg( $IP ) . " && " .
wfEscapeShellArg(
- 'hphpi',
- '-c', "$thisDir/server.conf",
- '-v', "Server.SourceRoot=$sourceBase",
- '-v', "Server.IncludeSearchPaths.0=$sourceBase",
+ 'hhvm',
+ '-c', __DIR__."/server.conf",
'--mode=server',
'--port=8080'
),
@@ -72,4 +25,4 @@ class RunHipHopServer extends Maintenance {
}
}
$maintClass = 'RunHipHopServer';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;