1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 00:07:44 +02:00

Merge pull request #3487 from MateBartus/ticket/13697

[ticket/13697] Moving filesystem related functions to filesystem service
This commit is contained in:
Tristan Darricau
2015-04-16 20:44:02 +02:00
82 changed files with 1859 additions and 657 deletions

View File

@@ -37,17 +37,24 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
*/
protected $file_handle = false;
/**
* @var \phpbb\filesystem\filesystem_interface
*/
protected $filesystem;
/**
* Constructor
*
* @param user $user User object
* @param migrator_output_handler_interface $migrator Migrator output handler
* @param string $log_file File to log to
* @param \phpbb\filesystem\filesystem_interface phpBB filesystem object
*/
public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file)
public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file, \phpbb\filesystem\filesystem_interface $filesystem)
{
$this->user = $user;
$this->migrator = $migrator;
$this->filesystem = $filesystem;
$this->file_open($log_file);
}
@@ -58,7 +65,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
*/
protected function file_open($file)
{
if (phpbb_is_writable(dirname($file)))
if ($this->filesystem->is_writable(dirname($file)))
{
$this->file_handle = fopen($file, 'w');
}