PHP 클래스 Puli\Repository\OptimizedJsonRepository

The generated JSON file is described by res/schema/repository-schema-1.0.json. Resources can be added with the method {@link add()}: php use Puli\Repository\OptimizedJsonRepository; $repo = new OptimizedJsonRepository('/path/to/repository.json', '/path/to/project'); $repo->add('/css', new DirectoryResource('/path/to/project/res/css')); When adding a resource, the added filesystem path is stored in the JSON file under the key of the Puli path. The path is stored relatively to the base directory passed to the constructor. Directories will be expanded and all nested files will be added to the mapping file as well: json { "/css": "res/css", "/css/style.css": "res/css/style.css" } Mapped resources can be read with the method {@link get()}: php $cssPath = $repo->get('/css')->getFilesystemPath(); You can also access nested files: php echo $repo->get('/css/style.css')->getBody(); Since nested files are searched during {@link add()} and added to the JSON file, this repository does not detect any files that you add to a directory after adding that directory to the repository. This means that accessing files is very fast, but also that the usage of this repository implementation can be cumbersome in development environments. There you are recommended to use {@link JsonRepository} instead.
부터: 1.0
저자: Bernhard Schussek ([email protected])
저자: Titouan Galopin ([email protected])
상속: extends AbstractJsonRepository, implements Puli\Repository\Api\EditableRepository
파일 보기 프로젝트 열기: puli/repository

공개 메소드들

메소드 설명
clear ( )

보호된 메소드들

메소드 설명
addFilesystemResource ( $path, Puli\Repository\Api\Resource\FilesystemResource $resource )
getReferencesForGlob ( $glob, $flags )
getReferencesForPath ( $path )
getReferencesForRegex ( $staticPrefix, $regex, $flags )
getReferencesInDirectory ( $path, $flags )
insertReference ( $path, $reference )
removeReferences ( $glob )

메소드 상세

addFilesystemResource() 보호된 메소드

protected addFilesystemResource ( $path, Puli\Repository\Api\Resource\FilesystemResource $resource )
$resource Puli\Repository\Api\Resource\FilesystemResource

clear() 공개 메소드

public clear ( )

getReferencesForGlob() 보호된 메소드

protected getReferencesForGlob ( $glob, $flags )

getReferencesForPath() 보호된 메소드

protected getReferencesForPath ( $path )

getReferencesForRegex() 보호된 메소드

protected getReferencesForRegex ( $staticPrefix, $regex, $flags )

getReferencesInDirectory() 보호된 메소드

protected getReferencesInDirectory ( $path, $flags )

insertReference() 보호된 메소드

protected insertReference ( $path, $reference )

removeReferences() 보호된 메소드

protected removeReferences ( $glob )