MediaWiki REL1_37
ResourceLoaderFilePath.php
Go to the documentation of this file.
1<?php
30 protected $localBasePath;
31
33 protected $remoteBasePath;
34
36 protected $path;
37
44 public function __construct( $path, $localBasePath = '', $remoteBasePath = '' ) {
45 $this->path = $path;
46 $this->localBasePath = $localBasePath;
47 $this->remoteBasePath = $remoteBasePath;
48 }
49
51 public function getLocalPath() {
52 return $this->localBasePath === '' ?
53 $this->path :
54 "{$this->localBasePath}/{$this->path}";
55 }
56
58 public function getRemotePath() {
59 if ( $this->remoteBasePath === '' ) {
60 // No base path configured
61 return $this->path;
62 }
63 if ( $this->remoteBasePath === '/' ) {
64 // In document root
65 // Don't insert another slash (T284391).
66 return $this->remoteBasePath . $this->path;
67 }
68 return "{$this->remoteBasePath}/{$this->path}";
69 }
70
72 public function getLocalBasePath() {
74 }
75
77 public function getRemoteBasePath() {
79 }
80
82 public function getPath() {
83 return $this->path;
84 }
85}
An object to represent a path to a JavaScript/CSS file, along with a remote and local base path,...
string $path
Path to the file.
string $localBasePath
Local base path.
__construct( $path, $localBasePath='', $remoteBasePath='')
string $remoteBasePath
Remote base path.