ghostwriter / root
Project root directory implementation in PHP
0.1.0
2026-07-13 17:02 UTC
Requires
- php: ~8.4.0 || ~8.5.0 || ~8.6.0
- ext-mbstring: *
Requires (Dev)
- ext-xdebug: *
- boundwize/structarmed: ^0.14.15
- ghostwriter/coding-standard: dev-main
- ghostwriter/phpunit-assertions: ^0.1.0
- ghostwriter/testify: ^0.1.2
- mockery/mockery: ^1.6.12
- phpunit/phpunit: ^13.2.4
README
Project root directory implementation in PHP
Installation
You can install the package via composer:
composer require ghostwriter/root
Star ⭐️ this repo if you find it useful
You can also star (🌟) this repo to find it easier later.
Usage
use Ghostwriter\Root\AbstractRootDirectory; $appRootDirectory = new readonly class('/tmp/app') extends AbstractRootDirectory {} // returns the absolute path to the root directory $appRootDirectory->toString(); // /tmp/app // returns the absolute path to the src directory $appRootDirectory->path('src'); // /tmp/app/src // returns the absolute path to the src/Foo/Bar.php file $appRootDirectory->path('src', 'Foo', 'Bar.php'); // /tmp/app/src/Foo/Bar.php
Credits
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
License
Please see LICENSE for more information on the license that applies to this project.
Security
Please see SECURITY.md for more information on security disclosure process.