Class JFile

Description

A File handling class

  • since: 1.1
  • static:

Located in /filesystem/file.php (line 27)


	
			
Method Summary
 boolean copy (string $src, string $dest, [string $path = null])
 boolean delete (mixed $file)
 boolean exists (string $file)
 string getExt (string $file)
 string makeSafe (string $file)
 boolean move (string $src, string $dest, [string $path = ''])
 mixed read (string $filename, [boolean $incpath = false])
 string stripExt (string $file)
 boolean upload (string $src, string $dest)
 boolean write (string $file, string $buffer)
Methods
copy (line 73)

Copies a file

  • return: True on success
  • since: 1.1
boolean copy (string $src, string $dest, [string $path = null])
  • 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
delete (line 153)

Delete a file or array of files

  • return: True on success
  • since: 1.1
boolean delete (mixed $file)
  • mixed $file: The file name or an array of file names
exists (line 514)

Wrapper for the standard file_exists function

  • return: True if path is a file
  • since: 1.1
boolean exists (string $file)
  • string $file: File path
getExt (line 36)

Gets the extension of a file name

  • return: The file extension
  • since: 1.1
string getExt (string $file)
  • string $file: The file name
makeSafe (line 59)

Makes file name safe to use

  • return: The sanitised string
  • since: 1.1
string makeSafe (string $file)
  • string $file: The name of the file [not full path]
move (line 214)

Moves a file

  • return: True on success
  • since: 1.1
boolean move (string $src, string $dest, [string $path = ''])
  • 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
read (line 286)

Read the contents of a file

  • return: Returns file contents or boolean False if failed
  • since: 1.1
mixed read (string $filename, [boolean $incpath = false])
  • string $filename: The full file path
  • boolean $incpath: Use include path
stripExt (line 48)

Strips the last extension off a file name

  • return: The file name without the extension
  • since: 1.1
string stripExt (string $file)
  • string $file: The file name
upload (line 427)

Moves and uploaded file to a destination folder

  • return: True on success
  • since: 1.1
boolean upload (string $src, string $dest)
  • string $src: The name of the php (temporary) uploaded file
  • string $dest: The path (including filename) to move the uploaded file to
write (line 363)

Write contents to a file

  • return: True on success
  • since: 1.1
boolean write (string $file, string $buffer)
  • string $file: The full file path
  • string $buffer: The buffer to write

Documentation generated on Sat, 4 Feb 2006 14:23:27 +0100 by phpDocumentor 1.3.0RC4