PHP 클래스 Puli\Repository\FilesystemRepository

Resources can be read using their absolute file system paths: php use Puli\Repository\FilesystemRepository; $repo = new FilesystemRepository(); $resource = $repo->get('/home/puli/.gitconfig'); The returned resources implement {@link FilesystemResource}. Optionally, a root directory can be passed to the constructor. Then all paths will be read relative to that directory: php $repo = new FilesystemRepository('/home/puli'); $resource = $repo->get('/.gitconfig'); While "." and ".." segments are supported, files outside the root directory cannot be read. Any leading ".." segments will simply be stripped off.
부터: 1.0
저자: Bernhard Schussek ([email protected])
상속: implements Puli\Repository\Api\EditableRepository
파일 보기 프로젝트 열기: puli/repository 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $baseDir = '/', boolean $symlink = true, boolean $relative = true, 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 )
isSymlinkSupported ( ) : boolean Returns whether symlinks are supported in the local environment.
listChildren ( $path )
remove ( $query, $language = 'glob' )

비공개 메소드들

메소드 설명
addResource ( $path, Puli\Repository\Api\Resource\PuliResource $resource, $checkParentsForSymlinks = true )
createResource ( $filesystemPath, $path )
ensureDirectoryExists ( $path )
getDirectoryIterator ( $filesystemPath )
getFilesystemPath ( $path )
getGlobIterator ( $query, $language )
getPath ( $filesystemPath )
iteratorToCollection ( Iterator $iterator )
readLink ( $filesystemPath )
removeResource ( $filesystemPath, &$removed )
replaceLinkByCopy ( $path, array $dirsToKeep = [] )
replaceParentSymlinksByCopies ( $path )
symlinkMirror ( $origin, $target, array $dirsToKeep = [] )
trySymlink ( $origin, $target )

메소드 상세

__construct() 공개 메소드

Creates a new repository.
public __construct ( string $baseDir = '/', boolean $symlink = true, boolean $relative = true, Puli\Repository\Api\ChangeStream\ChangeStream $changeStream = null )
$baseDir string The base directory of the repository on the file system.
$symlink boolean Whether to use symbolic links for added files. If symbolic links are not supported on the current system, the repository will create hard copies instead.
$relative boolean Whether to create relative symbolic links. If relative links are not supported on the current system, the repository will create absolute links instead.
$changeStream Puli\Repository\Api\ChangeStream\ChangeStream If provided, the repository will log resources changes in this change stream.

add() 공개 메소드

public add ( $path, $resource )

clear() 공개 메소드

public clear ( )

contains() 공개 메소드

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

find() 공개 메소드

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

get() 공개 메소드

public get ( $path )

hasChildren() 공개 메소드

public hasChildren ( $path )

isSymlinkSupported() 공개 정적인 메소드

Returns whether symlinks are supported in the local environment.
public static isSymlinkSupported ( ) : boolean
리턴 boolean Returns `true` if symlinks are supported.

listChildren() 공개 메소드

public listChildren ( $path )

remove() 공개 메소드

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