PHP Class TQ\Vcs\Repository\AbstractRepository

Inheritance: implements TQ\Vcs\Repository\RepositoryInterface
Show file Open project: teqneers/php-stream-wrapper-for-git Class Usage Examples

Protected Properties

Property Type Description
$author string The author used when committing changes
$directoryCreationMode integer The mode used to create directories when requested
$fileCreationMode integer The mode used to create files when requested
$repositoryPath string The repository path

Public Methods

Method Description
getAuthor ( ) : string Returns the author used when committing changes
getDirectoryCreationMode ( ) : integer Returns the mode used to create directories when requested
getFileCreationMode ( ) : integer Returns the mode used to create files when requested
getRepositoryPath ( ) : string Returns the full file system path to the repository
resolveFullPath ( string | array $path ) : string | array Resolves a path relative to the repository into an absolute path
resolveLocalPath ( string | array $path ) : string | array Resolves an absolute path into a path relative to the repository path
setAuthor ( string $author ) : TQ\Vcs\Repository\RepositoryInterface Sets the author used when committing changes
setDirectoryCreationMode ( integer $directoryCreationMode ) : TQ\Vcs\Repository\RepositoryInterface Sets the mode used to create directories when requested
setFileCreationMode ( integer $fileCreationMode ) : TQ\Vcs\Repository\RepositoryInterface Sets the mode used to create files when requested
transactional ( Closure $function ) : Transaction Runs $function in a transactional scope committing all changes to the repository on success, but rolling back all changes in the event of an Exception being thrown in the closure

Protected Methods

Method Description
__construct ( string $repositoryPath ) Creates a new repository instance - use {@see open()} instead

Method Details

__construct() protected method

Creates a new repository instance - use {@see open()} instead
protected __construct ( string $repositoryPath )
$repositoryPath string

getAuthor() public method

Returns the author used when committing changes
public getAuthor ( ) : string
return string

getDirectoryCreationMode() public method

Returns the mode used to create directories when requested

getFileCreationMode() public method

Returns the mode used to create files when requested
public getFileCreationMode ( ) : integer
return integer

getRepositoryPath() public method

Returns the full file system path to the repository
public getRepositoryPath ( ) : string
return string

resolveFullPath() public method

Resolves a path relative to the repository into an absolute path
public resolveFullPath ( string | array $path ) : string | array
$path string | array A local path (or an array of paths)
return string | array Either a single path or an array of paths is returned

resolveLocalPath() public method

Resolves an absolute path into a path relative to the repository path
public resolveLocalPath ( string | array $path ) : string | array
$path string | array A file system path (or an array of paths)
return string | array Either a single path or an array of paths is returned

setAuthor() public method

Sets the author used when committing changes
public setAuthor ( string $author ) : TQ\Vcs\Repository\RepositoryInterface
$author string The author used when committing changes
return TQ\Vcs\Repository\RepositoryInterface

setDirectoryCreationMode() public method

Sets the mode used to create directories when requested
public setDirectoryCreationMode ( integer $directoryCreationMode ) : TQ\Vcs\Repository\RepositoryInterface
$directoryCreationMode integer The mode, e.g. 755
return TQ\Vcs\Repository\RepositoryInterface

setFileCreationMode() public method

Sets the mode used to create files when requested
public setFileCreationMode ( integer $fileCreationMode ) : TQ\Vcs\Repository\RepositoryInterface
$fileCreationMode integer The mode, e.g. 644
return TQ\Vcs\Repository\RepositoryInterface

transactional() public method

The closure $function will be called with a {@see \TQ\Vcs\Repository\Transaction} as its only argument
public transactional ( Closure $function ) : Transaction
$function Closure The callback used inside the transaction
return Transaction

Property Details

$author protected property

The author used when committing changes
protected string $author
return string

$directoryCreationMode protected property

The mode used to create directories when requested
protected int $directoryCreationMode
return integer

$fileCreationMode protected property

The mode used to create files when requested
protected int $fileCreationMode
return integer

$repositoryPath protected property

The repository path
protected string $repositoryPath
return string