Interfaces for writing setup logic when installing extensions. This package provides standardized contracts that define how extensions should be installed, updated, or removed in a consistent and predictable manner.
To install and use this package, we recommend using Composer:
composer require imponeer/extensions-setup-contracts
Alternatively, you can manually include files from the src/
directory, though this approach is not recommended.
Here's a basic example of how to implement the contracts:
use Imponeer\Contracts\ExtensionsSetup\InstallableExtensionInterface;
use Imponeer\Contracts\ExtensionsSetup\SetupStepInterface;
use Imponeer\Contracts\ExtensionInfo\ExtensionInfoInterface;
use Imponeer\Decorators\LogDataOutput\OutputDecorator;
// Implement an installable extension
class MyExtension implements InstallableExtensionInterface
{
public function getExtensionInfo(): ExtensionInfoInterface
{
// Return extension information
return new MyExtensionInfo();
}
}
// Implement a setup step
class DatabaseSetupStep implements SetupStepInterface
{
public function __construct(?OutputDecorator $output)
{
// Initialize with optional output decorator for logging
}
public function execute(InstallableExtensionInterface $extension, array $params): bool
{
// Perform database setup logic
return true;
}
}
This section describes the development-related Composer commands available for this project.
composer phpcs
composer phpcbf
composer phpstan
Detailed API documentation is available in the project wiki. This documentation is automatically updated whenever changes are made to the codebase.
If you want to add functionality or fix bugs, you can fork the repository, make your changes, and create a pull request.
If you find any bugs or have questions, please use the issues tab to report them.