// Save filtered text to Memcached
$cache->set( $key, $result );
} catch ( Exception $exception ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": minification failed: $e" );
+ $this->hasErrors = true;
// Return exception as a comment
$result = $this->makeComment( $exception->__toString() );
- $this->hasErrors = true;
}
wfProfileOut( __METHOD__ );
$this->addSource( $wgResourceLoaderSources );
// Register core modules
- $this->register( include( "$IP/resources/Resources.php" ) );
+ $this->register( include "$IP/resources/Resources.php" );
// Register extension modules
wfRunHooks( 'ResourceLoaderRegisterModules', array( &$this ) );
$this->register( $wgResourceModules );
// Get core test suites
$testModules = array();
- $testModules['qunit'] = include( "$IP/tests/qunit/QUnitTestResources.php" );
+ $testModules['qunit'] = include "$IP/tests/qunit/QUnitTestResources.php";
// Get other test suites (e.g. from extensions)
wfRunHooks( 'ResourceLoaderTestModules', array( &$testModules, &$this ) );
* @param array $properties source properties
* @throws MWException
*/
- public function addSource( $id, $properties = null) {
+ public function addSource( $id, $properties = null ) {
// Allow multiple sources to be registered in one call
if ( is_array( $id ) ) {
foreach ( $id as $key => $value ) {
* @return Array
*/
public function getTestModuleNames( $framework = 'all' ) {
- /// @TODO: api siteinfo prop testmodulenames modulenames
+ /// @todo api siteinfo prop testmodulenames modulenames
if ( $framework == 'all' ) {
return $this->testModuleNames;
} elseif ( isset( $this->testModuleNames[$framework] ) && is_array( $this->testModuleNames[$framework] ) ) {
// Do not allow private modules to be loaded from the web.
// This is a security issue, see bug 34907.
if ( $module->getGroup() === 'private' ) {
- $errors .= $this->makeComment( "Cannot show private module \"$name\"" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ": request for private module denied: $e" );
$this->hasErrors = true;
+ // Add exception to the output as a comment
+ $errors .= $this->makeComment( "Cannot show private module \"$name\"" );
+
continue;
}
$modules[$name] = $module;
// Preload information needed to the mtime calculation below
try {
$this->preloadModuleInfo( array_keys( $modules ), $context );
- } catch( Exception $e ) {
+ } catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": preloading module info failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$errors .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
wfProfileIn( __METHOD__ . '-getModifiedTime' );
// Calculate maximum modified time
$mtime = max( $mtime, $module->getModifiedTime( $context ) );
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": calculating maximum modified time failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$errors .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
}
if ( !$good ) {
try { // RL always hits the DB on file cache miss...
wfGetDB( DB_SLAVE );
- } catch( DBConnectionError $e ) { // ...check if we need to fallback to cache
+ } catch ( DBConnectionError $e ) { // ...check if we need to fallback to cache
$good = $fileCache->isCacheGood(); // cache existence check
}
}
try {
$blobs = MessageBlobStore::get( $this, $modules, $context->getLanguage() );
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": pre-fetching blobs from MessageBlobStore failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$exceptions .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
} else {
$blobs = array();
break;
}
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": generating module package failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$exceptions .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
// Register module as missing
$missing[] = $name;