|
| __construct (string $rootPath, string $filePath) |
|
| 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) |
|
| copy (string $sourcePath, string $destinationPath, bool $force=false) |
|
| move (string $sourcePath, string $destinationPath, bool $force=false) |
|
| getUrl (string $path) |
|
| getAdapterName () |
|
| search (string $path, string $needle, bool $recursive=false) |
|
|
| getPathInformation (string $path) |
|
| getDate ($date=null) |
|
| copyFile (string $sourcePath, string $destinationPath, bool $force=false) |
|
| copyFolder (string $sourcePath, string $destinationPath, bool $force=false) |
|
| moveFile (string $sourcePath, string $destinationPath, bool $force=false) |
|
| moveFolder (string $sourcePath, string $destinationPath, bool $force=false) |
|
| rglob (string $pattern, int $flags=0) |
|
| getEncodedPath (string $path) |
|
| getSafeName (string $name) |
|
| checkContent (string $localPath, string $mediaContent) |
|
| getFileName (string $path) |
|
| getLocalPath (string $path) |
|
Local file adapter.
- Depuis
- 4.0.0
◆ __construct()
__construct |
( |
string |
$rootPath, |
|
|
string |
$filePath |
|
) |
| |
The absolute root path in the local file system.
- Paramètres
-
string | $rootPath | The root path |
string | $filePath | The file path of media folder |
- Depuis
- 4.0.0
Références Path\clean().
◆ checkContent()
checkContent |
( |
string |
$localPath, |
|
|
string |
$mediaContent |
|
) |
| |
|
private |
◆ 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 | $sourcePath | The source path |
string | $destinationPath | The destination path |
bool | $force | Force to overwrite |
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $name, et Path\clean().
◆ copyFile()
copyFile |
( |
string |
$sourcePath, |
|
|
string |
$destinationPath, |
|
|
bool |
$force = false |
|
) |
| |
|
private |
Copies a file
- Paramètres
-
string | $sourcePath | Source path of the file or directory |
string | $destinationPath | Destination path of the file or directory |
bool | $force | Set true to overwrite files or directories |
- Renvoie
- void
- Depuis
- 4.0.0
- Exceptions
-
Références File\copy().
◆ copyFolder()
copyFolder |
( |
string |
$sourcePath, |
|
|
string |
$destinationPath, |
|
|
bool |
$force = false |
|
) |
| |
|
private |
Copies a folder
- Paramètres
-
string | $sourcePath | Source path of the file or directory |
string | $destinationPath | Destination path of the file or directory |
bool | $force | Set true to overwrite files or directories |
- Renvoie
- void
- Depuis
- 4.0.0
- Exceptions
-
Références Folder\copy(), et File\delete().
◆ 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 | $name | The name |
string | $path | The folder |
string | $data | The data |
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $data, $name, $path, et File\write().
◆ 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 | $name | The name |
string | $path | The folder |
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $name, $path, et Folder\create().
◆ delete()
◆ getAdapterName()
Returns the name of this adapter.
- Renvoie
- string
- Depuis
- 4.0.0
Implémente AdapterInterface.
◆ getDate()
◆ getEncodedPath()
getEncodedPath |
( |
string |
$path | ) |
|
|
private |
Replace spaces on a path with %20
- Paramètres
-
string | $path | The Path to be encoded |
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Références $path.
◆ 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 | $path | The path to the file or folder |
- Renvoie
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $basePath, et $path.
◆ getFileName()
getFileName |
( |
string |
$path | ) |
|
|
private |
Returns the file name of the given path.
- Paramètres
-
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Références $path, et Path\clean().
◆ 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
-
- Renvoie
- []
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $basePath, $data, $folder, $path, Path\clean(), Folder\files(), et Folder\folders().
◆ getLocalPath()
getLocalPath |
( |
string |
$path | ) |
|
|
private |
Returns the local filesystem path for the given path.
Throws an InvalidPathException if the path is invalid.
- Paramètres
-
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Références $path, et Path\check().
◆ getPathInformation()
getPathInformation |
( |
string |
$path | ) |
|
|
private |
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ètres
-
- Renvoie
- Depuis
- 4.0.0
Références $path, Text\_(), HTMLHelper\_(), Path\clean(), File\getExt(), Image\getImageFileProperties(), MediaHelper\getMimeType(), et MediaHelper\isImage().
◆ getResource()
getResource |
( |
string |
$path | ) |
|
Returns a resource to download the path.
- Paramètres
-
string | $path | The path to download |
- Renvoie
- resource
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $path.
◆ getSafeName()
getSafeName |
( |
string |
$name | ) |
|
|
private |
◆ getUrl()
Returns a url which can be used to display an image from within the "images" directory.
- Paramètres
-
string | $path | Path of the file relative to adapter |
- Renvoie
- string
- Depuis
- 4.0.0
Implémente AdapterInterface.
Références $path, et Uri\root().
◆ 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 | $sourcePath | The source path |
string | $destinationPath | The destination path |
bool | $force | Force to overwrite |
- Renvoie
- string
- Depuis
- 4.0.0
- Exceptions
-
Implémente AdapterInterface.
Références $name, Text\_(), et Path\clean().
◆ moveFile()
moveFile |
( |
string |
$sourcePath, |
|
|
string |
$destinationPath, |
|
|
bool |
$force = false |
|
) |
| |
|
private |
Moves a file
- Paramètres
-
string | $sourcePath | Absolute path of source |
string | $destinationPath | Absolute path of destination |
bool | $force | Set true to overwrite file if exists |
- Renvoie
- void
- Depuis
- 4.0.0
- Exceptions
-
Références MediaHelper\checkFileExtension(), et File\move().
◆ moveFolder()
moveFolder |
( |
string |
$sourcePath, |
|
|
string |
$destinationPath, |
|
|
bool |
$force = false |
|
) |
| |
|
private |
Moves a folder from source to destination
- Paramètres
-
string | $sourcePath | Source path of the file or directory |
string | $destinationPath | Destination path of the file or directory |
bool | $force | Set true to overwrite files or directories |
- Renvoie
- void
- Depuis
- 4.0.0
- Exceptions
-
Références $value, Folder\copy(), File\delete(), Folder\delete(), et Folder\move().
◆ rglob()
rglob |
( |
string |
$pattern, |
|
|
int |
$flags = 0 |
|
) |
| |
|
private |
Do a recursive search on a given path
- Paramètres
-
string | $pattern | The pattern for search |
int | $flags | Flags for search |
- Renvoie
- array
- Depuis
- 4.0.0
Références $dir.
◆ search()
search |
( |
string |
$path, |
|
|
string |
$needle, |
|
|
bool |
$recursive = false |
|
) |
| |
Search for a pattern in a given path
- Paramètres
-
string | $path | The base path for the search |
string | $needle | The path to file |
bool | $recursive | Do a recursive search |
- Renvoie
- []
- Depuis
- 4.0.0
Implémente AdapterInterface.
Références $path, $result, $results, et Path\clean().
◆ updateFile()
updateFile |
( |
string |
$name, |
|
|
string |
$path, |
|
|
|
$data |
|
) |
| |
◆ $filePath
◆ $rootPath
La documentation de cette classe a été générée à partir du fichier suivant :