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 method copy (line 81)

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 method delete (line 163)

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 method exists (line 521)

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 method 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 method getName (line 535)

Returns the name, without any path.

  • return: filename
  • since: 11.1
  • access: public
static string getName (string $file)
  • string $file: File path
static method 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 method 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 method read (line 313)

Read the contents of a file

  • return: Returns file contents or boolean False if failed
  • 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 method 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 method upload (line 436)

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 method write (line 375)

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 Mon, 25 Jun 2012 13:54:44 -0500 by phpDocumentor 1.4.4