path = $path; $this->localBasePath = $localBasePath; $this->remoteBasePath = $remoteBasePath; } /** * @return string * @throws RuntimeException If 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. */ public function getLocalPath() { if ( $this->localBasePath === null ) { throw new RuntimeException( 'Base path was not provided' ); } return "{$this->localBasePath}/{$this->path}"; } /** * @return string * @throws RuntimeException If 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. */ public function getRemotePath() { if ( $this->remoteBasePath === null ) { throw new RuntimeException( 'Base path was not provided' ); } if ( $this->remoteBasePath === '/' ) { // In document root // Don't insert another slash (T284391). return $this->remoteBasePath . $this->path; } return "{$this->remoteBasePath}/{$this->path}"; } /** @return string|null */ public function getLocalBasePath() { return $this->localBasePath; } /** @return string|null */ public function getRemoteBasePath() { return $this->remoteBasePath; } /** @return string */ public function getPath() { return $this->path; } } /** @deprecated since 1.39 */ class_alias( FilePath::class, 'ResourceLoaderFilePath' );