diff --git a/phpBB/config/default/container/services_attachment.yml b/phpBB/config/default/container/services_attachment.yml index 0ec8357599..afabbd6f95 100644 --- a/phpBB/config/default/container/services_attachment.yml +++ b/phpBB/config/default/container/services_attachment.yml @@ -36,5 +36,5 @@ services: - '@dispatcher' - '@plupload' - '@storage.attachment' - - '@temp' + - '@filesystem.temp' - '@user' diff --git a/phpBB/config/default/container/services_db.yml b/phpBB/config/default/container/services_db.yml index 4a005d5e50..fe7d42937d 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: - - '@temp' + - '@filesystem.temp' - '@request' - '@dbal.conn.driver' @@ -42,7 +42,7 @@ services: class: phpbb\db\extractor\mysql_extractor shared: false arguments: - - '@temp' + - '@filesystem.temp' - '@request' - '@dbal.conn.driver' @@ -50,7 +50,7 @@ services: class: phpbb\db\extractor\oracle_extractor shared: false arguments: - - '@temp' + - '@filesystem.temp' - '@request' - '@dbal.conn.driver' @@ -58,7 +58,7 @@ services: class: phpbb\db\extractor\postgres_extractor shared: false arguments: - - '@temp' + - '@filesystem.temp' - '@request' - '@dbal.conn.driver' @@ -66,6 +66,6 @@ services: class: phpbb\db\extractor\sqlite3_extractor shared: false arguments: - - '@temp' + - '@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 43be127ea2..d1114c9c68 100644 --- a/phpBB/config/default/container/services_files.yml +++ b/phpBB/config/default/container/services_files.yml @@ -71,7 +71,7 @@ services: arguments: - '@config' - '@files.factory' - - '@temp' + - '@filesystem.temp' - '@language' - '@php_ini' - '@request' @@ -82,7 +82,7 @@ services: arguments: - '@config' - '@files.factory' - - '@temp' + - '@filesystem.temp' - '@language' - '@php_ini' - '@request' diff --git a/phpBB/config/default/container/services_filesystem.yml b/phpBB/config/default/container/services_filesystem.yml index e7832bf37d..15206314b9 100644 --- a/phpBB/config/default/container/services_filesystem.yml +++ b/phpBB/config/default/container/services_filesystem.yml @@ -5,7 +5,7 @@ services: filesystem: class: phpbb\filesystem\filesystem - temp: + filesystem.temp: class: phpbb\filesystem\temp arguments: - '@filesystem' diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 63e9506ad9..c26ecdb849 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -22,7 +22,7 @@ if (!defined('IN_PHPBB')) class acp_database { protected $db_tools; - protected $filesystem; + protected $temp; public $u_action; function main($id, $mode) @@ -31,7 +31,7 @@ class acp_database global $phpbb_root_path, $phpbb_container, $phpbb_log, $table_prefix; $this->db_tools = $phpbb_container->get('dbal.tools'); - $this->filesystem = $phpbb_container->get('filesystem'); + $this->temp = $phpbb_container->get('filesystem.temp'); $storage = $phpbb_container->get('storage.backup'); $user->add_lang('acp/database'); @@ -176,7 +176,7 @@ class acp_database $file = $filename . $ext; // Copy to storage using streams - $temp_dir = $this->filesystem->get_temp_dir(); + $temp_dir = $this->temp->get_dir(); $fp = fopen($temp_dir . '/' . $file, 'rb'); @@ -349,7 +349,7 @@ class acp_database } // Copy file to temp folder to decompress it - $temp_file_name = $this->filesystem->get_temp_dir() . '/' . $file_name; + $temp_file_name = $this->temp->get_dir() . '/' . $file_name; try { diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php index b3cd4972a1..54515fd0a6 100644 --- a/phpBB/phpbb/attachment/upload.php +++ b/phpBB/phpbb/attachment/upload.php @@ -240,7 +240,7 @@ class upload { $source = $this->file->get('filename'); $destination_name = 'thumb_' . $this->file->get('realname'); - $destination = $this->temp->get_temp_dir() . '/' . $destination_name; + $destination = $this->temp->get_dir() . '/' . $destination_name; if (create_thumbnail($source, $destination, $this->file->get('mimetype'))) { diff --git a/phpBB/phpbb/db/extractor/base_extractor.php b/phpBB/phpbb/db/extractor/base_extractor.php index b750f064bb..106e047eaa 100644 --- a/phpBB/phpbb/db/extractor/base_extractor.php +++ b/phpBB/phpbb/db/extractor/base_extractor.php @@ -164,7 +164,7 @@ abstract class base_extractor implements extractor_interface if ($store === true) { - $file = $this->temp->get_temp_dir() . '/' . $filename . $ext; + $file = $this->temp->get_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 3bfd7dc7cd..17c3d7a614 100644 --- a/phpBB/phpbb/files/types/remote.php +++ b/phpBB/phpbb/files/types/remote.php @@ -146,7 +146,7 @@ class remote extends base $data = $response->getBody(); - $filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-'); + $filename = tempnam($this->temp->get_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 8c2ceb6900..d542c5e2f4 100644 --- a/phpBB/phpbb/files/types/remote_storage.php +++ b/phpBB/phpbb/files/types/remote_storage.php @@ -145,7 +145,7 @@ class remote_storage extends base $data = $response->getBody(); - $filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-'); + $filename = tempnam($this->temp->get_dir(), unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) { diff --git a/phpBB/phpbb/filesystem/temp.php b/phpBB/phpbb/filesystem/temp.php index ffd9cc6973..649221d802 100644 --- a/phpBB/phpbb/filesystem/temp.php +++ b/phpBB/phpbb/filesystem/temp.php @@ -16,7 +16,7 @@ namespace phpbb\filesystem; class temp { /** - * @var string + * @var string Temporary directory path */ protected $temp_dir; @@ -47,7 +47,7 @@ class temp * * @return string returns the directory */ - public function get_temp_dir() + public function get_dir() { return $this->temp_dir; }