Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe Folder

Fonctions membres publiques statiques

static copy ($src, $dest, $path='', $force=false, $useStreams=false)
 
static create ($path='', $mode=0755)
 
static delete ($path)
 
static move ($src, $dest, $path='', $useStreams=false)
 
static exists ($path)
 
static files ($path, $filter='.', $recurse=false, $full=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludeFilter=array('^\..*', '.*~'), $naturalSort=false)
 
static folders ($path, $filter='.', $recurse=false, $full=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludeFilter=array('^\..*'))
 
static listFolderTree ($path, $filter, $maxLevel=3, $level=0, $parent=0)
 
static makeSafe ($path)
 

Fonctions membres protégées statiques

static _items ($path, $filter, $recurse, $full, $exclude, $excludeFilterString, $findFiles)
 

Description détaillée

A Folder handling class

Depuis
1.7.0

Documentation des fonctions membres

◆ _items()

static _items (   $path,
  $filter,
  $recurse,
  $full,
  $exclude,
  $excludeFilterString,
  $findFiles 
)
staticprotected

Function to read the files/folders in a folder.

Paramètres
string$pathThe path of the folder to read.
string$filterA filter for file names.
mixed$recurseTrue to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean$fullTrue to return the full path to the file.
array$excludeArray with names of files which should not be shown in the result.
string$excludeFilterStringRegexp of files to exclude
boolean$findFilesTrue to read the files, false to read the folders
Renvoie
array Files.
Depuis
1.7.0

Références $file, $filter, et $path.

◆ copy()

static copy (   $src,
  $dest,
  $path = '',
  $force = false,
  $useStreams = false 
)
static

Copy a folder.

Paramètres
string$srcThe path to the source folder.
string$destThe path to the destination folder.
string$pathAn optional base path to prefix to the file names.
boolean$forceForce copy.
boolean$useStreamsOptionally force folder/file overwrites.
Renvoie
boolean True on success.
Depuis
1.7.0
Exceptions

Références $file, $path, PathWrapper\clean(), DIRECTORY_SEPARATOR, ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, null, et Path\removeRoot().

Référencé par FolderWrapper\copy().

◆ create()

static create (   $path = '',
  $mode = 0755 
)
static

Create a folder – and all necessary parent folders.

Paramètres
string$pathA path to create from the base path.
integer$modeDirectory permissions to set for folders created. 0755 by default.
Renvoie
boolean True if successful.
Depuis
1.7.0

Références $mode, $path, Text\_(), Log\add(), ClientHelper\getCredentials(), FtpClient\getInstance(), JPATH_ROOT, null, et Log\WARNING.

Référencé par FolderWrapper\create().

◆ delete()

static delete (   $path)
static

Delete a folder.

Paramètres
string$pathThe path to the folder to delete.
Renvoie
boolean True on success.
Depuis
1.7.0

Références $file, $files, $folder, $path, Text\_(), Log\add(), elseif, ClientHelper\getCredentials(), FtpClient\getInstance(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.

Référencé par FolderWrapper\delete().

◆ exists()

static exists (   $path)
static

Wrapper for the standard file_exists function

Paramètres
string$pathFolder name relative to installation dir
Renvoie
boolean True if path is a folder
Depuis
1.7.0

Références $path.

Référencé par FolderWrapper\exists().

◆ files()

static files (   $path,
  $filter = '.',
  $recurse = false,
  $full = false,
  $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
  $excludeFilter = array('^\..*', '.*~'),
  $naturalSort = false 
)
static

Utility function to read the files in a folder.

Paramètres
string$pathThe path of the folder to read.
string$filterA filter for file names.
mixed$recurseTrue to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean$fullTrue to return the full path to the file.
array$excludeArray with names of files which should not be shown in the result.
array$excludeFilterArray of filter to exclude
boolean$naturalSortFalse for asort, true for natsort
Renvoie
array Files in the given folder.
Depuis
1.7.0

Références $filter, $path, Log\add(), Text\sprintf(), et Log\WARNING.

Référencé par FolderWrapper\files().

◆ folders()

static folders (   $path,
  $filter = '.',
  $recurse = false,
  $full = false,
  $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
  $excludeFilter = array('^\..*') 
)
static

Utility function to read the folders in a folder.

Paramètres
string$pathThe path of the folder to read.
string$filterA filter for folder names.
mixed$recurseTrue to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean$fullTrue to return the full path to the folders.
array$excludeArray with names of folders which should not be shown in the result.
array$excludeFilterArray with regular expressions matching folders which should not be shown in the result.
Renvoie
array Folders in the given folder.
Depuis
1.7.0

Références $filter, $path, Log\add(), Text\sprintf(), et Log\WARNING.

Référencé par FolderWrapper\folders().

◆ listFolderTree()

static listFolderTree (   $path,
  $filter,
  $maxLevel = 3,
  $level = 0,
  $parent = 0 
)
static

Lists folder in format suitable for tree display.

Paramètres
string$pathThe path of the folder to read.
string$filterA filter for folder names.
integer$maxLevelThe maximum number of levels to recursively read, defaults to three.
integer$levelThe current level, optional.
integer$parentUnique identifier of the parent folder, if any.
Renvoie
array Folders in the given folder.
Depuis
1.7.0

Références $filter, $GLOBALS, $id, $name, $path, et JPATH_ROOT.

Référencé par FolderWrapper\listFolderTree().

◆ makeSafe()

static makeSafe (   $path)
static

Makes path name safe to use.

Paramètres
string$pathThe full path to sanitise.
Renvoie
string The sanitised string.
Depuis
1.7.0

Références $path.

Référencé par FolderWrapper\makeSafe().

◆ move()

static move (   $src,
  $dest,
  $path = '',
  $useStreams = false 
)
static

Moves a folder.

Paramètres
string$srcThe path to the source folder.
string$destThe path to the destination folder.
string$pathAn optional base path to prefix to the file names.
boolean$useStreamsOptionally use streams.
Renvoie
mixed Error message on false or boolean true on success.
Depuis
1.7.0

Références $path, Text\_(), PathWrapper\clean(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, et Text\sprintf().

Référencé par FolderWrapper\move().


La documentation de cette classe a été générée à partir du fichier suivant :