Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
file_locator | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\routing; |
15 | |
16 | use Symfony\Component\Config\FileLocator; |
17 | use phpbb\filesystem\helper as filesystem_helper; |
18 | |
19 | class file_locator extends FileLocator |
20 | { |
21 | public function __construct($paths = []) |
22 | { |
23 | $paths = (array) $paths; |
24 | $absolute_paths = []; |
25 | |
26 | foreach ($paths as $path) |
27 | { |
28 | $path = filesystem_helper::realpath($path); |
29 | if ($path !== false) |
30 | { |
31 | $absolute_paths[] = $path; |
32 | } |
33 | } |
34 | |
35 | parent::__construct($absolute_paths); |
36 | } |
37 | } |