- /**
- * Wrapper for getrusage, if it exists
- * getrusage() does not exist on the Window$ platform, catching this
- */
- function getRUsage() {
- if ( function_exists ( 'getrusage' ) ) {
- return getrusage();
- } else {
- return array();
- }
- }
-
- /**
- * CHeck for $GLOBALS vulnerability
- */
- function ckeckGlobalsVulnerability() {
- @ini_set( 'allow_url_fopen', 0 ); # For security...
- if ( isset( $_REQUEST['GLOBALS'] ) ) {
- die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
- }
- }
-
- /**
- * Checks if the wiki is set up at all, or configured but not activated
- */
- function checkSetup() {
- if ( file_exists( './LocalSettings.php' ) ) {
- /* LocalSettings exists, commerce normally */
- return;
- }
-
- /* LocalSettings is not in the right place, do something */
- $IP = ".";
- require_once( 'includes/DefaultSettings.php' ); # used for printing the version
- $out = file_get_contents( "./setup_message.html" );
- $out = str_replace( "$1", $wgVersion, $out );
- if ( file_exists( 'config/LocalSettings.php' ) ) {
- $msg = "To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.";
- } else {
- $msg = "Please <a href='config/index.php' title='setup'>setup the wiki</a> first.";
- }
- $out = str_replace( "$2", $msg, $out );
- echo $out;
- die();
- }
-
- /**
- * Reads title and action values from request
- */
- function initializeActionTitle () {
- $request = $this->getVal( 'Request' );
- $this->setVal( 'action', $request->getVal( 'action', 'view' ) );
- $this->setVal( 'urltitle', $request->getVal( 'title' ) );
- }
-