PHP Class Puli\Repository\InMemoryRepository

Resources can be added with the method {@link add()}: php use Puli\Repository\InMemoryRepository; $repo = new InMemoryRepository(); $repo->add('/css', new DirectoryResource('/path/to/project/res/css'));
Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: extends AbstractEditableRepository
Mostrar archivo Open project: puli/repository Class Usage Examples

Public Methods

Method Description
__construct ( Puli\Repository\Api\ChangeStream\ChangeStream $changeStream = null ) Create the repository.
add ( $path, $resource )
clear ( )
contains ( $query, $language = 'glob' )
find ( $query, $language = 'glob' )
get ( $path )
hasChildren ( $path )
listChildren ( $path )
remove ( $query, $language = 'glob' )

Protected Methods

Method Description
getGlobIterator ( string $glob ) : GlobFilterIterator Returns an iterator for a glob.

Private Methods

Method Description
addResource ( $path, Puli\Repository\Api\Resource\PuliResource $resource )
ensureDirectoryExists ( string $path ) Recursively creates a directory for a path.
getChildIterator ( Puli\Repository\Api\Resource\PuliResource $resource ) : RegexFilterIterator Returns an iterator for the children of a resource.
removeResource ( Puli\Repository\Api\Resource\PuliResource $resource )

Method Details

__construct() public method

Create the repository.
public __construct ( Puli\Repository\Api\ChangeStream\ChangeStream $changeStream = null )
$changeStream Puli\Repository\Api\ChangeStream\ChangeStream If provided, the repository will log resources changes in this change stream.

add() public method

public add ( $path, $resource )

clear() public method

public clear ( )

contains() public method

public contains ( $query, $language = 'glob' )

find() public method

public find ( $query, $language = 'glob' )

get() public method

public get ( $path )

getGlobIterator() protected method

Returns an iterator for a glob.
protected getGlobIterator ( string $glob ) : GlobFilterIterator
$glob string The glob.
return Webmozart\Glob\Iterator\GlobFilterIterator The iterator.

hasChildren() public method

public hasChildren ( $path )

listChildren() public method

public listChildren ( $path )

remove() public method

public remove ( $query, $language = 'glob' )