1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[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
This commit is contained in:
MateBartus
2015-03-12 00:25:00 +01:00
parent f86c5d905b
commit 4bdef6fd21
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');
}