const TYPE_STYLES = 'styles';
const TYPE_COMBINED = 'combined';
+ # Desired load type
+ // Module only has styles (loaded via <style> or <link rel=stylesheet>)
+ const LOAD_STYLES = 'styles';
+ // Module may have other resources (loaded via mw.loader from a script)
+ const LOAD_GENERAL = 'general';
+
# sitewide core module like a skin file or jQuery component
const ORIGIN_CORE_SITEWIDE = 1;
return $this->origin;
}
- /**
- * Set this module's origin. This is called by ResourceLoader::register()
- * when registering the module. Other code should not call this.
- *
- * @param int $origin Origin
- */
- public function setOrigin( $origin ) {
- $this->origin = $origin;
- }
-
/**
* @param ResourceLoaderContext $context
* @return bool
return $this->targets;
}
+ /**
+ * Get the module's load type.
+ *
+ * @since 1.28
+ * @return string ResourceLoaderModule LOAD_* constant
+ */
+ public function getType() {
+ return self::LOAD_GENERAL;
+ }
+
/**
* Get the skip function.
*
]
);
- $dbw->onTransactionIdle( function () use ( &$scopeLock ) {
+ $dbw->onTransactionResolution( function () use ( &$scopeLock ) {
ScopedCallback::consume( $scopeLock ); // release after commit
} );
}