PHP 클래스 Puli\Manager\Api\Repository\PathMapping

The filesystem paths are passed in the form of *path references* that are either paths relative to the module's root directory or paths relative to another modules's root directory prefixed with @vendor/module:, where "vendor/module" is the name of the referenced module. The path references are turned into absolute filesystem paths when {@link load()} is called.
부터: 1.0
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: puli/manager 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $repositoryPath, string | string[] $pathReferences ) Creates a new path mapping.
addConflict ( Puli\Manager\Api\Repository\PathConflict $conflict ) Adds a conflict to the mapping.
getConflictingMappings ( ) : PathMapping[] Returns all conflicting path mappings.
getConflictingModules ( ) : ModuleList Returns all modules with conflicting path mappings.
getConflicts ( ) : Puli\Manager\Api\Repository\PathConflict[] Returns the conflicts of the mapping.
getContainingModule ( ) : Puli\Manager\Api\Module\Module Returns the module that contains the mapping.
getFilesystemPaths ( ) : string[] Returns the referenced filesystem paths.
getLoadErrors ( ) : Exceptio\Exception[] Returns the errors that occurred during loading of the mapping.
getPathReferences ( ) : string[] Returns the path references.
getRepositoryPath ( ) : string Returns the repository path.
getState ( ) : integer Returns the state of the mapping.
isConflicting ( ) : boolean Returns whether the mapping conflicts with a mapping in another module.
isEnabled ( ) : boolean Returns whether the mapping is enabled.
isLoaded ( ) : boolean Returns whether the mapping is loaded.
isNotFound ( ) : boolean Returns whether the path referenced by the mapping was not found.
listPathMappings ( ) : string[] Lists all filesystem path to repository path mappings of this mapping.
listRepositoryPaths ( ) : string[] Lists all mapped repository paths.
load ( Puli\Manager\Api\Module\Module $containingModule, ModuleList $modules ) Loads the mapping.
removeConflict ( Puli\Manager\Api\Repository\PathConflict $conflict ) Removes a conflict from the mapping.
unload ( ) Unloads the mapping.

비공개 메소드들

메소드 설명
assertFileExists ( $absolutePath, $relativePath, Puli\Manager\Api\Module\Module $containingModule )
makeAbsolute ( $relativePath, Puli\Manager\Api\Module\Module $containingModule, ModuleList $modules )
refreshState ( )

메소드 상세

__construct() 공개 메소드

Creates a new path mapping.
public __construct ( string $repositoryPath, string | string[] $pathReferences )
$repositoryPath string The repository path.
$pathReferences string | string[] The path references.

addConflict() 공개 메소드

A mapping can refer to at most one conflict per conflicting repository path. If the same conflict is added twice, the second addition is ignored. If a different conflict is added for an existing repository path, the previous conflict is removed before adding the new conflict for the repository path. The repository path of the conflict must either be the repository path of the mapping or any path within. If a conflict with a different path is added, an exception is thrown. The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public addConflict ( Puli\Manager\Api\Repository\PathConflict $conflict )
$conflict Puli\Manager\Api\Repository\PathConflict The conflict to be added.

getConflictingMappings() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getConflictingMappings ( ) : PathMapping[]
리턴 PathMapping[] The conflicting path mappings.

getConflictingModules() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getConflictingModules ( ) : ModuleList
리턴 Puli\Manager\Api\Module\ModuleList The conflicting modules.

getConflicts() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getConflicts ( ) : Puli\Manager\Api\Repository\PathConflict[]
리턴 Puli\Manager\Api\Repository\PathConflict[] The conflicts.

getContainingModule() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getContainingModule ( ) : Puli\Manager\Api\Module\Module
리턴 Puli\Manager\Api\Module\Module The containing module or `null` if the mapping has not been loaded.

getFilesystemPaths() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getFilesystemPaths ( ) : string[]
리턴 string[] The absolute filesystem paths.

getLoadErrors() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getLoadErrors ( ) : Exceptio\Exception[]
리턴 Exceptio\Exception[] The errors that occurred during loading. If the returned array is empty, the mapping was loaded successfully.

getPathReferences() 공개 메소드

The path references refer to filesystem paths. A path reference is either: * a path relative to the root directory of the containing module; * a path relative to the root directory of another module, prefixed with @vendor/module:, where "vendor/module" is the name of the referenced module.
public getPathReferences ( ) : string[]
리턴 string[] The path references.

getRepositoryPath() 공개 메소드

Returns the repository path.
public getRepositoryPath ( ) : string
리턴 string The repository path.

getState() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getState ( ) : integer
리턴 integer One of the {@link PathMappingState} constants.

isConflicting() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
또한 보기: PathMappingState::CONFLICT
public isConflicting ( ) : boolean
리턴 boolean Returns `true` if the state is {@link PathMappingState::CONFLICT}.

isEnabled() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
또한 보기: PathMappingState::ENABLED
public isEnabled ( ) : boolean
리턴 boolean Returns `true` if the state is {@link PathMappingState::ENABLED}.

isLoaded() 공개 메소드

Returns whether the mapping is loaded.
public isLoaded ( ) : boolean
리턴 boolean Returns `true` if {@link load()} was called.

isNotFound() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
또한 보기: PathMappingState::NOT_FOUND
public isNotFound ( ) : boolean
리턴 boolean Returns `true` if the state is {@link PathMappingState::NOT_FOUND}.

listPathMappings() 공개 메소드

Lists all filesystem path to repository path mappings of this mapping.
public listPathMappings ( ) : string[]
리턴 string[] An array of repository paths with their corresponding filesystem paths as keys. If the mapping has multiple filesystem paths, then repository paths may occur multiple times in the returned array.

listRepositoryPaths() 공개 메소드

Contrary to {@link getRepositoryPath()}, this array also contains all nested repository paths that are mapped by this mapping.
public listRepositoryPaths ( ) : string[]
리턴 string[] A list of all mapped repository paths.

load() 공개 메소드

Loads the mapping.
public load ( Puli\Manager\Api\Module\Module $containingModule, ModuleList $modules )
$containingModule Puli\Manager\Api\Module\Module The module that contains the mapping.
$modules Puli\Manager\Api\Module\ModuleList A list of modules that can be referenced using `@vendor/module:` prefixes in the path references.

removeConflict() 공개 메소드

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public removeConflict ( Puli\Manager\Api\Repository\PathConflict $conflict )
$conflict Puli\Manager\Api\Repository\PathConflict The conflict to remove.

unload() 공개 메소드

This method reverses the effects of {@link load()}. Additionally, all associated conflicts are dereferenced.
public unload ( )