rev / sway-framework-distribution
SwayFramework Distribution Component
Installs: 25
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:sf-package
Requires
- symfony/yaml: ^3.2
This package is not auto-updated.
Last update: 2025-03-12 01:42:35 UTC
README
This component helps to manage swayframework and vendor packages. It also provides a feature to manage configuration around packages and app.
Installation
This package is bundled with swayframework.
composer require rev/sway-framework-distribution
This will install package at latest version.
Usage
<?php use Sway\Distribution\FrameworkDistribution; /** * Points to application root directory. */ $applicationDirectoryRootPath = dirname(__DIR__); /** * Inits framework distribution. */ $frameworkDistribution = new FrameworkDistribution($applicationDirectoryRootPath); ?>
Please remember that subdirectory tmp must exists in your app directory. It will not be created if not exists.
Built-in services
Distribution component comes with built-in services (of course if service component is available).
List of all built-in services:
-
Service: 'distribution_storage'
Class: Sway\Distribution\Storage\StorageDriver
Description: Storage driver - vendor's packages and application cache -
Service: 'distribution_class_founder'
Class: Sway\Distribution\Mapping\ClassFounder
Description: Application class map -
Service: 'distribution_extension_manager'
Class: Sway\Distribution\Extension\ExtensionManager
Description: 'sf-package' libraries manager
For defaults, built-in services are not registered. If framework kernel is initialized and service and parameter component are available, you can call method initDistribution to register built-in services.
$frameworkDistribution->initDistribution();
You can also initialize a interface to framework as service (service: framework):
$frameworkDistribution->initializeFrameworkService($array_with_parameters);