From 4bdef6fd21a5dcab455b0cd1ee2652de606929c3 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Thu, 12 Mar 2015 00:25:00 +0100 Subject: [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 --- phpBB/phpbb/routing/router.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/routing') diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php index 4ccd3cf5e3..5313106b0a 100644 --- a/phpBB/phpbb/routing/router.php +++ b/phpBB/phpbb/routing/router.php @@ -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)); } } -- cgit v1.2.1