class RouteDriver extends AbstractDriver (View source)

Installer driver to process http routes

This class will parse every "routes" extra field. It expects the field syntax to be like the following:

"extra": { "routes": { "test": { "query": [ { "page": "p(\d+)" }, { "ux_timestamp*": "\d{10}", "microseconds": "\d{4}" } ], "type": "ROUTE", "class": "\Comodojo\Dispatcher\Service\Test" "parameters": { "cache": "SERVER", "ttl": 3 } } } }

Properties

protected Composer $composer from AbstractDriver
protected IOInterface $io from AbstractDriver
protected Configuration $configuration from AbstractDriver
protected InstallerParameters $parameters from AbstractDriver
protected InstallerPersistenceInterface $persistence from AbstractDriver
protected $base_route

Methods

__construct(Composer $composer, IOInterface $io, Configuration $configuration, InstallerParameters $parameters, InstallerPersistenceInterface $persistence)

Driver constructor, just to ensure all pieces are in the right place

Composer
getComposer()

No description

IOInterface
getIo()

No description

Configuration
getConfiguration()

No description

void
install(string $package_name, string $package_path, array $package_extra)

Install a package, processing all extra fields that it contains.

void
update(string $package_name, string $package_path, array $initial_extra, array $target_extra)

Update a package checking differences from it's initial and target extra fields.

void
uninstall(string $package_name, string $package_path, array $package_extra)

Uninstall package, removing all related extra fields.

installRoutes($config, $package_name, array $package_extra)

No description

uninstallRoutes($config, $package_name, array $package_extra)

No description

static 
buildRoute($route, $raw_route, $package_name)

No description

static 
validate(array $extra)

No description

Details

__construct(Composer $composer, IOInterface $io, Configuration $configuration, InstallerParameters $parameters, InstallerPersistenceInterface $persistence)

Driver constructor, just to ensure all pieces are in the right place

Parameters

Composer $composer
IOInterface $io
Configuration $configuration
InstallerParameters $parameters
InstallerPersistenceInterface $persistence

Composer getComposer()

Return Value

Composer

IOInterface getIo()

Return Value

IOInterface

Configuration getConfiguration()

Return Value

Configuration

InstallerParameters getParameters()

Return Value

InstallerParameters

void install(string $package_name, string $package_path, array $package_extra)

Install a package, processing all extra fields that it contains.

Parameters

string $package_name
string $package_path
array $package_extra

Return Value

void

void update(string $package_name, string $package_path, array $initial_extra, array $target_extra)

Update a package checking differences from it's initial and target extra fields.

Parameters

string $package_name
string $package_path
array $initial_extra
array $target_extra

Return Value

void

void uninstall(string $package_name, string $package_path, array $package_extra)

Uninstall package, removing all related extra fields.

Parameters

string $package_name
string $package_path
array $package_extra

Return Value

void

protected installRoutes($config, $package_name, array $package_extra)

Parameters

$config
$package_name
array $package_extra

protected uninstallRoutes($config, $package_name, array $package_extra)

Parameters

$config
$package_name
array $package_extra

static protected buildRoute($route, $raw_route, $package_name)

Parameters

$route
$raw_route
$package_name

static protected validate(array $extra)

Parameters

array $extra