PHP Класс PrivateBin\Data\Filesystem

Model for filesystem data access, implemented as a singleton.
Наследование: extends AbstractData
Показать файл Открыть проект

Открытые методы

Метод Описание
create ( string $pasteid, array $paste ) : boolean Create a paste.
createComment ( string $pasteid, string $parentid, string $commentid, array $comment ) : boolean Create a comment in a paste.
delete ( string $pasteid ) : void Delete a paste and its discussion.
exists ( string $pasteid ) : boolean Test if a paste exists.
existsComment ( string $pasteid, string $parentid, string $commentid ) : boolean Test if a comment exists.
getInstance ( array $options = null ) : Filesystem get instance of singleton
read ( string $pasteid ) : stdClass | false Read a paste.
readComments ( string $pasteid ) : array Read all comments of paste.

Защищенные методы

Метод Описание
_getExpiredPastes ( integer $batchsize ) : array Returns up to batch size number of paste ids that have expired

Приватные методы

Метод Описание
_dataid2discussionpath ( string $dataid ) : string Convert paste id to discussion storage path.
_dataid2path ( string $dataid ) : string Convert paste id to storage path.
_init ( ) : void initialize privatebin
_isFirstLevelDir ( string $element ) : boolean Check that the given element is a valid first level directory.
_isSecondLevelDir ( string $element ) : boolean Check that the given element is a valid second level directory.

Описание методов

_getExpiredPastes() защищенный Метод

Returns up to batch size number of paste ids that have expired
protected _getExpiredPastes ( integer $batchsize ) : array
$batchsize integer
Результат array

create() публичный Метод

Create a paste.
public create ( string $pasteid, array $paste ) : boolean
$pasteid string
$paste array
Результат boolean

createComment() публичный Метод

Create a comment in a paste.
public createComment ( string $pasteid, string $parentid, string $commentid, array $comment ) : boolean
$pasteid string
$parentid string
$commentid string
$comment array
Результат boolean

delete() публичный Метод

Delete a paste and its discussion.
public delete ( string $pasteid ) : void
$pasteid string
Результат void

exists() публичный Метод

Test if a paste exists.
public exists ( string $pasteid ) : boolean
$pasteid string
Результат boolean

existsComment() публичный Метод

Test if a comment exists.
public existsComment ( string $pasteid, string $parentid, string $commentid ) : boolean
$pasteid string
$parentid string
$commentid string
Результат boolean

getInstance() публичный статический Метод

get instance of singleton
public static getInstance ( array $options = null ) : Filesystem
$options array
Результат Filesystem

read() публичный Метод

Read a paste.
public read ( string $pasteid ) : stdClass | false
$pasteid string
Результат stdClass | false

readComments() публичный Метод

Read all comments of paste.
public readComments ( string $pasteid ) : array
$pasteid string
Результат array