filesystem deprecated
class filesystem extends filesystem
deprecated
Properties
protected array | $chmod_info | Store some information about file ownership for phpBB's chmod function |
from filesystem |
protected string|bool|null | $working_directory | Stores current working directory |
from filesystem |
protected Filesystem | $symfony_filesystem | Symfony's Filesystem component |
from filesystem |
Methods
Change owner group of files/directories
Global function for chmodding directories and files for internal use
Change owner group of files/directories
Eliminates useless . and .. components from specified path.
Copies a file.
Checks if files/directories are readable
Test if a file/directory is writable
Given an existing path, convert it to a path relative to a given starting path
Mirrors a directory to another.
Global function for chmodding directories and files for internal use
Renames a file or a directory.
Creates a symbolic link or copy a directory.
Sets access and modification time of file.
Try to resolve real path when PHP's realpath fails to do so
Try to resolve symlinks in path
Details
in
filesystem at line 48
__construct()
Constructor
in
filesystem at line 58
chgrp(string|array|Traversable $files, string $group, bool $recursive = false)
Change owner group of files/directories
in
filesystem at line 78
chmod(string|array|Traversable $files, int $perms = null, bool $recursive = false, bool $force_chmod_link = false)
Global function for chmodding directories and files for internal use
The function accepts filesysteminterface::CHMOD flags in the permission argument or the user can specify octal values (or any integer if it makes sense). All directories will have an execution bit appended, if the user group (owner, group or other) has any bit specified.
in
filesystem at line 144
chown(string|array|Traversable $files, string $user, bool $recursive = false)
Change owner group of files/directories
in
filesystem at line 164
string
clean_path(string $path)
Eliminates useless . and .. components from specified path.
in
filesystem at line 172
copy(string $origin_file, string $target_file, bool $override = false)
Copies a file.
This method only copies the file if the origin file is newer than the target file.
By default, if the target already exists, it is not overridden.
in
filesystem at line 187
dump_file(string $filename, string $content)
Atomically dumps content into a file.
in
filesystem at line 202
bool
exists(string|array|Traversable $files)
Checks the existence of files or directories.
in
filesystem at line 210
bool
is_absolute_path(string $path)
Checks if a path is absolute or not
in
filesystem at line 218
bool
is_readable(string|array|Traversable $files, bool $recursive = false)
Checks if files/directories are readable
in
filesystem at line 242
bool
is_writable(string|array|Traversable $files, bool $recursive = false)
Test if a file/directory is writable
in
filesystem at line 288
string
make_path_relative(string $end_path, string $start_path)
Given an existing path, convert it to a path relative to a given starting path
in
filesystem at line 296
mirror(string $origin_dir, string $target_dir, Traversable $iterator = null, array $options = array())
Mirrors a directory to another.
in
filesystem at line 314
mkdir(string|array|Traversable $dirs, int $mode = 0777)
Creates a directory recursively.
in
filesystem at line 332
phpbb_chmod(string|array|Traversable $file, int $perms = null, bool $recursive = false, bool $force_chmod_link = false)
Global function for chmodding directories and files for internal use
This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. The function determines owner and group from common.php file and sets the same to the provided file. The function uses bit fields to build the permissions. The function sets the appropriate execute bit on directories.
Supported constants representing bit fields are:
filesystem_interface::CHMOD_ALL - all permissions (7) filesystem_interface::CHMOD_READ - read permission (4) filesystem_interface::CHMOD_WRITE - write permission (2) filesystem_interface::CHMOD_EXECUTE - execute permission (1)
NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
in
filesystem at line 469
string|false
realpath(?string $path)
A wrapper for PHP's realpath
in
filesystem at line 477
remove(string|array|Traversable $files)
Removes files or directories.
in
filesystem at line 497
rename(string $origin, string $target, bool $overwrite = false)
Renames a file or a directory.
in
filesystem at line 515
symlink(string $origin_dir, string $target_dir, bool $copy_on_windows = false)
Creates a symbolic link or copy a directory.
in
filesystem at line 530
touch(string|array|Traversable $files, int $time = null, int $access_time = null)
Sets access and modification time of file.
in
filesystem at line 556
protected bool
phpbb_is_writable(string $file)
phpBB's implementation of is_writable
in
filesystem at line 606
protected bool|string
phpbb_own_realpath(?string $path)
deprecated
deprecated
Try to resolve real path when PHP's realpath fails to do so
in
filesystem at line 715
protected Traversable
to_iterator(string|array|Traversable $files)
Convert file(s) to \Traversable object
This is the same function as Symfony's toIterator, but that is private so we cannot use it.
in
filesystem at line 738
protected string|array|bool
resolve_path(string $path, string $prefix = '', bool $absolute = false, bool $return_array = false)
deprecated
deprecated
Try to resolve symlinks in path