MediaWiki  master
MediaWiki\ResourceLoader\FilePath Class Reference

A path to a bundled file (such as JavaScript or CSS), along with a remote and local base path. More...

Public Member Functions

 __construct ( $path, $localBasePath=null, $remoteBasePath=null)
 
 getLocalBasePath ()
 
 getLocalPath ()
 
 getPath ()
 
 getRemoteBasePath ()
 
 getRemotePath ()
 

Protected Attributes

string null $localBasePath
 Local base path. More...
 
string $path
 Path to the file. More...
 
string null $remoteBasePath
 Remote base path. More...
 

Detailed Description

A path to a bundled file (such as JavaScript or CSS), along with a remote and local base path.

This is for use with FileModule. Base path may be null, which indicates that the path is expanded relative to the corresponding base path of the FileModule object instead.

Since
1.17

Definition at line 34 of file FilePath.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\ResourceLoader\FilePath::__construct (   $path,
  $localBasePath = null,
  $remoteBasePath = null 
)
Parameters
string$pathRelative path to the file, no leading slash.
string | null$localBasePathBase path to prepend when generating a local path.
string | null$remoteBasePathBase path to prepend when generating a remote path. Should not have a trailing slash unless at web document root.

Definition at line 50 of file FilePath.php.

References MediaWiki\ResourceLoader\FilePath\$localBasePath, MediaWiki\ResourceLoader\FilePath\$path, and MediaWiki\ResourceLoader\FilePath\$remoteBasePath.

Member Function Documentation

◆ getLocalBasePath()

MediaWiki\ResourceLoader\FilePath::getLocalBasePath ( )
Returns
string|null

Definition at line 86 of file FilePath.php.

References MediaWiki\ResourceLoader\FilePath\$localBasePath.

◆ getLocalPath()

MediaWiki\ResourceLoader\FilePath::getLocalPath ( )
Returns
string
Exceptions
RuntimeExceptionIf the base path was not provided. You must either provide the base path in the constructor, or use getPath() instead and add the base path from a FileModule.

Definition at line 61 of file FilePath.php.

◆ getPath()

MediaWiki\ResourceLoader\FilePath::getPath ( )
Returns
string

Definition at line 96 of file FilePath.php.

References MediaWiki\ResourceLoader\FilePath\$path.

◆ getRemoteBasePath()

MediaWiki\ResourceLoader\FilePath::getRemoteBasePath ( )
Returns
string|null

Definition at line 91 of file FilePath.php.

References MediaWiki\ResourceLoader\FilePath\$remoteBasePath.

◆ getRemotePath()

MediaWiki\ResourceLoader\FilePath::getRemotePath ( )
Returns
string
Exceptions
RuntimeExceptionIf the base path was not provided. You must either provide the base path in the constructor, or use getPath() instead and add the base path from a FileModule.

Definition at line 73 of file FilePath.php.

References MediaWiki\ResourceLoader\FilePath\$path.

Member Data Documentation

◆ $localBasePath

string null MediaWiki\ResourceLoader\FilePath::$localBasePath
protected

◆ $path

string MediaWiki\ResourceLoader\FilePath::$path
protected

◆ $remoteBasePath

string null MediaWiki\ResourceLoader\FilePath::$remoteBasePath
protected

The documentation for this class was generated from the following file: