szepeviktor/package-path

Get installation path of any Composer package.

v0.3.0 2020-11-08 00:17 UTC

This package is auto-updated.

Last update: 2024-10-13 16:04:31 UTC


README

Build Status Packagist Version PHPStan

Get full installation path of any Composer package.

Installation

composer require szepeviktor/package-path

Usage

/** @var string|null $packagePath */
$packagePath = \SzepeViktor\Composer\PackagePath::get('phpstan/phpstan');

$vendorPath = \SzepeViktor\Composer\PackagePath::getVendorPath();
// returns "/full/path/to/vendor"

Credits

David Vander Elst https://stackoverflow.com/a/43543482