Arikaim CMS

Storage
in package
implements StorageInterface

Storage module class

Table of Contents

Interfaces

StorageInterface
Storage interface

Constants

RECYCLE_BIN_PATH  = 'bin' . DIRECTORY_SEPARATOR
ROOT_FILESYSTEM_NAME  = 'storage'
USER_FILESYSTEM_NAME  = 'user-storage'

Properties

$errorMessage  : string|null
Error message
$localFilesystems  : array<string|int, mixed>
Local filesystem names
$systemDir  : array<string|int, mixed>
System directories
$manager  : MountManager
Mount manager obj ref

Methods

__construct()  : mixed
Constructor
boot()  : void
Boot module
copy()  : bool
Copy files
createDir()  : bool
Create directory in storage folder
delete()  : bool
Delete file from storage folder
deleteDir()  : bool
Delete directory in storage folder
deleteFiles()  : void
Delete all files in direcotry (recursive)
get()  : FilesystemInterface|null
Get filesystem
getFullPath()  : string
Get full file path
getMessage()  : string|null
Get error
getMetadata()  : array<string|int, mixed>|false
Get file info
getMimetype()  : string|false
Get Mimetypes
getPublicPath()  : string
Get pubic path
getRecyleBinPath()  : string
Get recycle bin path
getRootFilesystemName()  : string
Get root filesystem name
getSize()  : int|false
Get file size
getStorageRelativePath()  : string
Get relative storage path
getSystemDirectories()  : array<string|int, mixed>
Get sytem directories
has()  : bool
Return true if file exist
install()  : bool
Install module
isDir()  : bool
Return true if file is directory
isEmpty()  : bool
Return true if directory is empty
isLocalFilesystem()  : bool
Return true if filesystem is local
isSystemDir()  : bool
Return true if path is system dir
listContents()  : array<string|int, mixed>|false
Get directory contents
manager()  : MountManager
Get Mount Manager
mount()  : MountManager|false
Mount filesystem
mountFilesystem()  : bool
Mount filesystem
mountLocal()  : MountManager|false
Mount local filesystem
moveFile()  : bool
Move file
moveFiles()  : void
Move all files (recursive)
read()  : string|false
Read file
readStream()  : resource|false
Read file as a stream
rename()  : bool
Rename files
update()  : bool
Update files
updateStream()  : bool
Update files using a stream
write()  : bool
Write files
writeStream()  : bool
Write file stream

Constants

RECYCLE_BIN_PATH

public mixed RECYCLE_BIN_PATH = 'bin' . DIRECTORY_SEPARATOR

ROOT_FILESYSTEM_NAME

public mixed ROOT_FILESYSTEM_NAME = 'storage'

USER_FILESYSTEM_NAME

public mixed USER_FILESYSTEM_NAME = 'user-storage'

Properties

$errorMessage

Error message

protected string|null $errorMessage = null

$localFilesystems

Local filesystem names

protected array<string|int, mixed> $localFilesystems = ['storage', 'user-storage']

$systemDir

System directories

protected array<string|int, mixed> $systemDir = ['backup', 'public', 'repository', 'temp', 'bin']

$manager

Mount manager obj ref

private MountManager $manager

Methods

__construct()

Constructor

public __construct() : mixed

boot()

Boot module

public boot() : void

copy()

Copy files

public copy(string $from, string $to[, string|null $fileSystemName = null ]) : bool
Parameters
$from : string
$to : string
$fileSystemName : string|null = null
Return values
bool

createDir()

Create directory in storage folder

public createDir(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

delete()

Delete file from storage folder

public delete(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

deleteDir()

Delete directory in storage folder

public deleteDir(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

deleteFiles()

Delete all files in direcotry (recursive)

public deleteFiles(string $path[, string|null $fileSystemName = null ]) : void
Parameters
$path : string
$fileSystemName : string|null = null

get()

Get filesystem

public get(string $name) : FilesystemInterface|null
Parameters
$name : string
Return values
FilesystemInterface|null

getFullPath()

Get full file path

public getFullPath([string $path = '' ][, string|null $fileSystemName = null ]) : string
Parameters
$path : string = ''
$fileSystemName : string|null = null
Return values
string

getMessage()

Get error

public getMessage() : string|null
Return values
string|null

getMetadata()

Get file info

public getMetadata(string $path[, string|null $fileSystemName = null ]) : array<string|int, mixed>|false
Parameters
$path : string
$fileSystemName : string|null = null
Return values
array<string|int, mixed>|false

getMimetype()

Get Mimetypes

public getMimetype(string $path[, string|null $fileSystemName = null ]) : string|false
Parameters
$path : string
$fileSystemName : string|null = null
Return values
string|false

getPublicPath()

Get pubic path

public getPublicPath([bool $relative = false ]) : string
Parameters
$relative : bool = false
Return values
string

getRecyleBinPath()

Get recycle bin path

public getRecyleBinPath() : string
Return values
string

getRootFilesystemName()

Get root filesystem name

public getRootFilesystemName() : string
Return values
string

getSize()

Get file size

public getSize(string $path[, string|null $fileSystemName = null ]) : int|false
Parameters
$path : string
$fileSystemName : string|null = null
Return values
int|false

getStorageRelativePath()

Get relative storage path

public getStorageRelativePath([bool $public = false ]) : string
Parameters
$public : bool = false
Return values
string

getSystemDirectories()

Get sytem directories

public getSystemDirectories() : array<string|int, mixed>
Return values
array<string|int, mixed>

has()

Return true if file exist

public has(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

install()

Install module

public install() : bool
Return values
bool

isDir()

Return true if file is directory

public isDir(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

isEmpty()

Return true if directory is empty

public isEmpty(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

isLocalFilesystem()

Return true if filesystem is local

public isLocalFilesystem(string|null $name) : bool
Parameters
$name : string|null
Return values
bool

isSystemDir()

Return true if path is system dir

public isSystemDir(string $path[, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$fileSystemName : string|null = null
Return values
bool

listContents()

Get directory contents

public listContents([string $path = '' ][, bool $recursive = false ][, string|null $fileSystemName = null ]) : array<string|int, mixed>|false
Parameters
$path : string = ''
$recursive : bool = false
$fileSystemName : string|null = null
Return values
array<string|int, mixed>|false

manager()

Get Mount Manager

public manager() : MountManager
Return values
MountManager

mount()

Mount filesystem

public mount(string $name, object|string $adapter) : MountManager|false
Parameters
$name : string
$adapter : object|string

Adapter object or driver name

Return values
MountManager|false

mountFilesystem()

Mount filesystem

public mountFilesystem(string $name, Filesystem $filesystem) : bool
Parameters
$name : string
$filesystem : Filesystem
Return values
bool

mountLocal()

Mount local filesystem

public mountLocal(string $name[, string|null $path = null ]) : MountManager|false
Parameters
$name : string
$path : string|null = null
Return values
MountManager|false

moveFile()

Move file

public moveFile(string $from, string $to[, string|null $fileSystemName = null ]) : bool
Parameters
$from : string
$to : string
$fileSystemName : string|null = null
Return values
bool

moveFiles()

Move all files (recursive)

public moveFiles(string $from, string $to[, string|null $fileSystemName = null ]) : void
Parameters
$from : string
$to : string
$fileSystemName : string|null = null

read()

Read file

public read(string $path[, string|null $fileSystemName = null ]) : string|false
Parameters
$path : string
$fileSystemName : string|null = null
Return values
string|false

readStream()

Read file as a stream

public readStream(string $path[, string|null $fileSystemName = null ]) : resource|false
Parameters
$path : string
$fileSystemName : string|null = null
Return values
resource|false

rename()

Rename files

public rename(string $from, string $to[, string|null $fileSystemName = null ]) : bool
Parameters
$from : string
$to : string
$fileSystemName : string|null = null
Return values
bool

update()

Update files

public update(string $path, string $contents[, array<string|int, mixed> $config = [] ][, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$contents : string
$config : array<string|int, mixed> = []
$fileSystemName : string|null = null
Return values
bool

updateStream()

Update files using a stream

public updateStream(string $path, mixed $resource[, array<string|int, mixed> $config = [] ][, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$resource : mixed
$config : array<string|int, mixed> = []
$fileSystemName : string|null = null
Return values
bool

write()

Write files

public write(string $path, string $contents[, array<string|int, mixed> $config = [] ][, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$contents : string
$config : array<string|int, mixed> = []
$fileSystemName : string|null = null
Return values
bool

writeStream()

Write file stream

public writeStream(string $path, resource $resource[, array<string|int, mixed> $config = [] ][, string|null $fileSystemName = null ]) : bool
Parameters
$path : string
$resource : resource
$config : array<string|int, mixed> = []
$fileSystemName : string|null = null
Return values
bool

        
On this page

Search results