Catching: getrusage() does not exist on Windows platforms
[lhc/web/wiklou.git] / index.php
index dd9d9eb..6853ece 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,9 +3,15 @@
  * Main wiki script; see docs/design.txt
  * @package MediaWiki
  */
-
 $wgRequestTime = microtime();
 
+# getrusage() does not exist on the Window$ platform, catching this
+if ( function_exists ( 'getrusage' ) ) {
+       $wgRUstart = getrusage();
+} else {
+       $wgRUstart = array() ;
+}
+
 unset( $IP );
 @ini_set( 'allow_url_fopen', 0 ); # For security...
 
@@ -166,7 +172,7 @@ if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
                unset($wgArticle);
                require_once( 'includes/ImagePage.php' );
                $wgArticle = new ImagePage( $wgTitle );
-       } elseif ( $wgUseCategoryMagic && $ns == NS_CATEGORY ) {
+       } elseif ( $ns == NS_CATEGORY ) {
                unset($wgArticle);
                require_once( 'includes/CategoryPage.php' );
                $wgArticle = new CategoryPage( $wgTitle );
@@ -286,6 +292,7 @@ foreach ( $wgPostCommitUpdateList as $up ) {
 
 wfProfileOut( 'main-cleanup' );
 
+wfProfileClose();
 logProfilingData();
 $wgLoadBalancer->closeAll();
 wfDebug( "Request ended normally\n" );