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

Fonctions membres publiques

 setAdapter ($className)
 
 getAdapterName ()
 
 setAdapterOptions (array $options)
 
 getAdapterOptions ()
 
 getFromURL ($url)
 
 importFromURL ($params)
 

Fonctions membres protégées statiques

static getFiles ($path, array $ignoreFolders=array(), array $ignoreFiles=array())
 
static scanDirectory ($path, array $ignoreFolders=array(), array $ignoreFiles=array())
 

Fonctions membres privées

 getParam ($key, $default=null)
 

Attributs privés

 $params = array()
 
 $adapter = null
 
 $adapterOptions = array()
 

Documentation des fonctions membres

◆ getAdapterName()

getAdapterName ( )

Returns the name of the current adapter

Renvoie
string

Références $class.

◆ getAdapterOptions()

getAdapterOptions ( )

Returns the additional options for the adapter

Renvoie
array

◆ getFiles()

static getFiles (   $path,
array  $ignoreFolders = array(),
array  $ignoreFiles = array() 
)
staticprotected

This method will crawl a starting directory and get all the valid files that will be analyzed by __construct. Then it organizes them into an associative array.

Paramètres
string$pathFolder where we should start looking
array$ignoreFoldersFolder ignore list
array$ignoreFilesFile ignore list
Renvoie
array Associative array, where the fullpath key contains the path to the file, and the classname key contains the name of the class

Références $file, $files, $parts, $path, et $return.

◆ getFromURL()

getFromURL (   $url)

Download data from a URL and return it

Paramètres
string$urlThe URL to download from
Renvoie
bool|string The downloaded data or false on failure

Références $url, et null.

◆ getParam()

getParam (   $key,
  $default = null 
)
private

Used to decode the $params array

Paramètres
string$keyThe parameter key you want to retrieve the value for
mixed$defaultThe default value, if none is specified
Renvoie
mixed The value for this parameter key

Références $default, et $key.

◆ importFromURL()

importFromURL (   $params)

Performs the staggered download of file. The downloaded file will be stored in Joomla!'s temp-path using the basename of the URL as a filename

The $params array can have any of the following keys url The file being downloaded frag Rolling counter of the file fragment being downloaded totalSize The total size of the file being downloaded, in bytes doneSize How many bytes we have already downloaded maxExecTime Maximum execution time downloading file fragments, in seconds length How many bytes to download at once

The array returned is in the following format:

status True if there are no errors, false if there are errors error A string with the error message if there are errors frag The next file fragment to download totalSize The total size of the downloaded file in bytes, if the server supports HEAD requests doneSize How many bytes have already been downloaded percent % of the file already downloaded (if totalSize could be determined) localfile The name of the local file, without the path

Paramètres
array$paramsA parameters array, as sent by the user interface
Renvoie
array A return status array

Références $filesize, $params, $start, $url, elseif, et JPATH_ROOT.

◆ scanDirectory()

static scanDirectory (   $path,
array  $ignoreFolders = array(),
array  $ignoreFiles = array() 
)
staticprotected

Recursive function that will scan every directory unless it's in the ignore list. Files that aren't in the ignore list are returned.

Paramètres
string$pathFolder where we should start looking
array$ignoreFoldersFolder ignore list
array$ignoreFilesFile ignore list
Renvoie
array List of all the files

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

◆ setAdapter()

setAdapter (   $className)

Forces the use of a specific adapter

Paramètres
string$classNameThe name of the class or the name of the adapter, e.g. 'FOFDownloadAdapterCurl' or 'curl'

Références $className, elseif, et null.

◆ setAdapterOptions()

setAdapterOptions ( array  $options)

Sets the additional options for the adapter

Paramètres
array$options

Références $options.

Documentation des champs

◆ $adapter

$adapter = null
private

◆ $adapterOptions

$adapterOptions = array()
private

◆ $params

$params = array()
private

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