A Vito plugin that automatically fetches and manages available PHP extensions for PHP services.
This plugin provides automatic discovery of available PHP extensions for your PHP services. It listens for service installation events and fetches the available extensions from the system's package manager.
- Automatic Extension Discovery: Automatically fetches available PHP extensions when a PHP service is installed
- Safe Uninstall: Only removes extensions installed through this plugin, preserving pre-existing extensions
- Command Line Interface: Manual commands to fetch and uninstall extensions
- Event-Driven Architecture: Responds to service lifecycle events
- Extension Storage: Stores available extensions in the service's
type_datafield
Install the plugin by running the following command in your Vito application:
php artisan plugin:install https://github.com/arzola/extra-php-extensions.gitThe plugin will be automatically loaded by the application.
Once installed, enable the plugin from the Vito UI or CLI. On enable, it automatically fetches available extensions for all existing PHP services.
The plugin automatically fetches available extensions when a PHP service is installed through the event listener.
Use the Artisan command to manually fetch extensions:
# Fetch extensions for all PHP services
php artisan php-extensions:fetch
# Fetch extensions for a specific service
php artisan php-extensions:fetch 123On first fetch, the plugin takes a snapshot of already-installed extensions (extensions_before_plugin). This snapshot is used during uninstall to determine which extensions were installed through the plugin, ensuring pre-existing extensions are never removed.
When the plugin is disabled, it:
- Compares currently installed extensions against the initial snapshot
- Only removes extensions that were installed after the plugin was set up
- Cleans up all plugin-related data from
type_data(available_extensions,extensions_before_plugin)
php artisan plugin:disable arzola/extra-php-extensionsWhen a PHP service is uninstalled from a server, the plugin also cleans up any extensions that were installed through it, using the same snapshot-based comparison to protect pre-existing extensions.
| Event | Description |
|---|---|
service.installed |
Triggers php-extensions:fetch for the new service |
service.uninstalled |
Removes only plugin-installed extensions via apt-get remove |
php.extensions.list |
Enriches the extensions list with plugin-discovered available extensions |
| Command | Description |
|---|---|
php artisan php-extensions:fetch [service] |
Fetch available extensions for all or a specific PHP service |
php artisan php-extensions:uninstall |
Remove plugin-installed extensions and clean up metadata |