<?php
/**
- * ResourceLoader module based on local JavaScript/CSS files.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*/
/**
- * ResourceLoader module based on local JavaScript/CSS files.
+ * Module based on local JavaScript/CSS files.
*
* The following public methods can query the database:
*
* - getDefinitionSummary / … / ResourceLoaderModule::getFileDependencies.
* - getVersionHash / getDefinitionSummary / … / ResourceLoaderModule::getFileDependencies.
* - getStyles / ResourceLoaderModule::saveFileDependencies.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
*/
class ResourceLoaderFileModule extends ResourceLoaderModule {
* @return string|array JavaScript code for $context, or package files data structure
*/
public function getScript( ResourceLoaderContext $context ) {
- $deprecationScript = $this->getDeprecationInformation();
+ $deprecationScript = $this->getDeprecationInformation( $context );
if ( $this->packageFiles !== null ) {
$packageFiles = $this->getPackageFiles( $context );
if ( $deprecationScript ) {
* keyed by media type
* @throws MWException
*/
- public function readStyleFiles( array $styles, $flip, $context ) {
+ public function readStyleFiles( array $styles, $flip, ResourceLoaderContext $context ) {
if ( !$styles ) {
return [];
}
* @return string CSS data in script file
* @throws MWException If the file doesn't exist
*/
- protected function readStyleFile( $path, $flip, $context ) {
+ protected function readStyleFile( $path, $flip, ResourceLoaderContext $context ) {
$localPath = $this->getLocalPath( $path );
$remotePath = $this->getRemotePath( $path );
if ( !file_exists( $localPath ) ) {
* @param ResourceLoaderContext $context
* @return bool
*/
- public function getFlip( $context ) {
+ public function getFlip( ResourceLoaderContext $context ) {
return $context->getDirection() === 'rtl' && !$this->noflip;
}