[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/filesystem/local/src/Adapter/ -> LocalAdapter.php (summary)

(no description)

Copyright: (C) 2016 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 817 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

LocalAdapter:: (25 methods):
  __construct()
  getFile()
  getFiles()
  getResource()
  createFolder()
  createFile()
  updateFile()
  delete()
  getPathInformation()
  getDate()
  copy()
  copyFile()
  copyFolder()
  move()
  moveFile()
  moveFolder()
  getUrl()
  getAdapterName()
  search()
  rglob()
  getEncodedPath()
  getSafeName()
  checkContent()
  getFileName()
  getLocalPath()


Class: LocalAdapter  - X-Ref

Local file adapter.

__construct(string $rootPath, string $filePath)   X-Ref
The absolute root path in the local file system.

param: string  $rootPath  The root path
param: string  $filePath  The file path of media folder

getFile(string $path = '/')   X-Ref
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: string  $path  The path to the file or folder
return: \stdClass

getFiles(string $path = '/')   X-Ref
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: string  $path  The folder
return: \stdClass[]

getResource(string $path)   X-Ref
Returns a resource to download the path.

param: string  $path  The path to download
return: resource

createFolder(string $name, string $path)   X-Ref
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: string  $name  The name
param: string  $path  The folder
return: string

createFile(string $name, string $path, $data)   X-Ref
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: string  $name  The name
param: string  $path  The folder
param: string  $data  The data
return: string

updateFile(string $name, string $path, $data)   X-Ref
Updates the file with the given name in the given path with the data.

param: string  $name  The name
param: string  $path  The folder
param: string  $data  The data
return: void

delete(string $path)   X-Ref
Deletes the folder or file of the given path.

param: string  $path  The path to the file or folder
return: void

getPathInformation(string $path)   X-Ref
Returns the folder or file information for the given path. The returned object
has the following properties:
- 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
- thumb_path     The thumbnail path of file, when available

param: string  $path  The folder
return: \stdClass

getDate($date = null)   X-Ref
Returns a Date with the correct Joomla timezone for the given date.

param: string  $date  The date to create a Date from
return: Date

copy(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
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: string  $sourcePath       The source path
param: string  $destinationPath  The destination path
param: bool    $force            Force to overwrite
return: string

copyFile(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
Copies a file

param: string  $sourcePath       Source path of the file or directory
param: string  $destinationPath  Destination path of the file or directory
param: bool    $force            Set true to overwrite files or directories
return: void

copyFolder(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
Copies a folder

param: string  $sourcePath       Source path of the file or directory
param: string  $destinationPath  Destination path of the file or directory
param: bool    $force            Set true to overwrite files or directories
return: void

move(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
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: string  $sourcePath       The source path
param: string  $destinationPath  The destination path
param: bool    $force            Force to overwrite
return: string

moveFile(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
Moves a file

param: string  $sourcePath       Absolute path of source
param: string  $destinationPath  Absolute path of destination
param: bool    $force            Set true to overwrite file if exists
return: void

moveFolder(string $sourcePath, string $destinationPath, bool $force = false)   X-Ref
Moves a folder from source to destination

param: string  $sourcePath       Source path of the file or directory
param: string  $destinationPath  Destination path of the file or directory
param: bool    $force            Set true to overwrite files or directories
return: void

getUrl(string $path)   X-Ref
Returns a url which can be used to display an image from within the "images" directory.

param: string  $path  Path of the file relative to adapter
return: string

getAdapterName()   X-Ref
Returns the name of this adapter.

return: string

search(string $path, string $needle, bool $recursive = false)   X-Ref
Search for a pattern in a given path

param: string  $path       The base path for the search
param: string  $needle     The path to file
param: bool    $recursive  Do a recursive search
return: \stdClass[]

rglob(string $pattern, int $flags = 0)   X-Ref
Do a recursive search on a given path

param: string  $pattern  The pattern for search
param: int     $flags    Flags for search
return: array

getEncodedPath(string $path)   X-Ref
Replace spaces on a path with %20

param: string  $path  The Path to be encoded
return: string

getSafeName(string $name)   X-Ref
Creates a safe file name for the given name.

param: string  $name  The filename
return: string

checkContent(string $localPath, string $mediaContent)   X-Ref
Performs various check if it is allowed to save the content with the given name.

param: string  $localPath     The local path
param: string  $mediaContent  The media content
return: void

getFileName(string $path)   X-Ref
Returns the file name of the given path.

param: string  $path  The path
return: string

getLocalPath(string $path)   X-Ref
Returns the local filesystem path for the given path.

Throws an InvalidPathException if the path is invalid.

param: string  $path  The path
return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer