Joomla! 1.5 API

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2011 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JFolder

Description

A Folder handling class

  • since: 1.5

Located in /joomla/filesystem/folder.php (line 28)

Class JFolder   (Subpackage FileSystem)
Method Summary
Method mixed copy (string $src, string $dest, [string $path = ''], [boolean $force = false])
Method boolean create ([string $path = ''], [int $mode = 0755])
Method boolean delete (string $path)
Method boolean exists (string $path)
Method array files (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $fullpath = false], [array $exclude = array('.svn', 'CVS')])
Method array folders (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $fullpath = false], [array $exclude = array('.svn', 'CVS')])
Method array listFolderTree (string $path, string $filter, [integer $maxLevel = 3], [integer $level = 0], [integer $parent = 0])
Method string makeSafe (string $path)
Method mixed move (string $src, string $dest, [string $path = ''])
Methods
copy (line 40)

Copy a folder.

  • return: JError object on failure or boolean True on success.
  • since: 1.5
mixed copy (string $src, string $dest, [string $path = ''], [boolean $force = false])
  • string $src: The path to the source folder.
  • string $dest: The path to the destination folder.
  • string $path: An optional base path to prefix to the file names.
  • boolean $force: Optionally force folder/file overwrites.
create (line 139)

Create a folder -- and all necessary parent folders.

  • return: True if successful.
  • since: 1.5
boolean create ([string $path = ''], [int $mode = 0755])
  • string $path: A path to create from the base path.
  • int $mode: Directory permissions to set for folders created.
delete (line 253)

Delete a folder.

  • return: True on success.
  • since: 1.5
boolean delete (string $path)
  • string $path: The path to the folder to delete.
exists (line 390)

Wrapper for the standard file_exists function

  • return: True if path is a folder
  • since: 1.5
boolean exists (string $path)
  • string $path: Folder name relative to installation dir
files (line 408)

Utility function to read the files in a folder.

  • return: Files in the given folder.
  • since: 1.5
array files (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $fullpath = false], [array $exclude = array('.svn', 'CVS')])
  • string $path: The path of the folder to read.
  • string $filter: A filter for file names.
  • mixed $recurse: True to recursively search into sub-folders, or an integer to specify the maximum depth.
  • boolean $fullpath: True to return the full path to the file.
  • array $exclude: Array with names of files which should not be shown in the result.
folders (line 469)

Utility function to read the folders in a folder.

  • return: Folders in the given folder.
  • since: 1.5
array folders (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $fullpath = false], [array $exclude = array('.svn', 'CVS')])
  • string $path: The path of the folder to read.
  • string $filter: A filter for folder names.
  • mixed $recurse: True to recursively search into sub-folders, or an integer to specify the maximum depth.
  • boolean $fullpath: True to return the full path to the folders.
  • array $exclude: Array with names of folders which should not be shown in the result.
listFolderTree (line 530)

Lists folder in format suitable for tree display.

  • return: Folders in the given folder.
  • since: 1.5
  • access: public
array listFolderTree (string $path, string $filter, [integer $maxLevel = 3], integer $level, integer $parent)
  • string $path: The path of the folder to read.
  • string $filter: A filter for folder names.
  • integer $maxLevel: The maximum number of levels to recursively read, defaults to three.
  • integer $level: The current level, optional.
  • integer $parent: Unique identifier of the parent folder, if any.
makeSafe (line 564)

Makes path name safe to use.

  • return: The sanitised string.
  • since: 1.5
  • access: public
string makeSafe (string $path)
  • string $path: The full path to sanitise.
move (line 339)

Moves a folder.

  • return: Error message on false or boolean true on success.
  • since: 1.5
mixed move (string $src, string $dest, [string $path = ''])
  • string $src: The path to the source folder.
  • string $dest: The path to the destination folder.
  • string $path: An optional base path to prefix to the file names.
Support Joomla!