1 | <?php |
||
18 | abstract class AbstractFileLoader implements FileLoaderInterface |
||
19 | { |
||
20 | protected $basePath; |
||
21 | |||
22 | /** |
||
23 | * Sets base features path. |
||
24 | * |
||
25 | * @param string $path Base loader path |
||
26 | */ |
||
27 | 3 | public function setBasePath($path) |
|
31 | |||
32 | /** |
||
33 | * Finds relative path for provided absolute (relative to base features path). |
||
34 | * |
||
35 | * @param string $path Absolute path |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | protected function findRelativePath($path) |
||
40 | { |
||
41 | if (null !== $this->basePath) { |
||
42 | return strtr($path, array($this->basePath . DIRECTORY_SEPARATOR => '')); |
||
43 | } |
||
44 | |||
45 | return $path; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Finds absolute path for provided relative (relative to base features path). |
||
50 | * |
||
51 | * @param string $path Relative path |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | 45 | protected function findAbsolutePath($path) |
|
72 | } |
||
73 |