PHP Class Bravo3\Orm\Drivers\Filesystem\Io\PharIoDriver

Inheritance: extends AbstractIoDriver
Show file Open project: bravo3/orm

Protected Properties

Property Type Description
$archive PharData
$compression Bravo3\Orm\Drivers\Filesystem\Enum\Compression
$filename string

Public Methods

Method Description
__construct ( string $filename, ArchiveType $archive_type, Compression $compression = null ) Create a tar or zip I/O driver
__destruct ( ) Archive cleanup
delete ( string $key ) Delete a key from the archive
exists ( string $key ) : boolean Check if a key exists in the archive
read ( string $key ) : string | null Read raw data from the archive, returning null if the file is not readable
scan ( string $base, string $filter ) : string[] Get a list of keys in the archive
write ( string $key, string $data ) Write raw data to the archive

Method Details

__construct() public method

Create a tar or zip I/O driver
public __construct ( string $filename, ArchiveType $archive_type, Compression $compression = null )
$filename string Path to database file
$archive_type Bravo3\Orm\Drivers\Filesystem\Enum\ArchiveType Tar or zip archive
$compression Bravo3\Orm\Drivers\Filesystem\Enum\Compression Compression not supported by zip archives

__destruct() public method

Archive cleanup
public __destruct ( )

delete() public method

Delete a key from the archive
public delete ( string $key )
$key string

exists() public method

Check if a key exists in the archive
public exists ( string $key ) : boolean
$key string
return boolean

read() public method

Read raw data from the archive, returning null if the file is not readable
public read ( string $key ) : string | null
$key string
return string | null

scan() public method

Get a list of keys in the archive
public scan ( string $base, string $filter ) : string[]
$base string Base path to list all keys from
$filter string Key filter, @see docs/Queries.md - Wildcards
return string[]

write() public method

Write raw data to the archive
public write ( string $key, string $data )
$key string
$data string

Property Details

$archive protected property

protected PharData $archive
return PharData

$compression protected property

protected Compression,Bravo3\Orm\Drivers\Filesystem\Enum $compression
return Bravo3\Orm\Drivers\Filesystem\Enum\Compression

$filename protected property

protected string $filename
return string