Class JFile

Description

A File handling class

  • since: 11.1

Located in /libraries/joomla/filesystem/file.php (line 21)


	
			
Method Summary
 static boolean copy (string $src, string $dest, [string $path = null], [boolean $use_streams = false])
 static boolean delete (mixed $file)
 static boolean exists (string $file)
 static string getExt (string $file)
 static string getName (string $file)
 static string makeSafe (string $file)
 static boolean move (string $src, string $dest, [string $path = ''], [boolean $use_streams = false])
 static mixed read (string $filename, [boolean $incpath = false], [integer $amount = 0], [integer $chunksize = 8192], [integer $offset = 0])
 static string stripExt (string $file)
 static boolean upload (string $src, string $dest, [boolean $use_streams = false])
 static boolean write (string $file, string &$buffer, [boolean $use_streams = false])
Methods
static copy (line 84)

Copies a file

  • return: True on success
  • since: 11.1
  • access: public
static boolean copy (string $src, string $dest, [string $path = null], [boolean $use_streams = false])
  • 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
static delete (line 165)

Delete a file or array of files

  • return: True on success
  • since: 11.1
  • access: public
static boolean delete (mixed $file)
  • mixed $file: The file name or an array of file names
static exists (line 524)

Wrapper for the standard file_exists function

  • return: True if path is a file
  • since: 11.1
  • access: public
static boolean exists (string $file)
  • string $file: File path
static getExt (line 32)

Gets the extension of a file name

  • return: The file extension
  • since: 11.1
  • access: public
static string getExt (string $file)
  • string $file: The file name
static getName (line 539)

Returns the name, without any path.

  • return: filename
  • deprecated: 13.3 (Platform) & 4.0 (CMS) - Use basename() instead.
  • since: 11.1
  • access: public
static string getName (string $file)
  • string $file: File path
static makeSafe (line 62)

Makes file name safe to use

  • return: The sanitised string
  • since: 11.1
  • access: public
static string makeSafe (string $file)
  • string $file: The name of the file [not full path]
static move (line 234)

Moves a file

  • return: True on success
  • since: 11.1
  • access: public
static boolean move (string $src, string $dest, [string $path = ''], [boolean $use_streams = false])
  • 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
static read (line 311)

Read the contents of a file

  • return: Returns file contents or boolean False if failed
  • deprecated: 13.3 (Platform) & 4.0 (CMS) - Use the native file_get_contents() instead.
  • since: 11.1
  • access: public
static mixed read (string $filename, [boolean $incpath = false], [integer $amount = 0], [integer $chunksize = 8192], [integer $offset = 0])
  • 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
static stripExt (line 48)

Strips the last extension off of a file name

  • return: The file name without the extension
  • since: 11.1
  • access: public
static string stripExt (string $file)
  • string $file: The file name
static upload (line 440)

Moves an uploaded file to a destination folder

  • return: True on success
  • since: 11.1
  • access: public
static boolean upload (string $src, string $dest, [boolean $use_streams = false])
  • 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
static write (line 379)

Write contents to a file

  • return: True on success
  • since: 11.1
  • access: public
static boolean write (string $file, string &$buffer, [boolean $use_streams = false])
  • string $file: The full file path
  • string &$buffer: The buffer to write
  • boolean $use_streams: Use streams

Documentation generated on Tue, 19 Nov 2013 15:03:03 +0100 by phpDocumentor 1.4.3