- md5
- 79e99dd86daa04006aa991faeb1d26ec
- sha1
- 6f1de6b8276b8b0e85b61784be4872a071a635f2
- sha256
- a973b6010130eea48870a8fa632c6ca11f050f8d3849735d5db898792e383e8d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Wrapper;
use Joomla\Filesystem\File;
defined('JPATH_PLATFORM') or die;
/**
* Wrapper class for File
*
* @package Joomla.Platform
* @subpackage Filesystem
* @since 3.4
*/
class FileWrapper
{
/**
* Helper wrapper method for getExt
*
* @param string $file The file name.
*
* @return string The file extension.
*
* @see File::getExt()
* @since 3.4
*/
public function getExt($file)
{
return File::getExt($file);
}
/**
* Helper wrapper method for stripExt
*
* @param string $file The file name.
*
* @return string The file name without the extension.
*
* @see File::stripExt()
* @since 3.4
*/
public function stripExt($file)
{
return File::stripExt($file);
}
/**
* Helper wrapper method for makeSafe
*
* @param string $file The name of the file [not full path].
*
* @return string The sanitised string.
*
* @see File::makeSafe()
* @since 3.4
*/
public function makeSafe($file)
{
return File::makeSafe($file);
}
/**
* Helper wrapper method for copy
*
* @param string $src The path to the source file.
* @param string $dest The path to the destination file.
* @param string $path An optional base path to prefix to the file names.
* @param boolean $use_streams True to use streams.
*
* @return boolean True on success.
*
* @see File::copy()
* @since 3.4
*/
public function copy($src, $dest, $path = null, $use_streams = false)
{
return File::copy($src, $dest, $path, $use_streams);
}
/**
* Helper wrapper method for delete
*
* @param mixed $file The file name or an array of file names
*
* @return boolean True on success.
*
* @see File::delete()
* @since 3.4
*/
public function delete($file)
{
return File::delete($file);
}
/**
* Helper wrapper method for move
*
* @param string $src The path to the source file.
* @param string $dest The path to the destination file.
* @param string $path An optional base path to prefix to the file names.
* @param boolean $use_streams True to use streams.
*
* @return boolean True on success.
*
* @see File::move()
* @since 3.4
*/
public function move($src, $dest, $path = '', $use_streams = false)
{
return File::move($src, $dest, $path, $use_streams);
}
/**
* Helper wrapper method for read
*
* @param string $filename The full file path.
* @param boolean $incpath Use include path.
* @param integer $amount Amount of file to read.
* @param integer $chunksize Size of chunks to read.
* @param integer $offset Offset of the file.
*
* @return mixed Returns file contents or boolean False if failed.
*
* @see File::read()
* @since 3.4
*/
public function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
{
return File::read($filename, $incpath, $amount, $chunksize, $offset);
}
/**
* Helper wrapper method for write
*
* @param string $file The full file path.
* @param string &$buffer The buffer to write.
* @param boolean $use_streams Use streams.
*
* @return boolean True on success.
*
* @see File::write()
* @since 3.4
*/
public function write($file, &$buffer, $use_streams = false)
{
return File::write($file, $buffer, $use_streams);
}
/**
* Helper wrapper method for upload
*
* @param string $src The name of the php (temporary) uploaded file.
* @param string $dest The path (including filename) to move the uploaded file to.
* @param boolean $use_streams True to use streams.
*
* @return boolean True on success.
*
* @see File::upload()
* @since 3.4
*/
public function upload($src, $dest, $use_streams = false)
{
return File::upload($src, $dest, $use_streams);
}
/**
* Helper wrapper method for exists
*
* @param string $file File path.
*
* @return boolean True if path is a file.
*
* @see File::exists()
* @since 3.4
*/
public function exists($file)
{
return File::exists($file);
}
/**
* Helper wrapper method for getName
*
* @param string $file File path.
*
* @return string filename.
*
* @see File::getName()
* @since 3.4
*/
public function getName($file)
{
return File::getName($file);
}
}
The same content is in 6 releases, Joomla 3.9.0-alpha to 3.9.0-rc. See them all, or every version of this file.