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-12-13 16:25:20 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