Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de l'interface AdapterInterface
+ Graphe d'héritage de AdapterInterface:

Fonctions membres publiques

 getFile (string $path='/')
 
 getFiles (string $path='/')
 
 getResource (string $path)
 
 createFolder (string $name, string $path)
 
 createFile (string $name, string $path, $data)
 
 updateFile (string $name, string $path, $data)
 
 delete (string $path)
 
 move (string $sourcePath, string $destinationPath, bool $force=false)
 
 copy (string $sourcePath, string $destinationPath, bool $force=false)
 
 getUrl (string $path)
 
 getAdapterName ()
 
 search (string $path, string $needle, bool $recursive=false)
 

Description détaillée

Media file adapter interface.

Depuis
4.0.0

Documentation des fonctions membres

◆ copy()

copy ( string  $sourcePath,
string  $destinationPath,
bool  $force = false 
)

Copies a file or folder from source to destination.

It returns the new destination path. This allows the implementation classes to normalise the file name.

Paramètres
string$sourcePathThe source path
string$destinationPathThe destination path
bool$forceForce to overwrite
Renvoie
string
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ createFile()

createFile ( string  $name,
string  $path,
  $data 
)

Creates a file with the given name in the given path with the data.

It returns the new file name. This allows the implementation classes to normalise the file name.

Paramètres
string$nameThe name
string$pathThe folder
string$dataThe data
Renvoie
string
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ createFolder()

createFolder ( string  $name,
string  $path 
)

Creates a folder with the given name in the given path.

It returns the new folder name. This allows the implementation classes to normalise the file name.

Paramètres
string$nameThe name
string$pathThe folder
Renvoie
string
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ delete()

delete ( string  $path)

Deletes the folder or file of the given path.

Paramètres
string$pathThe path to the file or folder
Renvoie
void
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ getAdapterName()

getAdapterName ( )

Returns the name of the adapter. It will be shown in the Media Manager

Renvoie
string
Depuis
4.0.0

Implémenté dans LocalAdapter.

◆ getFile()

getFile ( string  $path = '/')

Returns the requested file or folder. The returned object has the following properties available:

  • type: The type can be file or dir
  • name: The name of the file
  • path: The relative path to the root
  • extension: The file extension
  • size: The size of the file
  • create_date: The date created
  • modified_date: The date modified
  • mime_type: The mime type
  • width: The width, when available
  • height: The height, when available

If the path doesn't exist a FileNotFoundException is thrown.

Paramètres
string$pathThe path to the file or folder
Renvoie
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ getFiles()

getFiles ( string  $path = '/')

Returns the folders and files for the given path. The returned objects have the following properties available:

  • type: The type can be file or dir
  • name: The name of the file
  • path: The relative path to the root
  • extension: The file extension
  • size: The size of the file
  • create_date: The date created
  • modified_date: The date modified
  • mime_type: The mime type
  • width: The width, when available
  • height: The height, when available

If the path doesn't exist a FileNotFoundException is thrown.

Paramètres
string$pathThe folder
Renvoie
[]
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ getResource()

getResource ( string  $path)

Returns a resource for the given path.

Paramètres
string$pathThe path
Renvoie
resource
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ getUrl()

getUrl ( string  $path)

Returns a public url for the given path. This function can be used by the cloud adapter to publish the media file and create a permanent publicly accessible url.

Paramètres
string$pathThe path to file
Renvoie
string
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ move()

move ( string  $sourcePath,
string  $destinationPath,
bool  $force = false 
)

Moves a file or folder from source to destination.

It returns the new destination path. This allows the implementation classes to normalise the file name.

Paramètres
string$sourcePathThe source path
string$destinationPathThe destination path
bool$forceForce to overwrite
Renvoie
string
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.

◆ search()

search ( string  $path,
string  $needle,
bool  $recursive = false 
)

Search for a pattern in a given path

Paramètres
string$pathThe base path for the search
string$needleThe path to file
bool$recursiveDo a recursive search
Renvoie
[]
Depuis
4.0.0

Implémenté dans LocalAdapter.

◆ updateFile()

updateFile ( string  $name,
string  $path,
  $data 
)

Updates the file with the given name in the given path with the data.

Paramètres
string$nameThe name
string$pathThe folder
string$dataThe data
Renvoie
void
Depuis
4.0.0
Exceptions

Implémenté dans LocalAdapter.


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