Property | Type | Description | |
---|---|---|---|
$baseDirectory | string | ||
$json | array |
Method | Description | |
---|---|---|
__construct ( string $path, string $baseDirectory, boolean $validateJson = false, Puli\Repository\Api\ChangeStream\ChangeStream $changeStream = null ) | Creates a new repository. | |
add ( $path, $resource ) | ||
clear ( ) | ||
contains ( $query, $language = 'glob' ) | ||
find ( $query, $language = 'glob' ) | ||
get ( $path ) | ||
hasChildren ( $path ) | ||
listChildren ( $path ) | ||
remove ( $query, $language = 'glob' ) | ||
setLogger ( Psr\Log\LoggerInterface $logger = null ) |
Method | Description | |
---|---|---|
addFilesystemResource ( string $path, Puli\Repository\Api\Resource\FilesystemResource $resource ) | Adds a filesystem resource to the JSON file. | |
createResource ( string $path, string | null $reference ) : Puli\Repository\Api\Resource\PuliResource | Turns a reference into a resource. | |
flush ( ) | Writes the JSON file. | |
getReferencesForGlob ( string $glob, integer $flags ) : string[] | null[] | Returns the references matching a given Puli path glob. | |
getReferencesForPath ( string $path ) : string[] | null[] | Returns the references for a given Puli path. | |
getReferencesForRegex ( string $staticPrefix, string $regex, integer $flags ) : string[] | null[] | Returns the references matching a given Puli path regular expression. | |
getReferencesInDirectory ( string $path, integer $flags ) : string[] | null[] | Returns the references in a given Puli path. | |
insertReference ( string $path, string | null $reference ) | Inserts a path reference into the JSON file. | |
isFilesystemReference ( string $reference ) : boolean | Returns whether a reference contains an absolute or relative filesystem path. | |
isLinkReference ( string $reference ) : boolean | Returns whether a reference contains a link. | |
load ( ) | Loads the JSON file. | |
log ( mixed $level, string $message ) | Logs a message. | |
logReferenceNotFound ( string $path, string $reference, string $absoluteReference ) | Logs a warning that a reference could not be found. | |
removeReferences ( string $glob ) | Removes all path references matching the given glob from the JSON file. |
Method | Description | |
---|---|---|
addResource ( string $path, Puli\Repository\Api\Resource\FilesystemResource | |
Adds a resource to the repository. | |
createResources ( array $references ) : array | Turns a list of references into a list of resources. | |
ensureDirectoryExists ( string $path ) | Adds all ancestor directories of a path to the repository. | |
getShortClassName ( string $className ) : string | Returns the short name of a fully-qualified class name. |
public __construct ( string $path, string $baseDirectory, boolean $validateJson = false, Puli\Repository\Api\ChangeStream\ChangeStream $changeStream = null ) | ||
$path | string | The path to the JSON file. If relative, it must be relative to the base directory. |
$baseDirectory | string | The base directory of the store. Paths inside that directory are stored as relative paths. Paths outside that directory are stored as absolute paths. |
$validateJson | boolean | Whether to validate the JSON file against the schema. Slow but spots problems. |
$changeStream | Puli\Repository\Api\ChangeStream\ChangeStream | If provided, the repository will append resource changes to this change stream. |
protected addFilesystemResource ( string $path, Puli\Repository\Api\Resource\FilesystemResource $resource ) | ||
$path | string | The Puli path. |
$resource | Puli\Repository\Api\Resource\FilesystemResource | The resource to add. |
abstract protected getReferencesForGlob ( string $glob, integer $flags ) : string[] | null[] | ||
$glob | string | The glob. |
$flags | integer | A bitwise combination of the flag constants in this class. |
return | string[] | null[] | A one-level array of references with Puli paths as keys. |
abstract protected getReferencesForPath ( string $path ) : string[] | null[] | ||
$path | string | The Puli path. |
return | string[] | null[] | A one-level array of references with Puli paths as keys. The array has at most one entry. |
abstract protected getReferencesForRegex ( string $staticPrefix, string $regex, integer $flags ) : string[] | null[] | ||
$staticPrefix | string | The static prefix of all Puli paths matching the regular expression. |
$regex | string | The regular expression. |
$flags | integer | A bitwise combination of the flag constants in this class. |
return | string[] | null[] | A one-level array of references with Puli paths as keys. |
abstract protected getReferencesInDirectory ( string $path, integer $flags ) : string[] | null[] | ||
$path | string | The Puli path. |
$flags | integer | A bitwise combination of the flag constants in this class. |
return | string[] | null[] | A one-level array of references with Puli paths as keys. |
protected isFilesystemReference ( string $reference ) : boolean | ||
$reference | string | The reference. |
return | boolean | Whether the reference contains a filesystem path. |
protected isLinkReference ( string $reference ) : boolean | ||
$reference | string | The reference. |
return | boolean | Whether the reference contains a link. |
abstract protected removeReferences ( string $glob ) | ||
$glob | string | The glob for a list of Puli paths. |
public setLogger ( Psr\Log\LoggerInterface $logger = null ) | ||
$logger | Psr\Log\LoggerInterface |