mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 10:16:36 +02:00
[ticket/13697] Moving filesystem related functions to filesystem service
* Moving filesystem service to \phpbb\filesystem namespace * Wraping Symfony's Filesystem component * Moving filesystem related functions from includes/functions.php into \phpbb\filesystem\filesystem Functions moved (and deprecated): - phpbb_chmod - phpbb_is_writable - phpbb_is_absolute - phpbb_own_realpath - phpbb_realpath * Adding interface for filesystem service PHPBB3-13697
This commit is contained in:
@@ -85,17 +85,24 @@ class router implements RouterInterface
|
||||
*/
|
||||
protected $route_collection;
|
||||
|
||||
/**
|
||||
* @var \phpbb\filesystem\filesystem_interface
|
||||
*/
|
||||
protected $filesystem;
|
||||
|
||||
/**
|
||||
* Construct method
|
||||
*
|
||||
* @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem helper
|
||||
* @param manager $extension_manager Extension manager
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $php_ext PHP file extension
|
||||
* @param string $environment Name of the current environment
|
||||
* @param array $routing_files Array of strings containing paths to YAML files holding route information
|
||||
*/
|
||||
public function __construct(manager $extension_manager, $phpbb_root_path, $php_ext, $environment, $routing_files = array())
|
||||
public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, manager $extension_manager, $phpbb_root_path, $php_ext, $environment, $routing_files = array())
|
||||
{
|
||||
$this->filesystem = $filesystem;
|
||||
$this->extension_manager = $extension_manager;
|
||||
$this->routing_files = $routing_files;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
@@ -148,7 +155,7 @@ class router implements RouterInterface
|
||||
$this->route_collection = new RouteCollection;
|
||||
foreach ($this->routing_files as $file_path)
|
||||
{
|
||||
$loader = new YamlFileLoader(new FileLocator(phpbb_realpath($base_path)));
|
||||
$loader = new YamlFileLoader(new FileLocator($this->filesystem->realpath($base_path)));
|
||||
$this->route_collection->addCollection($loader->load($file_path));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user