diff --git a/libraries/src/Filesystem/File.php b/libraries/src/Filesystem/File.php index c9aa02ec07ca9..435ead9ba9c3a 100644 --- a/libraries/src/Filesystem/File.php +++ b/libraries/src/Filesystem/File.php @@ -24,6 +24,8 @@ * A File handling class * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File instead. */ class File { @@ -69,6 +71,8 @@ public static function getExt($file) * @return string The file name without the extension * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::stripExt() instead. */ public static function stripExt($file) { @@ -83,6 +87,8 @@ public static function stripExt($file) * @return string The sanitised string * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::makeSafe() instead. */ public static function makeSafe($file) { @@ -111,6 +117,9 @@ public static function makeSafe($file) * @return boolean True on success * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::copy() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function copy($src, $dest, $path = null, $useStreams = false) { @@ -187,6 +196,8 @@ public static function copy($src, $dest, $path = null, $useStreams = false) * FALSE from opcache_invalidate (like file not found). * * @since 4.0.1 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::invalidateFileCache() instead. */ public static function invalidateFileCache($filepath, $force = true) { @@ -210,6 +221,9 @@ public static function invalidateFileCache($filepath, $force = true) * @return boolean TRUE if we can proceed to use opcache_invalidate to flush a file from the OPCache * * @since 4.0.1 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::invalidateFileCache() instead. + * This method will be removed without replacement. */ public static function canFlushFileCache() { @@ -238,6 +252,9 @@ public static function canFlushFileCache() * @return boolean True on success * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::delete() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function delete($file) { @@ -311,6 +328,9 @@ public static function delete($file) * @return boolean True on success * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::move() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function move($src, $dest, $path = '', $useStreams = false) { @@ -382,6 +402,8 @@ public static function move($src, $dest, $path = '', $useStreams = false) * @return boolean True on success * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::write() instead. */ public static function write($file, $buffer, $useStreams = false) { @@ -440,6 +462,7 @@ public static function write($file, $buffer, $useStreams = false) * @return boolean True on success * * @since 3.6.0 + * */ public static function append($file, $buffer, $useStreams = false) { @@ -499,6 +522,9 @@ public static function append($file, $buffer, $useStreams = false) * @return boolean True on success * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\File::upload() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function upload($src, $dest, $useStreams = false, $allowUnsafe = false, $safeFileOptions = []) { @@ -588,6 +614,8 @@ public static function upload($src, $dest, $useStreams = false, $allowUnsafe = f * @return boolean True if path is a file * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use is_file() instead. */ public static function exists($file) { diff --git a/libraries/src/Filesystem/FilesystemHelper.php b/libraries/src/Filesystem/FilesystemHelper.php index 45a99be2ee064..a87e02b7adfa9 100644 --- a/libraries/src/Filesystem/FilesystemHelper.php +++ b/libraries/src/Filesystem/FilesystemHelper.php @@ -19,6 +19,8 @@ * Holds support functions for the filesystem, particularly the stream * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper instead. */ class FilesystemHelper { @@ -31,6 +33,8 @@ class FilesystemHelper * * @link https://www.php.net/manual/en/function.filesize.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::remotefsize() instead. */ public static function remotefsize($url) { @@ -114,6 +118,8 @@ public static function remotefsize($url) * * @link https://www.php.net/manual/en/function.ftp-chmod.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::ftpChmod() instead. */ public static function ftpChmod($url, $mode) { @@ -177,6 +183,8 @@ public static function ftpChmod($url, $mode) * @return array * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::getWriteModes() instead. */ public static function getWriteModes() { @@ -192,6 +200,8 @@ public static function getWriteModes() * @return array Streams * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::getSupported() instead. */ public static function getSupported() { @@ -211,6 +221,8 @@ public static function getSupported() * @return array * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::getTransports() instead. */ public static function getTransports() { @@ -224,6 +236,8 @@ public static function getTransports() * @return array * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::getFilters() instead. */ public static function getFilters() { @@ -238,6 +252,8 @@ public static function getFilters() * @return array * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::getJStreams() instead. */ public static function getJStreams() { @@ -268,6 +284,8 @@ public static function getJStreams() * @return boolean True for a Joomla Stream * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Helper::isJoomlaStream() instead. */ public static function isJoomlaStream($streamname) { diff --git a/libraries/src/Filesystem/Folder.php b/libraries/src/Filesystem/Folder.php index 828e95e9b97f6..cef115745c236 100644 --- a/libraries/src/Filesystem/Folder.php +++ b/libraries/src/Filesystem/Folder.php @@ -23,6 +23,8 @@ * A Folder handling class * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder instead. */ abstract class Folder { @@ -39,6 +41,8 @@ abstract class Folder * * @since 1.7.0 * @throws \RuntimeException + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::copy() instead. */ public static function copy($src, $dest, $path = '', $force = false, $useStreams = false) { @@ -159,6 +163,9 @@ public static function copy($src, $dest, $path = '', $force = false, $useStreams * @return boolean True if successful. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::create() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function create($path = '', $mode = 0755) { @@ -272,6 +279,9 @@ public static function create($path = '', $mode = 0755) * @return boolean True on success. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::delete() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function delete($path) { @@ -357,6 +367,9 @@ public static function delete($path) * @return mixed Error message on false or boolean true on success. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::move() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function move($src, $dest, $path = '', $useStreams = false) { @@ -418,6 +431,8 @@ public static function move($src, $dest, $path = '', $useStreams = false) * @return boolean True if path is a folder * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use is_dir() instead. */ public static function exists($path) { @@ -438,6 +453,9 @@ public static function exists($path) * @return array|boolean Files in the given folder. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::files() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function files( $path, @@ -491,6 +509,9 @@ public static function files( * @return array Folders in the given folder. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::folders() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function folders( $path, @@ -540,6 +561,8 @@ public static function folders( * @return array Files. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::_items() instead. */ protected static function _items($path, $filter, $recurse, $full, $exclude, $excludeFilterString, $findFiles) { @@ -603,6 +626,8 @@ protected static function _items($path, $filter, $recurse, $full, $exclude, $exc * @return array Folders in the given folder. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::listFolderTree() instead. */ public static function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0) { @@ -642,6 +667,8 @@ public static function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, * @return string The sanitised string. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Folder::makeSafe() instead. */ public static function makeSafe($path) { diff --git a/libraries/src/Filesystem/Patcher.php b/libraries/src/Filesystem/Patcher.php index 709d8a2929534..3d5f5505e9f77 100644 --- a/libraries/src/Filesystem/Patcher.php +++ b/libraries/src/Filesystem/Patcher.php @@ -20,6 +20,8 @@ * * @link http://sourceforge.net/projects/phppatcher/ This has been derived from the PhpPatcher version 0.1.1 written by Giuseppe Mazzotta * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher instead. */ class Patcher { @@ -79,6 +81,8 @@ class Patcher * The constructor is protected to force the use of FilesystemPatcher::getInstance() * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::__construct() instead. */ protected function __construct() { @@ -90,6 +94,8 @@ protected function __construct() * @return Patcher an instance of the patcher * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::getInstance() instead. */ public static function getInstance() { @@ -106,6 +112,8 @@ public static function getInstance() * @return Patcher This object for chaining * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::reset() instead. */ public function reset() { @@ -124,6 +132,8 @@ public function reset() * * @since 3.0.0 * @throws \RuntimeException + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::apply() instead. */ public function apply() { @@ -208,6 +218,8 @@ public function apply() * @return Patcher $this for chaining * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::addFile() instead. */ public function addFile($filename, $root = JPATH_BASE, $strip = 0) { @@ -224,6 +236,8 @@ public function addFile($filename, $root = JPATH_BASE, $strip = 0) * @return Patcher $this for chaining * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::add() instead. */ public function add($udiff, $root = JPATH_BASE, $strip = 0) { @@ -244,6 +258,8 @@ public function add($udiff, $root = JPATH_BASE, $strip = 0) * @return array The lines of the inputdestination file * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::splitLines() instead. */ protected static function splitLines($data) { @@ -263,6 +279,8 @@ protected static function splitLines($data) * * @since 3.0.0 * @throws \RuntimeException + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::findHeader() instead. */ protected static function findHeader(&$lines, &$src, &$dst) { @@ -320,6 +338,8 @@ protected static function findHeader(&$lines, &$src, &$dst) * * @since 3.0.0 * @throws \RuntimeException + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::findHunk() instead. */ protected static function findHunk(&$lines, &$srcLine, &$srcSize, &$dstLine, &$dstSize) { @@ -367,6 +387,8 @@ protected static function findHunk(&$lines, &$srcLine, &$srcSize, &$dstLine, &$d * * @since 3.0.0 * @throws \RuntimeException + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::applyHunk() instead. */ protected function applyHunk(&$lines, $src, $dst, $srcLine, $srcSize, $dstLine, $dstSize) { @@ -468,6 +490,8 @@ protected function applyHunk(&$lines, $src, $dst, $srcLine, $srcSize, $dstLine, * @return array The lines of the source file * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::getSource() instead. */ protected function &getSource($src) { @@ -491,6 +515,8 @@ protected function &getSource($src) * @return array The lines of the destination file * * @since 3.0.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Patcher::getDestination() instead. */ protected function &getDestination($dst, $src) { diff --git a/libraries/src/Filesystem/Path.php b/libraries/src/Filesystem/Path.php index 658011deab79e..faf981503763a 100644 --- a/libraries/src/Filesystem/Path.php +++ b/libraries/src/Filesystem/Path.php @@ -22,6 +22,8 @@ * A Path handling class * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path instead. */ class Path { @@ -33,6 +35,8 @@ class Path * @return boolean True if path can have mode changed. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::canChmod() instead. */ public static function canChmod($path) { @@ -59,6 +63,8 @@ public static function canChmod($path) * @return boolean True if successful [one fail means the whole operation failed]. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::setPermissions() instead. */ public static function setPermissions($path, $filemode = '0644', $foldermode = '0755') { @@ -110,6 +116,9 @@ public static function setPermissions($path, $filemode = '0644', $foldermode = ' * @return string Filesystem permissions. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::getPermissions() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public static function getPermissions($path) { @@ -145,6 +154,8 @@ public static function getPermissions($path) * * @throws \Exception * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::check() instead. */ public static function check($path) { @@ -183,6 +194,8 @@ public static function check($path) * * @throws \UnexpectedValueException * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::clean() instead. */ public static function clean($path, $ds = DIRECTORY_SEPARATOR) { @@ -229,6 +242,8 @@ public static function clean($path, $ds = DIRECTORY_SEPARATOR) * @return boolean True if the php script owns the path passed. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::isOwner() instead. */ public static function isOwner($path) { @@ -275,6 +290,8 @@ public static function isOwner($path) * @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::find() instead. */ public static function find($paths, $file) { @@ -322,6 +339,8 @@ public static function find($paths, $file) * @return string The resolved path * * @since 3.9.25 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::resolve() instead. */ public static function resolve($path) { @@ -364,6 +383,8 @@ public static function resolve($path) * @return string * * @since 3.10.7 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Path::removeRoot() instead. */ public static function removeRoot($message, $rootDirectory = null) { diff --git a/libraries/src/Filesystem/Stream.php b/libraries/src/Filesystem/Stream.php index ed2cbc4631fea..0b58c0c952c73 100644 --- a/libraries/src/Filesystem/Stream.php +++ b/libraries/src/Filesystem/Stream.php @@ -30,6 +30,8 @@ * @link https://www.php.net/manual/en/filters.php Stream Filters * @link https://www.php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy) * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream instead. */ class Stream extends CMSObject { @@ -146,6 +148,8 @@ class Stream extends CMSObject * @param array $context The context options (optional). * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::__construct() instead. */ public function __construct($writeprefix = '', $readprefix = '', $context = []) { @@ -159,6 +163,8 @@ public function __construct($writeprefix = '', $readprefix = '', $context = []) * Destructor * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::__destruct() instead. */ public function __destruct() { @@ -185,6 +191,9 @@ public function __destruct() * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::open() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function open( $filename, @@ -295,6 +304,9 @@ public function open( * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::close() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function close() { @@ -352,6 +364,9 @@ public function close() * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::eof() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function eof() { @@ -395,6 +410,9 @@ public function eof() * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::filesize() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function filesize() { @@ -455,6 +473,9 @@ public function filesize() * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::gets() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function gets($length = 0) { @@ -507,6 +528,9 @@ public function gets($length = 0) * * @link https://www.php.net/manual/en/function.fread.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::read() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function read($length = 0) { @@ -595,6 +619,9 @@ public function read($length = 0) * * @link https://www.php.net/manual/en/function.fseek.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::seek() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function seek($offset, $whence = SEEK_SET) { @@ -643,6 +670,9 @@ public function seek($offset, $whence = SEEK_SET) * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::tell() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function tell() { @@ -700,6 +730,9 @@ public function tell() * * @link https://www.php.net/manual/en/function.fwrite.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::write() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function write(&$string, $length = 0, $chunk = 0) { @@ -766,6 +799,9 @@ public function write(&$string, $length = 0, $chunk = 0) * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::chmod() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function chmod($filename = '', $mode = 0) { @@ -825,6 +861,9 @@ public function chmod($filename = '', $mode = 0) * * @link https://www.php.net/manual/en/function.stream-get-meta-data.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::get_meta_data() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function get_meta_data() { @@ -844,6 +883,8 @@ public function get_meta_data() * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::_buildContext() instead. */ public function _buildContext() { @@ -866,6 +907,8 @@ public function _buildContext() * * @link https://www.php.net/stream_context_create * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::setContextOptions() instead. */ public function setContextOptions($context) { @@ -885,6 +928,8 @@ public function setContextOptions($context) * @link https://www.php.net/stream_context_create Stream Context Creation * @link https://www.php.net/manual/en/context.php Context Options for various streams * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::addContextEntry() instead. */ public function addContextEntry($wrapper, $name, $value) { @@ -902,6 +947,8 @@ public function addContextEntry($wrapper, $name, $value) * * @link https://www.php.net/stream_context_create * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::deleteContextEntry() instead. */ public function deleteContextEntry($wrapper, $name) { @@ -932,6 +979,9 @@ public function deleteContextEntry($wrapper, $name) * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::applyContextToStream() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function applyContextToStream() { @@ -967,6 +1017,9 @@ public function applyContextToStream() * * @link https://www.php.net/manual/en/function.stream-filter-append.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::appendFilter() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function appendFilter($filterName, $readWrite = STREAM_FILTER_READ, $params = []) { @@ -1004,6 +1057,9 @@ public function appendFilter($filterName, $readWrite = STREAM_FILTER_READ, $para * * @link https://www.php.net/manual/en/function.stream-filter-prepend.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::prependFilter() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function prependFilter($filterName, $readWrite = STREAM_FILTER_READ, $params = []) { @@ -1041,6 +1097,9 @@ public function prependFilter($filterName, $readWrite = STREAM_FILTER_READ, $par * @return boolean Result of operation * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::removeFilter() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function removeFilter(&$resource, $byindex = false) { @@ -1077,6 +1136,9 @@ public function removeFilter(&$resource, $byindex = false) * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::copy() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function copy($src, $dest, $context = null, $usePrefix = true, $relative = false) { @@ -1127,6 +1189,9 @@ public function copy($src, $dest, $context = null, $usePrefix = true, $relative * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::move() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function move($src, $dest, $context = null, $usePrefix = true, $relative = false) { @@ -1172,6 +1237,9 @@ public function move($src, $dest, $context = null, $usePrefix = true, $relative * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::delete() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function delete($filename, $context = null, $usePrefix = true, $relative = false) { @@ -1215,6 +1283,9 @@ public function delete($filename, $context = null, $usePrefix = true, $relative * @return mixed * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::upload() instead. + * The framework class throws Exceptions in case of error which you have to catch. */ public function upload($src, $dest, $context = null, $usePrefix = true, $relative = false) { @@ -1237,6 +1308,8 @@ public function upload($src, $dest, $context = null, $usePrefix = true, $relativ * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::writeFile() instead. */ public function writeFile($filename, &$buffer) { @@ -1262,6 +1335,8 @@ public function writeFile($filename, &$buffer) * @return string * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::_getFilename() instead. */ public function _getFilename($filename, $mode, $usePrefix, $relative) { @@ -1295,6 +1370,8 @@ public function _getFilename($filename, $mode, $usePrefix, $relative) * @return resource File handler * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream::getFileHandle() instead. */ public function getFileHandle() { diff --git a/libraries/src/Filesystem/Streams/StreamString.php b/libraries/src/Filesystem/Streams/StreamString.php index 1f0bf2e34237d..fa718e331ec49 100644 --- a/libraries/src/Filesystem/Streams/StreamString.php +++ b/libraries/src/Filesystem/Streams/StreamString.php @@ -20,6 +20,8 @@ * you would normally use a regular stream wrapper * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper instead. */ class StreamString { @@ -100,6 +102,8 @@ class StreamString * @return boolean * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_open() instead. */ public function stream_open($path, $mode, $options, &$openedPath) { @@ -123,6 +127,8 @@ public function stream_open($path, $mode, $options, &$openedPath) * * @link https://www.php.net/manual/en/streamwrapper.stream-stat.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_stat instead. */ public function stream_stat() { @@ -139,6 +145,8 @@ public function stream_stat() * * @link https://www.php.net/manual/en/streamwrapper.url-stat.php * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::url_stat() instead. */ public function url_stat($path, $flags = 0) { @@ -172,10 +180,11 @@ public function url_stat($path, $flags = 0) * * @return string * - * @since 1.7.0 - * * @link https://www.php.net/manual/en/streamwrapper.stream-read.php - */ + * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_read() instead. + */ public function stream_read($count) { $result = substr($this->currentString, $this->pos, $count); @@ -193,6 +202,8 @@ public function stream_read($count) * * @since 1.7.0 * @note Updating the string is not supported. + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_write() instead. */ public function stream_write($data) { @@ -206,6 +217,8 @@ public function stream_write($data) * @return integer The position * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_tell() instead. */ public function stream_tell() { @@ -218,6 +231,8 @@ public function stream_tell() * @return boolean True if at end of field. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_eof() instead. */ public function stream_eof() { @@ -237,6 +252,8 @@ public function stream_eof() * @return boolean True on success. * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_seek() instead. */ public function stream_seek($offset, $whence) { @@ -274,6 +291,8 @@ public function stream_seek($offset, $whence) * * @since 1.7.0 * @note Data storage is not supported + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Stream\StringWrapper::stream_flush() instead. */ public function stream_flush() { diff --git a/libraries/src/Filesystem/Support/StringController.php b/libraries/src/Filesystem/Support/StringController.php index 46f85bdd33ff7..f718eae838391 100644 --- a/libraries/src/Filesystem/Support/StringController.php +++ b/libraries/src/Filesystem/Support/StringController.php @@ -17,6 +17,8 @@ * String Controller * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Support\StringController instead. */ class StringController { @@ -26,6 +28,8 @@ class StringController * @return array * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Support\StringController::getArray() instead. */ public function _getArray() { @@ -43,6 +47,8 @@ public function _getArray() * @return void * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Support\StringController::createRef() instead. */ public function createRef($reference, &$string) { @@ -58,6 +64,8 @@ public function createRef($reference, &$string) * @return mixed False if not set, reference if it exists * * @since 1.7.0 + * @deprecated 4.4 will be removed in 6.0 + * Use Joomla\Filesystem\Support\StringController::getRef() instead. */ public function getRef($reference) {