class FileWrapper

Wrapper class for File

Methods

string
getExt( string $file)

Helper wrapper method for getExt

string
stripExt( string $file)

Helper wrapper method for stripExt

string
makeSafe( string $file)

Helper wrapper method for makeSafe

boolean
copy( string $src, string $dest, string $path = null, boolean $use_streams = false)

Helper wrapper method for copy

boolean
delete( mixed $file)

Helper wrapper method for delete

boolean
move( string $src, string $dest, string $path = '', boolean $use_streams = false)

Helper wrapper method for move

mixed
read( string $filename, boolean $incpath = false, integer $amount, integer $chunksize = 8192, integer $offset)

Helper wrapper method for read

boolean
write( string $file, string $buffer, boolean $use_streams = false)

Helper wrapper method for write

boolean
upload( string $src, string $dest, boolean $use_streams = false)

Helper wrapper method for upload

boolean
exists( string $file)

Helper wrapper method for exists

string
getName( string $file)

Helper wrapper method for getName

Details

string getExt( string $file)

Helper wrapper method for getExt

Parameters

string $file The file name.

Return Value

string The file extension.

See also

File::getExt()

string stripExt( string $file)

Helper wrapper method for stripExt

Parameters

string $file The file name.

Return Value

string The file name without the extension.

See also

File::stripExt()

string makeSafe( string $file)

Helper wrapper method for makeSafe

Parameters

string $file The name of the file [not full path].

Return Value

string The sanitised string.

See also

File::makeSafe()

boolean copy( string $src, string $dest, string $path = null, boolean $use_streams = false)

Helper wrapper method for copy

Parameters

string $src The path to the source file.
string $dest The path to the destination file.
string $path An optional base path to prefix to the file names.
boolean $use_streams True to use streams.

Return Value

boolean True on success.

See also

File::copy()

boolean delete( mixed $file)

Helper wrapper method for delete

Parameters

mixed $file The file name or an array of file names

Return Value

boolean True on success.

See also

File::delete()

boolean move( string $src, string $dest, string $path = '', boolean $use_streams = false)

Helper wrapper method for move

Parameters

string $src The path to the source file.
string $dest The path to the destination file.
string $path An optional base path to prefix to the file names.
boolean $use_streams True to use streams.

Return Value

boolean True on success.

See also

File::move()

mixed read( string $filename, boolean $incpath = false, integer $amount, integer $chunksize = 8192, integer $offset)

Helper wrapper method for read

Parameters

string $filename The full file path.
boolean $incpath Use include path.
integer $amount Amount of file to read.
integer $chunksize Size of chunks to read.
integer $offset Offset of the file.

Return Value

mixed Returns file contents or boolean False if failed.

See also

File::read()

boolean write( string $file, string $buffer, boolean $use_streams = false)

Helper wrapper method for write

Parameters

string $file The full file path.
string $buffer &$buffer The buffer to write.
boolean $use_streams Use streams.

Return Value

boolean True on success.

See also

File::write()

boolean upload( string $src, string $dest, boolean $use_streams = false)

Helper wrapper method for upload

Parameters

string $src The name of the php (temporary) uploaded file.
string $dest The path (including filename) to move the uploaded file to.
boolean $use_streams True to use streams.

Return Value

boolean True on success.

See also

File::upload()

boolean exists( string $file)

Helper wrapper method for exists

Parameters

string $file File path.

Return Value

boolean True if path is a file.

See also

File::exists()

string getName( string $file)

Helper wrapper method for getName

Parameters

string $file File path.

Return Value

string filename.

See also

File::getName()