konsulting / project-root
A simple package to determine the working root directory for a composer dependency
Installs: 499 583
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.0 | ^6.0 | ^7.0
This package is auto-updated.
Last update: 2024-11-16 21:29:30 UTC
README
A simple package to help with resolving paths when working in a composer package.
Specifically, for some functionality you may need to refer to the packages root directory, but then need to use the project's root when the package is included as a dependency.
Rather than keep repeating dirty logic from before, we can use this package.
Installation
composer require konsulting/package-root
Usage
<?php \Konsulting\ProjectRoot::forPackage('package-name')->resolve(__DIR__);
Contributing
Contributions are welcome and will be fully credited. We will accept contributions by Pull Request.
Please:
- Use the PSR-2 Coding Standard
- Add tests, if you’re not sure how, please ask.
- Document changes in behaviour, including readme.md.
Testing
We use PHPUnit
Run tests using PHPUnit: vendor/bin/phpunit