use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
+use Wikimedia\RelPath;
use Wikimedia\ScopedCallback;
/**
* Set this module's name. This is called by ResourceLoader::register()
* when registering the module. Other code should not call this.
*
- * @param string $name Name
+ * @param string $name
*/
public function setName( $name ) {
$this->name = $name;
return 'local';
}
- /**
- * From where in the page HTML should this module be loaded?
- *
- * @deprecated since 1.29 Obsolete. All modules load async from `<head>`.
- * @return string
- */
- public function getPosition() {
- return 'top';
- }
-
/**
* Whether this module's JS expects to work without the client-side ResourceLoader module.
* Returning true from this function will prevent mw.loader.state() call from being
public static function getRelativePaths( array $filePaths ) {
global $IP;
return array_map( function ( $path ) use ( $IP ) {
- return RelPath\getRelativePath( $path, $IP );
+ return RelPath::getRelativePath( $path, $IP );
}, $filePaths );
}
public static function expandRelativePaths( array $filePaths ) {
global $IP;
return array_map( function ( $path ) use ( $IP ) {
- return RelPath\joinPath( $IP, $path );
+ return RelPath::joinPath( $IP, $path );
}, $filePaths );
}
* 'https://example.org/image.png' => [ 'as' => 'image' ],
* ];
* }
- * @encode
+ * @endcode
*
* @par Example using HiDPI image variants
* @code
* ],
* ];
* }
- * @encode
+ * @endcode
*
* @see ResourceLoaderModule::getHeaders
* @since 1.30
* Get this module's last modification timestamp for a given context.
*
* @deprecated since 1.26 Use getDefinitionSummary() instead
- * @param ResourceLoaderContext $context Context object
+ * @param ResourceLoaderContext $context
* @return int|null UNIX timestamp
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
* @return int UNIX timestamp
*/
protected static function safeFilemtime( $filePath ) {
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$mtime = filemtime( $filePath ) ?: 1;
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
return $mtime;
}