RepoCreator
in package
Table of Contents
Properties
- $regexFolderName : mixed
- $regexLinuxAbsolutePath : mixed
- $regexWindowsAbsolutePath : mixed
Methods
- createRepository() : bool
- Creates a new repository with the given properties.
- pathValidator() : string
- Tests and validates a path to create a repository.
Properties
$regexFolderName
protected
static mixed
$regexFolderName
= '/^[a-zA-Z0-9_]+$/'
$regexLinuxAbsolutePath
protected
static mixed
$regexLinuxAbsolutePath
= '/^[\/][a-zA-Z0-9_\/]+/'
$regexWindowsAbsolutePath
protected
static mixed
$regexWindowsAbsolutePath
= '/^[A-Z][:][\/][a-zA-Z0-9_\/]+/'
Methods
createRepository()
Creates a new repository with the given properties.
public
static createRepository(string $key, string $label, string $path, bool $allowUserDefinedThemes, bool $createDirectory) : bool
Parameters
- $key : string
-
The unique identifier for the repository. Must not yet exist.
- $label : string
-
the display name of the repository
- $path : string
-
the path to the repository directory
- $allowUserDefinedThemes : bool
-
whether user-defined themes are allowed for the repository
- $createDirectory : bool
-
whether to create the repository directory
Tags
Return values
bool —returns true if the repository is successfully created
pathValidator()
Tests and validates a path to create a repository.
public
static pathValidator(string $path, string $rootRepo) : string
Parameters
- $path : string
-
The path to validate. It can be a relative or absolute path.
- $rootRepo : string
-
the root repository directory used as a base for paths
Tags
Return values
string —Returns the path