Move LikeMatch to Rdbms namespace
[mediawiki.git] / includes / resourceloader / ResourceLoaderFilePath.php
blobdd239d09435f12e33d400df9681b60a974991e62
1 <?php
2 /**
3 * An object to represent a path to a JavaScript/CSS file, along with a remote
4 * and local base path, for use with ResourceLoaderFileModule.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
21 * @file
24 /**
25 * An object to represent a path to a JavaScript/CSS file, along with a remote
26 * and local base path, for use with ResourceLoaderFileModule.
28 class ResourceLoaderFilePath {
29 /* Protected Members */
31 /** @var string Local base path */
32 protected $localBasePath;
34 /** @var string Remote base path */
35 protected $remoteBasePath;
37 /**
38 * @var string Path to the file */
39 protected $path;
41 /* Methods */
43 /**
44 * @param string $path Path to the file.
45 * @param string $localBasePath Base path to prepend when generating a local path.
46 * @param string $remoteBasePath Base path to prepend when generating a remote path.
48 public function __construct( $path, $localBasePath, $remoteBasePath ) {
49 $this->path = $path;
50 $this->localBasePath = $localBasePath;
51 $this->remoteBasePath = $remoteBasePath;
54 /**
55 * @return string
57 public function getLocalPath() {
58 return "{$this->localBasePath}/{$this->path}";
61 /**
62 * @return string
64 public function getRemotePath() {
65 return "{$this->remoteBasePath}/{$this->path}";
68 /**
69 * @return string
71 public function getPath() {
72 return $this->path;