Merge "Fix type hint in HistoryAction::getArticle"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 933397c..15bb13f 100644 (file)
@@ -165,12 +165,10 @@ class ResourceLoader {
         * @return string Filtered data, or a comment containing an error message
         */
        public function filter( $filter, $data, $cacheReport = true ) {
-               wfProfileIn( __METHOD__ );
 
                // For empty/whitespace-only data or for unknown filters, don't perform
                // any caching or processing
                if ( trim( $data ) === '' || !in_array( $filter, array( 'minify-js', 'minify-css' ) ) ) {
-                       wfProfileOut( __METHOD__ );
                        return $data;
                }
 
@@ -181,7 +179,6 @@ class ResourceLoader {
                $cacheEntry = $cache->get( $key );
                if ( is_string( $cacheEntry ) ) {
                        wfIncrStats( "rl-$filter-cache-hits" );
-                       wfProfileOut( __METHOD__ );
                        return $cacheEntry;
                }
 
@@ -215,8 +212,6 @@ class ResourceLoader {
                        $this->errors[] = self::formatExceptionNoComment( $e );
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $result;
        }
 
@@ -229,8 +224,6 @@ class ResourceLoader {
        public function __construct( Config $config = null ) {
                global $IP;
 
-               wfProfileIn( __METHOD__ );
-
                if ( $config === null ) {
                        wfDebug( __METHOD__ . ' was called without providing a Config instance' );
                        $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
@@ -254,7 +247,6 @@ class ResourceLoader {
                        $this->registerTestModules();
                }
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -278,14 +270,12 @@ class ResourceLoader {
         *   not registered
         */
        public function register( $name, $info = null ) {
-               wfProfileIn( __METHOD__ );
 
                // Allow multiple modules to be registered in one call
                $registrations = is_array( $name ) ? $name : array( $name => $info );
                foreach ( $registrations as $name => $info ) {
                        // Disallow duplicate registrations
                        if ( isset( $this->moduleInfos[$name] ) ) {
-                               wfProfileOut( __METHOD__ );
                                // A module has already been registered by this name
                                throw new MWException(
                                        'ResourceLoader duplicate registration error. ' .
@@ -295,7 +285,6 @@ class ResourceLoader {
 
                        // Check $name for validity
                        if ( !self::isValidModuleName( $name ) ) {
-                               wfProfileOut( __METHOD__ );
                                throw new MWException( "ResourceLoader module name '$name' is invalid, "
                                        . "see ResourceLoader::isValidModuleName()" );
                        }
@@ -309,7 +298,6 @@ class ResourceLoader {
                                // New calling convention
                                $this->moduleInfos[$name] = $info;
                        } else {
-                               wfProfileOut( __METHOD__ );
                                throw new MWException(
                                        'ResourceLoader module info type error for module \'' . $name .
                                        '\': expected ResourceLoaderModule or array (got: ' . gettype( $info ) . ')'
@@ -357,7 +345,6 @@ class ResourceLoader {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -371,8 +358,6 @@ class ResourceLoader {
                                . 'Edit your <code>LocalSettings.php</code> to enable it.' );
                }
 
-               wfProfileIn( __METHOD__ );
-
                // Get core test suites
                $testModules = array();
                $testModules['qunit'] = array();
@@ -400,7 +385,6 @@ class ResourceLoader {
                        $this->testModuleNames[$id] = array_keys( $testModules[$id] );
                }
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -579,8 +563,6 @@ class ResourceLoader {
                // See http://bugs.php.net/bug.php?id=36514
                ob_start();
 
-               wfProfileIn( __METHOD__ );
-
                // Find out which modules are missing and instantiate the others
                $modules = array();
                $missing = array();
@@ -609,8 +591,6 @@ class ResourceLoader {
                        $this->errors[] = self::formatExceptionNoComment( $e );
                }
 
-               wfProfileIn( __METHOD__ . '-getModifiedTime' );
-
                // To send Last-Modified and support If-Modified-Since, we need to detect
                // the last modified time
                $mtime = wfTimestamp( TS_UNIX, $this->config->get( 'CacheEpoch' ) );
@@ -628,11 +608,8 @@ class ResourceLoader {
                        }
                }
 
-               wfProfileOut( __METHOD__ . '-getModifiedTime' );
-
                // If there's an If-Modified-Since header, respond with a 304 appropriately
                if ( $this->tryRespondLastModified( $context, $mtime ) ) {
-                       wfProfileOut( __METHOD__ );
                        return; // output handled (buffers cleared)
                }
 
@@ -682,7 +659,6 @@ class ResourceLoader {
                $this->errors = array();
                echo $response;
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -880,8 +856,6 @@ class ResourceLoader {
    no modules were requested. Max made me put this here. */";
                }
 
-               wfProfileIn( __METHOD__ );
-
                $image = $context->getImageObj();
                if ( $image ) {
                        $data = $image->getImageData( $context );
@@ -889,7 +863,6 @@ class ResourceLoader {
                                $data = '';
                                $this->errors[] = 'Image generation failed';
                        }
-                       wfProfileOut( __METHOD__ );
                        return $data;
                }
 
@@ -920,7 +893,6 @@ class ResourceLoader {
                         * @var $module ResourceLoaderModule
                         */
 
-                       wfProfileIn( __METHOD__ . '-' . $name );
                        try {
                                $scripts = '';
                                if ( $context->shouldIncludeScripts() ) {
@@ -1034,7 +1006,6 @@ class ResourceLoader {
                                unset( $modules[$name] );
                        }
                        $isRaw |= $module->isRaw();
-                       wfProfileOut( __METHOD__ . '-' . $name );
                }
 
                // Update module states
@@ -1066,7 +1037,6 @@ class ResourceLoader {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $out;
        }