diff --git a/phpBB/config/default/container/services_attachment.yml b/phpBB/config/default/container/services_attachment.yml index 5b614d2f60..0ec8357599 100644 --- a/phpBB/config/default/container/services_attachment.yml +++ b/phpBB/config/default/container/services_attachment.yml @@ -36,4 +36,5 @@ services: - '@dispatcher' - '@plupload' - '@storage.attachment' + - '@temp' - '@user' diff --git a/phpBB/config/default/container/services_db.yml b/phpBB/config/default/container/services_db.yml index b52b29e20f..4a005d5e50 100644 --- a/phpBB/config/default/container/services_db.yml +++ b/phpBB/config/default/container/services_db.yml @@ -34,7 +34,7 @@ services: class: phpbb\db\extractor\mssql_extractor shared: false arguments: - - '@filesystem' + - '@temp' - '@request' - '@dbal.conn.driver' @@ -42,7 +42,7 @@ services: class: phpbb\db\extractor\mysql_extractor shared: false arguments: - - '@filesystem' + - '@temp' - '@request' - '@dbal.conn.driver' @@ -50,7 +50,7 @@ services: class: phpbb\db\extractor\oracle_extractor shared: false arguments: - - '@filesystem' + - '@temp' - '@request' - '@dbal.conn.driver' @@ -58,7 +58,7 @@ services: class: phpbb\db\extractor\postgres_extractor shared: false arguments: - - '@filesystem' + - '@temp' - '@request' - '@dbal.conn.driver' @@ -66,6 +66,6 @@ services: class: phpbb\db\extractor\sqlite3_extractor shared: false arguments: - - '@filesystem' + - '@temp' - '@request' - '@dbal.conn.driver' diff --git a/phpBB/config/default/container/services_files.yml b/phpBB/config/default/container/services_files.yml index b5310c8c6e..43be127ea2 100644 --- a/phpBB/config/default/container/services_files.yml +++ b/phpBB/config/default/container/services_files.yml @@ -71,11 +71,10 @@ services: arguments: - '@config' - '@files.factory' - - '@filesystem' + - '@temp' - '@language' - '@php_ini' - '@request' - - '%core.root_path%' files.types.remote_storage: class: phpbb\files\types\remote_storage @@ -83,8 +82,7 @@ services: arguments: - '@config' - '@files.factory' - - '@filesystem' + - '@temp' - '@language' - '@php_ini' - '@request' - - '%core.root_path%' diff --git a/phpBB/config/default/container/services_filesystem.yml b/phpBB/config/default/container/services_filesystem.yml index 36025755fd..e7832bf37d 100644 --- a/phpBB/config/default/container/services_filesystem.yml +++ b/phpBB/config/default/container/services_filesystem.yml @@ -4,5 +4,9 @@ parameters: services: filesystem: class: phpbb\filesystem\filesystem + + temp: + class: phpbb\filesystem\temp arguments: + - '@filesystem' - '%core.filesystem.cache_temp_dir%' diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 2b0f4181b3..77e03ee449 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -215,7 +215,7 @@ class compress_zip extends compress global $phpbb_filesystem; $this->fp = @fopen($file, $mode . 'b'); - $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem(''); + $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem(); if (!$this->fp) { @@ -582,7 +582,7 @@ class compress_tar extends compress $this->type = &$type; $this->open(); - $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem(''); + $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem(); } /** diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php index 82a7578380..b3cd4972a1 100644 --- a/phpBB/phpbb/attachment/upload.php +++ b/phpBB/phpbb/attachment/upload.php @@ -21,6 +21,7 @@ use \phpbb\language\language; use \phpbb\mimetype\guesser; use \phpbb\plupload\plupload; use \phpbb\storage\storage; +use \phpbb\filesystem\temp; use \phpbb\user; /** @@ -55,6 +56,9 @@ class upload /** @var storage */ protected $storage; + /** @var temp */ + protected $temp; + /** @var user */ protected $user; @@ -80,9 +84,10 @@ class upload * @param guesser $mimetype_guesser * @param dispatcher $phpbb_dispatcher * @param plupload $plupload + * @param temp $temp * @param user $user */ - public function __construct(auth $auth, service $cache, config $config, \phpbb\files\upload $files_upload, language $language, guesser $mimetype_guesser, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, user $user) + public function __construct(auth $auth, service $cache, config $config, \phpbb\files\upload $files_upload, language $language, guesser $mimetype_guesser, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, temp $temp, user $user) { $this->auth = $auth; $this->cache = $cache; @@ -93,6 +98,7 @@ class upload $this->phpbb_dispatcher = $phpbb_dispatcher; $this->plupload = $plupload; $this->storage = $storage; + $this->temp = $temp; $this->user = $user; } @@ -234,7 +240,7 @@ class upload { $source = $this->file->get('filename'); $destination_name = 'thumb_' . $this->file->get('realname'); - $destination = sys_get_temp_dir() . '/' . $destination_name; + $destination = $this->temp->get_temp_dir() . '/' . $destination_name; if (create_thumbnail($source, $destination, $this->file->get('mimetype'))) { diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index 2e9018ca19..de6f444251 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -35,7 +35,7 @@ class file extends \phpbb\cache\driver\base global $phpbb_container; $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_container->getParameter('core.cache_dir'); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); if (!is_dir($this->cache_dir)) { diff --git a/phpBB/phpbb/composer/installer.php b/phpBB/phpbb/composer/installer.php index 5038cc7cb8..3a03e29ef5 100644 --- a/phpBB/phpbb/composer/installer.php +++ b/phpBB/phpbb/composer/installer.php @@ -402,7 +402,7 @@ class installer */ public function check_requirements() { - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); return $filesystem->is_writable([ $this->root_path . $this->composer_filename, diff --git a/phpBB/phpbb/db/extractor/base_extractor.php b/phpBB/phpbb/db/extractor/base_extractor.php index 1c49b5b70a..b750f064bb 100644 --- a/phpBB/phpbb/db/extractor/base_extractor.php +++ b/phpBB/phpbb/db/extractor/base_extractor.php @@ -22,9 +22,9 @@ use phpbb\db\extractor\exception\extractor_not_initialized_exception; abstract class base_extractor implements extractor_interface { /** - * @var \phpbb\filesystem\filesystem + * @var \phpbb\filesystem\temp */ - protected $filesystem; + protected $temp; /** * @var \phpbb\request\request_interface @@ -84,12 +84,13 @@ abstract class base_extractor implements extractor_interface /** * Constructor * + * @param \phpbb\filesystem\temp $temp * @param \phpbb\request\request_interface $request * @param \phpbb\db\driver\driver_interface $db */ - public function __construct(\phpbb\filesystem\filesystem $filesystem, \phpbb\request\request_interface $request, \phpbb\db\driver\driver_interface $db) + public function __construct(\phpbb\filesystem\temp $temp, \phpbb\request\request_interface $request, \phpbb\db\driver\driver_interface $db) { - $this->filesystem = $filesystem; + $this->temp = $temp; $this->request = $request; $this->db = $db; $this->fp = null; @@ -163,7 +164,7 @@ abstract class base_extractor implements extractor_interface if ($store === true) { - $file = $this->filesystem->get_temp_dir() . '/' . $filename . $ext; + $file = $this->temp->get_temp_dir() . '/' . $filename . $ext; $this->fp = $open($file, 'w'); diff --git a/phpBB/phpbb/files/types/remote.php b/phpBB/phpbb/files/types/remote.php index b32b06adce..3bfd7dc7cd 100644 --- a/phpBB/phpbb/files/types/remote.php +++ b/phpBB/phpbb/files/types/remote.php @@ -17,7 +17,7 @@ use bantu\IniGetWrapper\IniGetWrapper; use phpbb\config\config; use phpbb\files\factory; use phpbb\files\filespec; -use phpbb\filesystem\filesystem; +use phpbb\filesystem\temp; use phpbb\language\language; use phpbb\request\request_interface; @@ -29,8 +29,8 @@ class remote extends base /** @var factory Files factory */ protected $factory; - /** @var filesystem Filesystem */ - protected $filesystem; + /** @var filesystem Filesystem temp */ + protected $temp; /** @var language */ protected $language; @@ -41,29 +41,24 @@ class remote extends base /** @var request_interface */ protected $request; - /** @var string phpBB root path */ - protected $phpbb_root_path; - /** * Construct a form upload type * * @param config $config phpBB config * @param factory $factory Files factory - * @param filesystem $filesystem Filesystem + * @param temp $temp Filesystem temp * @param language $language Language class * @param IniGetWrapper $php_ini ini_get() wrapper * @param request_interface $request Request object - * @param string $phpbb_root_path phpBB root path */ - public function __construct(config $config, factory $factory, filesystem $filesystem, language $language, IniGetWrapper $php_ini, request_interface $request, $phpbb_root_path) + public function __construct(config $config, factory $factory, temp $temp, language $language, IniGetWrapper $php_ini, request_interface $request) { $this->config = $config; $this->factory = $factory; - $this->filesystem = $filesystem; + $this->temp = $temp; $this->language = $language; $this->php_ini = $php_ini; $this->request = $request; - $this->phpbb_root_path = $phpbb_root_path; } /** @@ -151,7 +146,7 @@ class remote extends base $data = $response->getBody(); - $filename = tempnam($this->filesystem->get_temp_dir(), unique_id() . '-'); + $filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) { diff --git a/phpBB/phpbb/files/types/remote_storage.php b/phpBB/phpbb/files/types/remote_storage.php index 54960b477e..8c2ceb6900 100644 --- a/phpBB/phpbb/files/types/remote_storage.php +++ b/phpBB/phpbb/files/types/remote_storage.php @@ -17,7 +17,7 @@ use bantu\IniGetWrapper\IniGetWrapper; use phpbb\config\config; use phpbb\files\factory; use phpbb\files\filespec; -use phpbb\filesystem\filesystem; +use phpbb\filesystem\temp; use phpbb\language\language; use phpbb\request\request_interface; @@ -29,8 +29,8 @@ class remote_storage extends base /** @var factory Files factory */ protected $factory; - /** @var filesystem Filesystem */ - protected $filesystem; + /** @var temp Filesystem temp */ + protected $temp; /** @var language */ protected $language; @@ -41,29 +41,24 @@ class remote_storage extends base /** @var request_interface */ protected $request; - /** @var string phpBB root path */ - protected $phpbb_root_path; - /** * Construct a form upload type * * @param config $config phpBB config * @param factory $factory Files factory - * @param filesystem $filesystem Filesystem + * @param temp $temp Filesystem temp * @param language $language Language class * @param IniGetWrapper $php_ini ini_get() wrapper * @param request_interface $request Request object - * @param string $phpbb_root_path phpBB root path */ - public function __construct(config $config, factory $factory, filesystem $filesystem, language $language, IniGetWrapper $php_ini, request_interface $request, $phpbb_root_path) + public function __construct(config $config, factory $factory, temp $temp, language $language, IniGetWrapper $php_ini, request_interface $request) { $this->config = $config; $this->factory = $factory; - $this->filesystem = $filesystem; + $this->temp = $temp; $this->language = $language; $this->php_ini = $php_ini; $this->request = $request; - $this->phpbb_root_path = $phpbb_root_path; } /** @@ -150,7 +145,7 @@ class remote_storage extends base $data = $response->getBody(); - $filename = tempnam($this->filesystem->get_temp_dir(), unique_id() . '-'); + $filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) { diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index ed63282d99..7754a4107b 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -42,25 +42,14 @@ class filesystem implements filesystem_interface */ protected $symfony_filesystem; - /** - * @var string - */ - protected $cache_temp_dir; - - /** - * @var string - */ - protected $temp_dir; - /** * Constructor */ - public function __construct($cache_temp_dir) + public function __construct() { $this->chmod_info = array(); $this->symfony_filesystem = new \Symfony\Component\Filesystem\Filesystem(); $this->working_directory = null; - $this->cache_temp_dir = $cache_temp_dir; } /** @@ -753,33 +742,4 @@ class filesystem implements filesystem_interface { return helper::resolve_path($path, $prefix, $absolute, $return_array); } - - /** - * Get a temporary directory to write files - * - * @return string returns the directory - */ - public function get_temp_dir() - { - if (!isset($this->temp_dir)) - { - $tmp_dir = (function_exists('sys_get_temp_dir')) ? sys_get_temp_dir() : ''; - - // Prevent trying to write to system temp dir in case of open_basedir - // restrictions being in effect - if (empty($tmp_dir) || !@file_exists($tmp_dir) || !@is_writable($tmp_dir)) - { - $tmp_dir = $this->cache_temp_dir; - - if (!is_dir($tmp_dir)) - { - $this->mkdir($tmp_dir, 0777); - } - } - - $this->temp_dir = helper::realpath($tmp_dir); - } - - return $this->temp_dir; - } } diff --git a/phpBB/phpbb/filesystem/temp.php b/phpBB/phpbb/filesystem/temp.php new file mode 100644 index 0000000000..ffd9cc6973 --- /dev/null +++ b/phpBB/phpbb/filesystem/temp.php @@ -0,0 +1,54 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\filesystem; + +class temp +{ + /** + * @var string + */ + protected $temp_dir; + + /** + * Constructor + */ + public function __construct($filesystem, $cache_temp_dir) + { + $tmp_dir = (function_exists('sys_get_temp_dir')) ? sys_get_temp_dir() : ''; + + // Prevent trying to write to system temp dir in case of open_basedir + // restrictions being in effect + if (empty($tmp_dir) || !@file_exists($tmp_dir) || !@is_writable($tmp_dir)) + { + $tmp_dir = $cache_temp_dir; + + if (!is_dir($tmp_dir)) + { + $filesystem->mkdir($tmp_dir, 0777); + } + } + + $this->temp_dir = helper::realpath($tmp_dir); + } + + /** + * Get a temporary directory to write files + * + * @return string returns the directory + */ + public function get_temp_dir() + { + return $this->temp_dir; + } +} diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index 61208ccaa7..a9567510c8 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -54,8 +54,12 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case /** @var \phpbb\attachment\upload */ protected $upload; + /** @var \phpbb\filesystem\filesystem */ private $filesystem; + /** @var \phpbb\filesystem\temp */ + protected $temp; + /** @var \Symfony\Component\DependencyInjection\ContainerInterface */ protected $container; @@ -85,7 +89,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), $this->config, $this->db, $phpbb_root_path, $phpEx); $this->request = $this->createMock('\phpbb\request\request'); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; $guessers = array( @@ -143,6 +147,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->factory = new \phpbb\files\factory($this->container); $this->files_upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $this->phpbb_dispatcher = new phpbb_mock_event_dispatcher(); + $this->temp = new \phpbb\filesystem\temp($this->filesystem, ''); $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); $this->upload = new \phpbb\attachment\upload( @@ -155,6 +160,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->phpbb_dispatcher, $this->plupload, $this->storage, + $this->temp, $this->user ); } @@ -247,6 +253,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->phpbb_dispatcher, $this->plupload, $this->storage, + $this->temp, $this->user ); @@ -411,6 +418,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->phpbb_dispatcher, $plupload, $this->storage, + $this->temp, $this->user ); diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index a78c7a30cd..2866a1673d 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -35,7 +35,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case ->method('get') ->will($this->returnArgument(0)); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $adapter = new \phpbb\storage\adapter\local($filesystem, new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); $adapter->configure(['path' => 'images/avatars/upload']); $adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory'); diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php index 5b32823230..ecce6f157c 100644 --- a/tests/console/thumbnail_test.php +++ b/tests/console/thumbnail_test.php @@ -68,7 +68,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case $this->application->add(new delete($this->user, $this->db, $this->phpbb_root_path)); $this->application->add(new recreate($this->user)); - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); copy(dirname(__FILE__) . '/fixtures/png.png', $this->phpbb_root_path . 'files/test_png_1'); copy(dirname(__FILE__) . '/fixtures/png.png', $this->phpbb_root_path . 'files/test_png_2'); diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index ac2efdcfc3..d4feeaad22 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -298,7 +298,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case $db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(''), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); + $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); $adapter->configure(['path' => 'files']); $adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory'); $adapter_factory_mock->expects($this->any()) diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 7dc869cbdc..3c732ff49b 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -88,7 +88,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case $this->symfony_request = new \phpbb\symfony_request( $this->request ); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->phpbb_path_helper = new \phpbb\path_helper( $this->symfony_request, $this->request, diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php index 7cc887b4ed..3933dab798 100644 --- a/tests/dbal/connect_test.php +++ b/tests/dbal/connect_test.php @@ -22,7 +22,7 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case { global $phpbb_root_path, $phpEx, $phpbb_filesystem; - $phpbb_filesystem = new phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new phpbb\filesystem\filesystem(); $config = $this->get_database_config(); diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index 1c6195633c..245c2c3a58 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -36,7 +36,7 @@ class phpbb_email_parsing_test extends phpbb_test_case $symfony_request = new \phpbb\symfony_request( $request ); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_path_helper = new \phpbb\path_helper( $symfony_request, $request, diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index 5e31be0b4f..8ed89bbe52 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -19,7 +19,7 @@ class phpbb_error_collector_test extends phpbb_test_case global $phpbb_filesystem; - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); } public function test_collection() diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 7422f68b67..5887fd974d 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -53,7 +53,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $cache_path = $this->phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(''); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( new phpbb_mock_request() diff --git a/tests/feed/attachments_base_test.php b/tests/feed/attachments_base_test.php index 9eb67eb022..3d66c906ad 100644 --- a/tests/feed/attachments_base_test.php +++ b/tests/feed/attachments_base_test.php @@ -29,7 +29,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case { global $phpbb_root_path, $phpEx; - $this->filesystem = new \phpbb\filesystem(''); + $this->filesystem = new \phpbb\filesystem(); $config = new \phpbb\config\config(array()); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( diff --git a/tests/files/types_base_test.php b/tests/files/types_base_test.php index 48fe071830..3b1cf68d50 100644 --- a/tests/files/types_base_test.php +++ b/tests/files/types_base_test.php @@ -41,7 +41,7 @@ class phpbb_files_types_base_test extends phpbb_test_case $this->request = $this->createMock('\phpbb\request\request'); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; diff --git a/tests/files/types_form_test.php b/tests/files/types_form_test.php index 71ce07babb..25d79f6117 100644 --- a/tests/files/types_form_test.php +++ b/tests/files/types_form_test.php @@ -47,7 +47,7 @@ class phpbb_files_types_form_test extends phpbb_test_case ->method('file') ->willReturn(array()); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php index a7a2cd78cf..67e4c571f5 100644 --- a/tests/files/types_local_test.php +++ b/tests/files/types_local_test.php @@ -47,7 +47,7 @@ class phpbb_files_types_local_test extends phpbb_test_case ->method('file') ->willReturn(array()); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php index 29e831e87f..ea869bb85c 100644 --- a/tests/files/types_remote_test.php +++ b/tests/files/types_remote_test.php @@ -21,6 +21,9 @@ class phpbb_files_types_remote_test extends phpbb_test_case /** @var \phpbb\filesystem\filesystem */ private $filesystem; + /** @var \phpbb\filesystem\temp */ + private $temp; + /** @var \phpbb\config\config */ protected $config; @@ -52,7 +55,8 @@ class phpbb_files_types_remote_test extends phpbb_test_case $this->request = $this->createMock('\phpbb\request\request'); $cache_path = $phpbb_root_path . 'cache/files'; - $this->filesystem = new \phpbb\filesystem\filesystem($cache_path); + $this->filesystem = new \phpbb\filesystem\filesystem(); + $this->temp = new \phpbb\filesystem\temp($this->filesystem, $cache_path); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; @@ -74,7 +78,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case public function test_upload_fsock_fail() { - $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->filesystem, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->temp, $this->language, $this->php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); @@ -109,7 +113,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case $php_ini->expects($this->any()) ->method('getString') ->willReturn($max_file_size); - $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->filesystem, $this->language, $php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\remote($this->config, $this->factory, $this->temp, $this->language, $php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); @@ -121,7 +125,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case public function test_upload_wrong_path() { - $type_remote = new \phpbb\files\types\foo($this->config, $this->factory, $this->filesystem, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); + $type_remote = new \phpbb\files\types\foo($this->config, $this->factory, $this->temp, $this->language, $this->php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_remote->set_upload($upload); diff --git a/tests/files/upload_test.php b/tests/files/upload_test.php index 60c2dc7d36..a9c2dca9d9 100644 --- a/tests/files/upload_test.php +++ b/tests/files/upload_test.php @@ -50,7 +50,7 @@ class phpbb_files_upload_test extends phpbb_test_case $this->request = $this->createMock('\phpbb\request\request'); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php index 3c99e785d0..d2dec424b4 100644 --- a/tests/filesystem/clean_path_test.php +++ b/tests/filesystem/clean_path_test.php @@ -18,7 +18,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case public function setUp() { parent::setUp(); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); } public function clean_path_data() diff --git a/tests/filesystem/is_absolute_test.php b/tests/filesystem/is_absolute_test.php index 181445e147..7a50989b74 100644 --- a/tests/filesystem/is_absolute_test.php +++ b/tests/filesystem/is_absolute_test.php @@ -20,7 +20,7 @@ class phpbb_filesystem_is_absolute_test extends phpbb_test_case { parent::setUp(); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); } static public function is_absolute_data() diff --git a/tests/filesystem/realpath_test.php b/tests/filesystem/realpath_test.php index 9b94592cb3..d994935f94 100644 --- a/tests/filesystem/realpath_test.php +++ b/tests/filesystem/realpath_test.php @@ -31,7 +31,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case { parent::setUp(); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); } public function realpath_resolve_absolute_without_symlinks_data() @@ -55,7 +55,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case return array(); } - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $relative_path = $filesystem->make_path_relative(__DIR__, getcwd()); return array( diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 235d81d48d..0d09d5fcc8 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -19,6 +19,9 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case /** @var \phpbb\filesystem\filesystem_interface */ protected $filesystem; + /** @var \phpbb\filesystem\temp */ + protected $temp; + /** @var \phpbb\files\factory */ protected $factory; @@ -52,7 +55,8 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $config['rand_seed_last_update'] = time() + 600; $config['remote_upload_verify'] = 0; - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); + $this->temp = new \phpbb\filesystem\temp($this->filesystem, ''); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->request = $this->createMock('\phpbb\request\request'); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; @@ -61,7 +65,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $container->set('files.filespec', new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \FastImageSize\FastImageSize(), $this->phpbb_root_path)); $this->factory = new \phpbb\files\factory($container); $container->set('files.factory', $this->factory); - $container->set('files.types.remote', new \phpbb\files\types\remote($config, $this->factory, $this->filesystem, $this->language, $this->php_ini, $this->request, $phpbb_root_path)); + $container->set('files.types.remote', new \phpbb\files\types\remote($config, $this->factory, $this->temp, $this->language, $this->php_ini, $this->request)); $this->phpbb_root_path = $phpbb_root_path; } diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index 9d1b897226..b51dabbba0 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -35,7 +35,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case $phpbb_container = new phpbb_mock_container_builder(); $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager()); - $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(''), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); + $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); $adapter->configure(['path' => 'files']); $adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory'); $adapter_factory_mock->expects($this->any()) diff --git a/tests/installer/database_helper_test.php b/tests/installer/database_helper_test.php index 9d728b205c..ed355884f6 100644 --- a/tests/installer/database_helper_test.php +++ b/tests/installer/database_helper_test.php @@ -20,7 +20,7 @@ class phpbb_installer_database_helper_test extends phpbb_test_case public function setUp() { - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_root_path = ''; $this->database_helper = new \phpbb\install\helper\database($filesystem, $phpbb_root_path); } diff --git a/tests/installer/module_base_test.php b/tests/installer/module_base_test.php index 7527268914..71ec2b8db2 100644 --- a/tests/installer/module_base_test.php +++ b/tests/installer/module_base_test.php @@ -43,7 +43,7 @@ class module_base_test extends phpbb_test_case $this->module = new test_installer_module($module_collection, true, false); $iohandler = $this->createMock('\phpbb\install\helper\iohandler\iohandler_interface'); - $config = new \phpbb\install\helper\config(new \phpbb\filesystem\filesystem(''), new \bantu\IniGetWrapper\IniGetWrapper(), '', 'php'); + $config = new \phpbb\install\helper\config(new \phpbb\filesystem\filesystem(), new \bantu\IniGetWrapper\IniGetWrapper(), '', 'php'); $this->module->setup($config, $iohandler); } diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php index 7c96eeeb4f..0d6d110647 100644 --- a/tests/mock/extension_manager.php +++ b/tests/mock/extension_manager.php @@ -21,7 +21,7 @@ class phpbb_mock_extension_manager extends \phpbb\extension\manager $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = 'php'; $this->extensions = $extensions; - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->container = $container; $this->config = new \phpbb\config\config(array()); $this->user = new \phpbb\user($lang,'\phpbb\datetime'); diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index bbd9bc938c..d882c106ac 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -92,7 +92,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c $lang = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); // Storage - $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(''), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); + $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); $adapter->configure(['path' => 'files']); $adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory'); $adapter_factory_mock->expects($this->any()) diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php index 5315c99fb4..b35510113a 100644 --- a/tests/privmsgs/delete_user_pms_test.php +++ b/tests/privmsgs/delete_user_pms_test.php @@ -92,7 +92,7 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case $phpbb_container = new phpbb_mock_container_builder(); $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager()); - $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(''), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); + $adapter = new \phpbb\storage\adapter\local(new \phpbb\filesystem\filesystem(), new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); $adapter->configure(['path' => 'files']); $adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory'); $adapter_factory_mock->expects($this->any()) diff --git a/tests/security/base.php b/tests/security/base.php index 2c7a0bd251..d2abdbc362 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -46,7 +46,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case $request = new phpbb_mock_request(array(), array(), array(), $this->server); $symfony_request = new \phpbb\symfony_request($request); - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); // Set no user and trick a bit to circumvent errors $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php index 26e95b2856..04da5f08b9 100644 --- a/tests/session/check_ban_test.php +++ b/tests/session/check_ban_test.php @@ -44,7 +44,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case $this->session = $this->session_factory->get_session($this->db); global $cache, $config, $phpbb_root_path, $phpEx, $phpbb_filesystem; - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); $this->backup_cache = $cache; // Change the global cache object for this test because diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php index 42adf719ce..f8aa3d27a5 100644 --- a/tests/session/extract_page_test.php +++ b/tests/session/extract_page_test.php @@ -160,7 +160,7 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case { global $symfony_request, $request, $phpbb_filesystem; - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); $server['HTTP_HOST'] = 'localhost'; $server['SERVER_NAME'] = 'localhost'; diff --git a/tests/storage/adapter/local_test.php b/tests/storage/adapter/local_test.php index 8099a49522..b478ce4009 100644 --- a/tests/storage/adapter/local_test.php +++ b/tests/storage/adapter/local_test.php @@ -21,7 +21,7 @@ { parent::setUp(); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_root_path = getcwd() . DIRECTORY_SEPARATOR; $this->adapter = new \phpbb\storage\adapter\local($filesystem, new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path); diff --git a/tests/template/asset_test.php b/tests/template/asset_test.php index 49ecc56012..3d2fdd8959 100644 --- a/tests/template/asset_test.php +++ b/tests/template/asset_test.php @@ -41,7 +41,7 @@ class phpbb_template_asset_test extends phpbb_test_case $path_helper->method('get_phpbb_root_path') ->willReturn($phpbb_root_path); - $asset = new asset('', $path_helper, new phpbb\filesystem\filesystem('')); + $asset = new asset('', $path_helper, new phpbb\filesystem\filesystem()); $asset->set_path($path, true); $this->assertEquals($expected, $asset->get_path()); diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php index 75b6bf834d..17a57fba35 100644 --- a/tests/template/template_allfolder_test.php +++ b/tests/template/template_allfolder_test.php @@ -33,7 +33,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case $user = new \phpbb\user($lang, '\phpbb\datetime'); $this->user = $user; - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php index fd603b113d..024bdc57ce 100644 --- a/tests/template/template_events_test.php +++ b/tests/template/template_events_test.php @@ -139,7 +139,7 @@ Zeta test event in all', dirname(__FILE__) . "/datasets/$dataset/" ); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( new phpbb_mock_request() diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 52f212b5aa..f195742dc6 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -28,7 +28,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $defaults = $this->config_defaults(); $config = new \phpbb\config\config(array_merge($defaults, $new_config)); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $this->phpbb_path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 5340132aad..bcb6f4cde7 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -80,7 +80,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $user = new \phpbb\user($lang, '\phpbb\datetime'); $this->user = $user; - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( @@ -126,7 +126,7 @@ class phpbb_template_template_test_case extends phpbb_test_case global $phpbb_filesystem; - $phpbb_filesystem = new \phpbb\filesystem\filesystem(''); + $phpbb_filesystem = new \phpbb\filesystem\filesystem(); } protected function tearDown() diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index c5069b703b..aa71bf6ed6 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -22,7 +22,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $defaults = $this->config_defaults(); $config = new \phpbb\config\config(array_merge($defaults, $new_config)); - $filesystem = new \phpbb\filesystem\filesystem(''); + $filesystem = new \phpbb\filesystem\filesystem(); $this->phpbb_path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 9f282d7d1d..f7ba3ba21b 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -354,7 +354,7 @@ class phpbb_database_test_connection_manager $queries = file_get_contents($filename); - $db_helper = new \phpbb\install\helper\database(new \phpbb\filesystem\filesystem(''), $phpbb_root_path); + $db_helper = new \phpbb\install\helper\database(new \phpbb\filesystem\filesystem(), $phpbb_root_path); $sql = $db_helper->remove_comments($queries); $sql = $db_helper->split_sql_file($sql, $this->dbms['DELIM']); diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 9f2d906355..18b6deed1f 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -75,7 +75,7 @@ class phpbb_filespec_test extends phpbb_test_case $this->mimetype_guesser = new \phpbb\mimetype\guesser($guessers); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->phpbb_root_path = $phpbb_root_path; } diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php index df658b459e..84fc00bf98 100644 --- a/tests/upload/fileupload_test.php +++ b/tests/upload/fileupload_test.php @@ -53,7 +53,7 @@ class phpbb_fileupload_test extends phpbb_test_case $this->request = $this->createMock('\phpbb\request\request'); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; - $this->filesystem = new \phpbb\filesystem\filesystem(''); + $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $guessers = array( new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser(), diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php index 53704b2ec7..6540d33287 100644 --- a/tests/viewonline/helper_test.php +++ b/tests/viewonline/helper_test.php @@ -17,7 +17,7 @@ class phpbb_viewonline_helper_test extends phpbb_test_case { parent::setUp(); - $this->viewonline_helper = new \phpbb\viewonline_helper(new \phpbb\filesystem\filesystem('')); + $this->viewonline_helper = new \phpbb\viewonline_helper(new \phpbb\filesystem\filesystem()); } public function session_pages_data()