Skip to content

switon-php/composer-extra

Repository files navigation

Switon Composer Extra Package

CI PHP 8.3+

Switon's Composer plugin and runtime reader for cached extra metadata.

Highlights

  • Cached package metadata: composer install and update keep one shared metadata cache current.
  • Runtime access: ComposerExtraInterface reads discovery data without extra parsing.
  • Discovery support: extra.switon.* can feed providers, commands, listeners, tasks, and jobs.
  • Automatic refresh: the Composer plugin keeps the cache fresh.
  • Safe health checks: cache status can be checked without throwing.

Installation

composer require switon/composer-extra

Quick Start

use Switon\ComposerExtra\ComposerExtraInterface;
use Switon\Core\Attribute\Autowired;

final class PackageRegistry
{
    #[Autowired] protected ComposerExtraInterface $composerExtra;

    public function listeners(): array
    {
        return $this->composerExtra->collect('switon.listeners');
    }

    public function cacheHealth(): array
    {
        return $this->composerExtra->health();
    }
}

Docs: https://docs.switon.dev/latest/composer-extra

License

MIT.

About

Cached Composer extra metadata reader for fast framework discovery at runtime for Switon Framework

Topics

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages