diff options
author | MateBartus <mate.bartus@gmail.com> | 2015-03-12 00:25:00 +0100 |
---|---|---|
committer | MateBartus <mate.bartus@gmail.com> | 2015-04-16 13:24:10 +0200 |
commit | 4bdef6fd21a5dcab455b0cd1ee2652de606929c3 (patch) | |
tree | 33eae92e90b43770b2c1e2e4508dbcf35d6bd7da /phpBB/includes/functions_convert.php | |
parent | f86c5d905bb82967505ef3e07fa429b59c112871 (diff) | |
download | forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.gz forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.bz2 forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.xz forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.zip |
[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
Diffstat (limited to 'phpBB/includes/functions_convert.php')
-rw-r--r-- | phpBB/includes/functions_convert.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index ea7816077d..ad693f4019 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -2316,7 +2316,10 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true) { - global $convert, $phpbb_root_path, $config, $user, $db; + global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem; + + /** @var \phpbb\filesystem\filesystem_interface $filesystem */ + $filesystem = $phpbb_filesystem; if (substr($trg, -1) == '/') { @@ -2349,7 +2352,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour } } - if (!phpbb_is_writable($path)) + if (!$filesystem->is_writable($path)) { @chmod($path, 0777); } @@ -2370,7 +2373,10 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true) { - global $convert, $phpbb_root_path, $config, $user, $db; + global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem; + + /** @var \phpbb\filesystem\filesystem_interface $filesystem */ + $filesystem = $phpbb_filesystem; $dirlist = $filelist = $bad_dirs = array(); $src = path($src, $source_relative_path); @@ -2384,7 +2390,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ @chmod($trg_path, 0777); } - if (!phpbb_is_writable($trg_path)) + if (!$filesystem->is_writable($trg_path)) { $bad_dirs[] = path($config['script_path']) . $trg; } @@ -2451,7 +2457,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ @chmod($trg_path . $dir, 0777); } - if (!phpbb_is_writable($trg_path . $dir)) + if (!$filesystem->is_writable($trg_path . $dir)) { $bad_dirs[] = $trg . $dir; $bad_dirs[] = $trg_path . $dir; |