VendorDirResolver
API reference › Scaffold › Config › VendorDirResolver
Resolves the Composer vendor directory of a project from COMPOSER_VENDOR_DIR, then config.vendor-dir in the
project manifest (composer.json, or the file named by COMPOSER), then <project-root>/vendor.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
manifestName() static | Returns the file name of the project manifest: the COMPOSER environment variable when set, otherwise composer.json. | VendorDirResolver |
manifestPath() static | Returns the absolute path of the project manifest named by VendorDirResolver::manifestName(). | VendorDirResolver |
resolve() static | Returns the absolute path to the vendor directory for the project rooted at $projectRoot. | VendorDirResolver |
Method details
Section titled “Method details”manifestName()
Section titled “manifestName() ”public static function manifestName(): stringReturns the file name of the project manifest: the COMPOSER environment variable when set, otherwise
composer.json.
Returns
string: Manifest file name, relative to the project root unless the COMPOSER value is absolute.
manifestPath()
Section titled “manifestPath() ”public static function manifestPath(string $projectRoot): stringReturns the absolute path of the project manifest named by VendorDirResolver::manifestName().
Parameters
| Parameter | Type | Description |
|---|---|---|
$projectRoot | string | Absolute path to the project root directory. |
Returns
string: Absolute path of the project manifest.
resolve()
Section titled “resolve() ”public static function resolve(string $projectRoot, string|null $configured = null): stringReturns the absolute path to the vendor directory for the project rooted at $projectRoot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$projectRoot | string | Absolute path to the project root directory. |
$configured | string| | config.vendor-dir of the project manifest, or null when unset. |
Returns
string: Absolute path to the resolved vendor directory.