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

Inheritance: extends AbstractIoDriver
Datei anzeigen Open project: bravo3/orm

Protected Properties

Property Type Description
$data_dir string
$umask integer

Public Methods

Method Description
__construct ( string $data_dir, integer $umask = 432 )
delete ( string $key ) Delete a key
exists ( string $key ) : boolean Check if a key exists on the interface
getDataDir ( ) : string Get DataDir
getUmask ( boolean $directory = false ) : integer Get Umask
read ( string $key ) : string | null Read raw data from the filesystem, returning null if the file is not readable
scan ( string $base, string $filter ) : string[] Get a list of keys on the filesystem
setDataDir ( string $data_dir ) Set DataDir
setUmask ( integer $umask ) Set Umask
write ( string $key, string $data ) Write raw data to the filesystem

Private Methods

Method Description
addExecuteBit ( $umask ) : integer Adds the execute bit (001) to an octal trio of RWX bits where each trio has the read (100) bit
isReadableFile ( string $filename ) : boolean Test if $filename is a file and is readable
keyToFilename ( string $key, boolean $validate_dir = true ) : string Get a filename for a key, validating the directory exists

Method Details

__construct() public method

public __construct ( string $data_dir, integer $umask = 432 )
$data_dir string Base directory or filename for database
$umask integer Filesystem umask

delete() public method

Delete a key
public delete ( string $key )
$key string

exists() public method

Check if a key exists on the interface
public exists ( string $key ) : boolean
$key string
return boolean

getDataDir() public method

Get DataDir
public getDataDir ( ) : string
return string

getUmask() public method

Get Umask
public getUmask ( boolean $directory = false ) : integer
$directory boolean True if you need a umask for a directory (executable)
return integer

read() public method

Read raw data from the filesystem, 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 on the filesystem
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[]

setDataDir() public method

Set DataDir
public setDataDir ( string $data_dir )
$data_dir string

setUmask() public method

Set Umask
public setUmask ( integer $umask )
$umask integer

write() public method

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

Property Details

$data_dir protected_oe property

protected string $data_dir
return string

$umask protected_oe property

protected int $umask
return integer