PackageManifest
class PackageManifest extends PackageManifest
Properties
| Filesystem | $files | The filesystem instance. |
from PackageManifest |
| string | $basePath | The base path. |
from PackageManifest |
| string | $vendorPath | The vendor path. |
from PackageManifest |
| string|null | $manifestPath | The manifest path. |
from PackageManifest |
| array|null | $manifest | The loaded manifest array (filtered by runtime ignore list). |
from PackageManifest |
| protected array|null | $rawManifest | The raw manifest loaded from cache or built from installed.json. |
from PackageManifest |
| static protected array<int, string> | $packagesToIgnore | Packages that should be ignored during discovery. |
from PackageManifest |
| protected object|null | $testbench | The current testbench instance. |
|
| protected array<int, string> | $requiredPackages | Packages that must remain discoverable when discovery is disabled. |
Methods
Create a new package manifest instance.
Get all of the service provider class names for all packages.
Get all of the values for all packages for the given configuration name.
Get the cached version string for a package.
Determine if a package satisfies a version constraint.
Get the current package manifest.
Discover installed Hypervel package metadata.
Format the given package name with the given vendor path.
Get the package names ignored by root composer metadata.
Get a root Composer extra.hypervel value.
Get the packages that should be ignored during manifest build.
Set packages that should be ignored during discovery.
Write the given manifest array to disk.
Swap the application binding to the Testbench package manifest.
Set the current testbench instance.
Require packages even when discovery is disabled.
Get the root package discovery configuration.
Get the root package composer metadata.
Details
at line 37
__construct(Filesystem $files, string $basePath, string|null $manifestPath, object|null $testbench = null)
Create a new package manifest instance.
in
PackageManifest at line 73
array
providers()
Get all of the service provider class names for all packages.
in
PackageManifest at line 81
array
aliases()
Get all of the aliases for all packages.
in
PackageManifest at line 89
array
config(string $key)
Get all of the values for all packages for the given configuration name.
in
PackageManifest at line 104
string|null
version(string $package)
Get the cached version string for a package.
Returns the version from the manifest cache, avoiding runtime Composer API calls. Useful for feature gating and compatibility checks in application and package code.
in
PackageManifest at line 114
bool
hasPackage(string $package)
Determine if the given package is installed.
in
PackageManifest at line 130
bool
satisfies(string $package, string $constraint)
Determine if a package satisfies a version constraint.
Uses Composer's semver constraint parser for full constraint support (e.g., "^2.0", ">=1.5 <3.0", "~4.1").
Requires composer/semver package. Add it to your project:
composer require composer/semver
at line 92
protected array
getManifest()
Get the current package manifest.
in
PackageManifest at line 190
static array
discoverInstalledPackages(Filesystem $files, string $vendorPath, array $baseIgnore)
Discover installed Hypervel package metadata.
in
PackageManifest at line 231
void
build()
Build the manifest and write it to disk.
in
PackageManifest at line 248
protected string
format(string $package)
Format the given package name.
in
PackageManifest at line 256
static protected string
formatPackageName(string $package, string $vendorPath)
Format the given package name with the given vendor path.
in
PackageManifest at line 266
static array
packagesToIgnoreFromComposer(Filesystem $files, string $basePath)
Get the package names ignored by root composer metadata.
in
PackageManifest at line 276
static mixed
rootHypervelExtra(Filesystem $files, string $basePath, string $key)
Get a root Composer extra.hypervel value.
at line 122
protected array
packagesToIgnore()
Get the packages that should be ignored during manifest build.
in
PackageManifest at line 323
static void
ignorePackageDiscoveriesFrom(array $packages)
Set packages that should be ignored during discovery.
Used by testbench to suppress package discovery at runtime without modifying the project's composer.json.
Boot or tests only. The list persists in a static property used during package discovery; runtime use has no effect on already-discovered providers.
at line 167
protected void
write(array $manifest)
Write the given manifest array to disk.
in
PackageManifest at line 348
static void
flushState()
Flush all static state.
at line 51
static void
swap(Application $app, object|null $testbench = null)
Swap the application binding to the Testbench package manifest.
at line 72
void
setTestbench(object|null $testbench)
Set the current testbench instance.
at line 80
PackageManifest
requires(string ...$packages)
Require packages even when discovery is disabled.
at line 133
protected array
providersFromRoot()
Get the root package discovery configuration.
at line 151
protected array|null
providersFromTestbench()
Get the root package composer metadata.