Abstract Class JFolder

Description

A Folder handling class

  • abstract:
  • since: 11.1

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


	
			
Method Summary
 static boolean copy (string $src, string $dest, [string $path = ''], [boolean $force = false], [boolean $use_streams = false])
 static boolean create ([string $path = ''], [integer $mode = 0755])
 static boolean delete (string $path)
 static boolean exists (string $path)
 static array files (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $full = false], [array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX')], [array $excludefilter = array('^\..*', '.*~')], [boolean $naturalSort = false])
 static array folders (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $full = false], [array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX')], [array $excludefilter = array('^\..*')])
 static array listFolderTree (string $path, string $filter, [integer $maxLevel = 3], [integer $level = 0], [integer $parent = 0])
 static string makeSafe (string $path)
 static mixed move (string $src, string $dest, [string $path = ''], [boolean $use_streams = false])
 static array _items (string $path, string $filter, mixed $recurse, boolean $full, array $exclude, string $excludefilter_string, boolean $findfiles)
Methods
static copy (line 37)

Copy a folder.

  • return: True on success.
  • throws: RuntimeException
  • since: 11.1
  • access: public
static boolean copy (string $src, string $dest, [string $path = ''], [boolean $force = false], [boolean $use_streams = 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: Force copy.
  • boolean $use_streams: Optionally force folder/file overwrites.
static create (line 170)

Create a folder -- and all necessary parent folders.

  • return: True if successful.
  • since: 11.1
  • access: public
static boolean create ([string $path = ''], [integer $mode = 0755])
  • string $path: A path to create from the base path.
  • integer $mode: Directory permissions to set for folders created. 0755 by default.
static delete (line 295)

Delete a folder.

  • return: True on success.
  • throws: UnexpectedValueException
  • since: 11.1
  • access: public
static boolean delete (string $path)
  • string $path: The path to the folder to delete.
static exists (line 479)

Wrapper for the standard file_exists function

  • return: True if path is a folder
  • since: 11.1
  • access: public
static boolean exists (string $path)
  • string $path: Folder name relative to installation dir
static files (line 499)

Utility function to read the files in a folder.

  • return: Files in the given folder.
  • since: 11.1
  • access: public
static array files (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $full = false], [array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX')], [array $excludefilter = array('^\..*', '.*~')], [boolean $naturalSort = false])
  • 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 $full: True to return the full path to the file.
  • array $exclude: Array with names of files which should not be shown in the result.
  • array $excludefilter: Array of filter to exclude
  • boolean $naturalSort: False for asort, true for natsort
static folders (line 553)

Utility function to read the folders in a folder.

  • return: Folders in the given folder.
  • since: 11.1
  • access: public
static array folders (string $path, [string $filter = '.'], [mixed $recurse = false], [boolean $full = false], [array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX')], [array $excludefilter = array('^\..*')])
  • 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 $full: True to return the full path to the folders.
  • array $exclude: Array with names of folders which should not be shown in the result.
  • array $excludefilter: Array with regular expressions matching folders which should not be shown in the result.
static listFolderTree (line 673)

Lists folder in format suitable for tree display.

  • return: Folders in the given folder.
  • since: 11.1
  • access: public
static array listFolderTree (string $path, string $filter, [integer $maxLevel = 3], [integer $level = 0], [integer $parent = 0])
  • 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.
static makeSafe (line 710)

Makes path name safe to use.

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

Moves a folder.

  • return: Error message on false or boolean true on success.
  • since: 11.1
  • access: public
static mixed move (string $src, string $dest, [string $path = ''], [boolean $use_streams = 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 $use_streams: Optionally use streams.
static _items (line 601)

Function to read the files/folders in a folder.

  • return: Files.
  • since: 11.1
  • access: protected
static array _items (string $path, string $filter, mixed $recurse, boolean $full, array $exclude, string $excludefilter_string, boolean $findfiles)
  • 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 $full: True to return the full path to the file.
  • array $exclude: Array with names of files which should not be shown in the result.
  • string $excludefilter_string: Regexp of files to exclude
  • boolean $findfiles: True to read the files, false to read the folders

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