1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 19:54:12 +02:00

[ticket/15253] Use storage helper methods instead of filesystem methods

PHPBB3-15253
This commit is contained in:
Rubén Calvo
2017-06-26 15:49:31 +02:00
parent 21c9b0eeae
commit ecb79539f4
62 changed files with 109 additions and 598 deletions

View File

@@ -94,8 +94,7 @@ class extension_base extends Extension
if ($services_directory && $services_file)
{
$filesystem = new \phpbb\filesystem\filesystem();
$loader = new YamlFileLoader($container, new FileLocator($filesystem->realpath($services_directory)));
$loader = new YamlFileLoader($container, new FileLocator(\phpbb\storage\helper::realpath($services_directory)));
$loader->load($services_file);
}
}

View File

@@ -40,14 +40,13 @@ class manager
* @param ContainerInterface $container A container
* @param \phpbb\db\driver\driver_interface $db A database connection
* @param \phpbb\config\config $config Config object
* @param \phpbb\filesystem\filesystem_interface $filesystem
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension, defaults to php
* @param \phpbb\cache\service $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\filesystem\filesystem_interface $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\service $cache = null, $cache_name = '_ext')
public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\service $cache = null, $cache_name = '_ext')
{
$this->cache = $cache;
$this->cache_name = $cache_name;
@@ -55,7 +54,6 @@ class manager
$this->container = $container;
$this->db = $db;
$this->extension_table = $extension_table;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
@@ -619,7 +617,7 @@ class manager
*/
public function get_finder($use_all_available = false)
{
$finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
$finder = new \phpbb\finder($this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
if ($use_all_available)
{
$finder->set_extensions(array_keys($this->all_available()));