PHPackages                             valksor/php-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. valksor/php-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

valksor/php-plugin
==================

Composer plugin providing automatic recipe processing for PHP packages, similar to Symfony Flex

00PHPCI passing

Since Jan 9Pushed 3mo agoCompare

[ Source](https://github.com/valksor/php-plugin)[ Packagist](https://packagist.org/packages/valksor/php-plugin)[ RSS](/packages/valksor-php-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Valksor PHP Plugin
==================

[](#valksor-php-plugin)

[![valksor](https://camo.githubusercontent.com/2af5a6a7e5f7da47cd0a924c8b00038f208f45f9b0d5be8d7a497a9808168187/68747470733a2f2f62616467656e2e6e65742f7374617469632f6f72672f76616c6b736f722f677265656e)](https://github.com/valksor)[![BSD-3-Clause](https://camo.githubusercontent.com/72547f8afb6b5ace804caebbf95c3bcbfc027ce9214777bc452f308f3165db01/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4253442d2d332d2d436c617573652d677265656e3f7374796c653d666c6174)](https://github.com/valksor/php-plugin/blob/master/LICENSE)[![Coverage Status](https://camo.githubusercontent.com/f1f3779c7d8a7c73b4e01a09d044ed99fb2c4d94d47a13f3ff12291f97588336/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f76616c6b736f722f7068702d706c7567696e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/valksor/php-plugin?branch=master)[![php](https://camo.githubusercontent.com/77da2f7bbc049873edb2d1045a756d7a32e3ba50440a8e0e76a9109f62f0771b/68747470733a2f2f62616467656e2e6e65742f7374617469632f7068702f2533453d382e342f707572706c65)](https://www.php.net/releases/8.4/en.php)

A Composer plugin that provides automatic recipe processing for PHP packages, similar to [Symfony Flex](https://symfony.com/doc/current/components/flex.html). It automatically discovers and applies local recipes from package directories when packages are installed, updated, or uninstalled. This plugin is part of the Valksor ecosystem and enables seamless package configuration management for PHP applications.

⚠️ **Composer 2.2+ Security Requirement**: You must explicitly allow this plugin in your `composer.json` for it to work.

Installation
------------

[](#installation)

```
composer require valksor/php-plugin
composer config allow-plugins.valksor/php-plugin true
```

Add to `composer.json`:

```
{
    "config": {
        "allow-plugins": {
            "valksor/php-plugin": true
        }
    },
    "extra": {
        "valksor": {
            "allow": "*"
        }
    }
}
```

Features
--------

[](#features)

- **Automatic Recipe Discovery**: Automatically finds and processes local recipes in package directories during Composer operations
- **Symfony Flex Compatibility**: Built on top of Symfony Flex's configurator system with full recipe format compatibility
- **Event-Driven Processing**: Hooks into Composer's package lifecycle events (install, update, uninstall) for seamless automation
- **Local Recipe Focus**: Specifically designed for local recipe discovery within package directories
- **Manual Recipe Management**: Provides commands for manual recipe installation and removal when needed
- **Configuration Flexibility**: Supports both wildcard and package-specific recipe permissions
- **Lock File Integration**: Uses Symfony Flex's symfony.lock file for proper recipe tracking and cleanup
- **Duplicate Prevention**: Intelligent handling of package aliases to prevent duplicate processing
- **Override Support**: Configurable recipe override capabilities for development environments

Usage
-----

[](#usage)

The plugin automatically processes recipes when packages are installed. For manual control:

```
# Install recipes for all packages
composer valksor:install

# Install recipe for specific package
composer valksor:install vendor/package

# Remove recipe for specific package
composer valksor:uninstall vendor/package
```

Configuration
-------------

[](#configuration)

### Complete Configuration

[](#complete-configuration)

```
{
    "config": {
        "allow-plugins": {
            "valksor/php-plugin": true,
            "symfony/flex": true
        }
    },
    "extra": {
        "valksor": {
            "allow": "*"
        }
    }
}
```

### Configuration Options

[](#configuration-options)

- **`config.allow-plugins.valksor/php-plugin: true`** - Required for Composer 2.2+
- **`extra.valksor.allow: "*"`** - Allow all packages to have recipes processed
- **`extra.valksor.allow: {"vendor/package": {}}`** - Allow only specific packages
- **`extra.valksor.allow: {"vendor/package": {"allow_override": true}}`** - Allow recipe overrides

Recipe Format
-------------

[](#recipe-format)

Uses the same recipe format as Symfony Flex. See [Symfony Flex Recipe Documentation](https://symfony.com/doc/current/components/flex/recipes.html).

### Basic Structure

[](#basic-structure)

```
vendor/package/
    recipe/
        manifest.json
        config/
            packages.yaml
        public/
        src/

```

### Example manifest.json

[](#example-manifestjson)

```
{
    "bundles": {
        "Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
    },
    "copy-from-recipe": {
        "config/": "%CONFIG_DIR%/"
    },
    "env": {
        "DATABASE_URL": "mysql://user:pass@127.0.0.1:3306/db_name"
    }
}
```

Advanced Usage
--------------

[](#advanced-usage)

### Selective Recipe Processing

[](#selective-recipe-processing)

Configure which packages are allowed to have recipes processed:

```
{
    "extra": {
        "valksor": {
            "allow": {
                "my-vendor/core-package": {},
                "my-vendor/optional-package": {
                    "allow_override": true
                },
                "external-vendor/package": {}
            }
        }
    }
}
```

### Development Environment with Overrides

[](#development-environment-with-overrides)

Enable recipe overrides for frequent development updates:

```
{
    "extra": {
        "valksor": {
            "allow": {
                "my-vendor/dev-package": {
                    "allow_override": true
                }
            }
        }
    }
}
```

### Custom Recipe Development

[](#custom-recipe-development)

Create recipes for your packages following this structure:

```
your-package/
    composer.json
    src/
        YourCode.php
    recipe/
        manifest.json
        config/
            packages.yaml
        templates/
            some_template.php.twig

```

**manifest.json with multiple features**:

```
{
    "bundles": {
        "YourVendor\\YourBundle\\YourBundle": ["all"]
    },
    "copy-from-recipe": {
        "config/": "%CONFIG_DIR%/",
        "templates/": "%TEMPLATES_DIR%/"
    },
    "env": {
        "YOUR_SERVICE_URL": "https://api.example.com",
        "YOUR_API_KEY": "your-api-key-here"
    },
    "post-install-output": [
        "  ✓ Your package has been configured",
        "    Update your .env file with the API key"
    ]
}
```

Troubleshooting
---------------

[](#troubleshooting)

IssueCauseSolutionPlugin blockedComposer 2.2+ security feature`composer config allow-plugins.valksor/php-plugin true`Recipes not processingPlugin not allowed or not configuredCheck `composer config allow-plugins` and `extra.valksor` settingsRecipe not foundPackage has no recipe directoryContact package maintainer or create custom recipe### Debug Commands

[](#debug-commands)

```
# Check plugin status
composer show valksor/php-plugin
composer config allow-plugins | grep valksor
composer list | grep valksor

# Manual recipe processing
composer valksor:install vendor/package
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please follow these guidelines:

### Development Setup

[](#development-setup)

1. **Clone the repository**:

    ```
    git clone https://github.com/valksor/php-plugin.git
    cd php-plugin
    ```
2. **Install dependencies**:

    ```
    composer install
    ```
3. **Run tests**:

    ```
    vendor/bin/phpunit
    ```

### Pull Request Guidelines

[](#pull-request-guidelines)

- **PSR-12 Coding Standards**: Ensure code follows PSR-12 standards
- **Tests**: Include tests for new features
- **Documentation**: Update README and docblocks as needed
- **Commits**: Use clear, descriptive commit messages
- **Branching**: Create feature branches from `master`

### Code Quality

[](#code-quality)

All code must pass:

- **PHPUnit tests** with 100% coverage where possible
- **PHP-CS-Fixer** code style checks (config file can be found in [valksor-dev](https://github.com/valksor/php-dev))

### Reporting Issues

[](#reporting-issues)

Please use [GitHub Issues](https://github.com/valksor/php-plugin/issues) to report bugs or request features. Include:

- PHP and Composer versions
- Steps to reproduce
- Expected vs actual behavior
- Example configuration if applicable

Security
--------

[](#security)

If you discover a security vulnerability, please send an email to  instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

Support
-------

[](#support)

- **Documentation**: [Full documentation](https://github.com/valksor/php-plugin)
- **Issues**: [GitHub Issues](https://github.com/valksor/php-plugin/issues) for bug reports and feature requests
- **Discussions**: [GitHub Discussions](https://github.com/orgs/valksor/discussions/categories/php-plugin) for questions and community support

Credits
-------

[](#credits)

- **Original Author**: [Davis Zalitis (k0d3r1s)](https://github.com/k0d3r1s)
- **Maintainer**: [SIA Valksor](https://valksor.com)
- **All Contributors**: [Contributors list](https://github.com/valksor/php-plugin/graphs/contributors)

This plugin is inspired by and built upon [Symfony Flex](https://symfony.com/doc/current/components/flex.html), providing enhanced local recipe discovery capabilities for the Valksor ecosystem.

Requirements
------------

[](#requirements)

- **PHP 8.4 or higher**
- **Composer 2.0 or higher**
- **Symfony Flex** (as dependency)

License
-------

[](#license)

This package is part of the Valksor package. See the [LICENSE](LICENSE) file for copyright information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance53

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4db85e32518c5a6caa2fd625032a2b016ef42d60cf8a101c165cc5c0048b221?d=identicon)[k0d3r1s](/maintainers/k0d3r1s)

---

Top Contributors

[![k0d3r1s](https://avatars.githubusercontent.com/u/38725938?v=4)](https://github.com/k0d3r1s "k0d3r1s (76 commits)")

---

Tags

composer-pluginflexphpsymfonyvalksor

### Embed Badge

![Health badge](/badges/valksor-php-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/valksor-php-plugin/health.svg)](https://phpackages.com/packages/valksor-php-plugin)
```

###  Alternatives

[ashallendesign/laravel-executor

Configurable code that can be ran when installing or updating your web app.

2573.0k](/packages/ashallendesign-laravel-executor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
