X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fhiphop%2Frun-server;h=2d71b8712e1f8e2f893ff5d2c8c9d29ebea6c314;hb=2de7f7977b8914dc5f55b98e6f5c94a236379394;hp=1adfe29f1b725e8b41786a1be8dddaada7d3b298;hpb=e8b571fbf1a41ac2a2000b2a515393494d93a806;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/hiphop/run-server b/maintenance/hiphop/run-server old mode 100644 new mode 100755 index 1adfe29f1b..2d71b8712e --- a/maintenance/hiphop/run-server +++ b/maintenance/hiphop/run-server @@ -1,68 +1,21 @@ -#!/usr/bin/hphpi -f +#!/usr/bin/hhvm -f 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;