Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

 Class JFile

Description

A File handling class

Located in /joomla/filesystem/file.php (line 29)

Class JFile   (Subpackage FileSystem)
Method Summary
Method boolean copy (string $src, string $dest, [string $path = null])
Method boolean delete (mixed $file)
Method boolean exists (string $file)
Method string getExt (string $file)
Method string getName ( $file)
Method string makeSafe (string $file)
Method boolean move (string $src, string $dest, [string $path = ''])
Method mixed read (string $filename, [boolean $incpath = false], [int $amount = 0], [int $chunksize = 8192], [int $offset = 0])
Method string stripExt (string $file)
Method boolean upload (string $src, string $dest)
Method boolean write (string $file, string $buffer)
Methods
copy (line 75)

Copies a file

  • return: True on success
  • since: 1.5
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 128)

Delete a file or array of files

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

Wrapper for the standard file_exists function

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

Gets the extension of a file name

  • return: The file extension
  • since: 1.5
string getExt (string $file)
  • string $file: The file name
getName (line 376)

Returns the name, sans any path

param string $file File path

  • return: filename
  • since: 1.5
string getName ( $file)
  • $file
makeSafe (line 61)

Makes file name safe to use

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

Moves a file

  • return: True on success
  • since: 1.5
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 235)

Read the contents of a file

  • return: Returns file contents or boolean False if failed
  • since: 1.5
mixed read (string $filename, [boolean $incpath = false], int $amount, [int $chunksize = 8192], int $offset)
  • string $filename: The full file path
  • boolean $incpath: Use include path
  • int $amount: Amount of file to read
  • int $chunksize: Size of chunks to read
  • int $offset: Offset of the file
stripExt (line 50)

Strips the last extension off a file name

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

Moves an uploaded file to a destination folder

  • return: True on success
  • since: 1.5
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 276)

Write contents to a file

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

Documentation generated on Tue, 29 Jan 2008 18:45:47 +0000 by phpDocumentor 1.3.1