CakePHP Plugin Installer

A Composer plugin that makes your CakePHP application aware of plugins installed into vendor/.

Tool
Composer
v2.0.2
33stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
38/100Needs Attention
Development Activity24
Maintenance28
Community28
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture70
Code Quality80
Innovation74
Learning Curve85

CakePHP Plugin Installer is a Composer plugin that hooks into Composer’s autoload lifecycle so that CakePHP plugins installed via Composer are automatically registered with your application. Whenever composer install, update, or dumpautoload runs, it generates a cakephp-plugins.php manifest that maps each plugin package to its location on disk, and it injects PSR-4 autoload entries for any app-local plugins found under your configured plugin paths.

The result is that CakePHP can load Composer-managed and application plugins uniformly without any manual bootstrap wiring. Plugin authors only need to declare "type": "cakephp-plugin" in their composer.json, and applications can define multiple plugin paths through the extra.plugin-paths key.

What You Get

  • Automatic generation of a cakephp-plugins.php manifest mapping every installed plugin to its path
  • Custom Composer installer for the cakephp-plugin package type
  • PSR-4 autoload registration for application-local plugins discovered under configured plugin paths
  • Support for multiple plugin directories via the extra.plugin-paths configuration key
  • Manual regeneration through composer dumpautoload or the post-autoload-dump script

Common Use Cases

  • Installing third-party CakePHP plugins from Packagist and having them discovered without extra configuration
  • Structuring a CakePHP application with local plugins that autoload from a plugins/ directory
  • Organizing large applications across several plugin paths that all need consistent autoloading

Under The Hood

Architecture — The package is a single Cake\Composer\Plugin class in src/Plugin.php implementing Composer’s PluginInterface and EventSubscriberInterface. It subscribes to the pre-autoload-dump and post-autoload-dump events: the pre-dump handler scans each configured plugin path (defaulting to plugins), discovers app plugins via a DirectoryIterator, and adds PSR-4 autoload/dev-autoload namespace-to-path entries onto the root package; the post-dump handler writes the generated cakephp-plugins.php manifest mapping every cakephp-plugin package to its resolved directory. Paths are normalized to be relative to the application root so the manifest stays portable.

Tech Stack — Pure PHP targeting php >=8.1 with composer-plugin-api ^2.0 as its only runtime dependency. Development tooling includes PHPUnit (10–13), the CakePHP CodeSniffer ruleset (phpcs), and PHPStan for static analysis, all wired through composer scripts.

Code Quality — The codebase uses declare(strict_types=1), typed signatures, and interface-driven design. It ships a PluginTest test case under tests/TestCase/, a phpunit.xml.dist, a phpcs config, and a phpstan.neon, indicating consistent linting and static-analysis enforcement despite the small surface area.

API Design — There is effectively no public API to call; integration is declarative. Plugin authors set "type": "cakephp-plugin" and applications optionally set extra.plugin-paths, after which everything happens transparently during Composer runs. This zero-boilerplate contract keeps the developer experience minimal and hard to misuse.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search