diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /maintenance/hiphop/run-server | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'maintenance/hiphop/run-server')
-rw-r--r-- | maintenance/hiphop/run-server | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/maintenance/hiphop/run-server b/maintenance/hiphop/run-server new file mode 100644 index 00000000..0ad43134 --- /dev/null +++ b/maintenance/hiphop/run-server @@ -0,0 +1,75 @@ +#!/usr/bin/hphpi -f +<?php + +require( dirname( __FILE__ ) . '/../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( dirname( __FILE__ ) ); + $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( dirname( __FILE__ ) ); + $IP = realpath( "$thisDir/../.." ); + $sourceBase = realpath( "$IP/.." ); + + passthru( + 'cd ' . wfEscapeShellArg( $sourceBase ) . " && " . + 'MW_INSTALL_PATH=' . wfEscapeShellArg( $IP ) . ' ' . + wfEscapeShellArg( + 'hphpi', + '-c', "$thisDir/server.conf", + '-v', "Server.SourceRoot=$sourceBase", + '-v', "Server.IncludeSearchPaths.0=$sourceBase", + '--mode=server', + '--port=8080' + ), + $ret + ); + exit( $ret ); + } +} +$maintClass = 'RunHipHopServer'; +require_once( RUN_MAINTENANCE_IF_MAIN ); |