wikimedia/relpath
Compute a relative filepath between two paths.
1.0.3
2015-09-29 21:17 UTC
Requires
- php: >=5.3.3
Requires (Dev)
- jakub-onderka/php-parallel-lint: ^0.9.0.0
- phpunit/phpunit: ^4.8.9.0
- mediawiki/mediawiki-codesniffer: ^0.4.0.0
README
RelPath is a small PHP library for computing a relative filepath to some path, either from the current directory or from an optional start directory.
Here is how you use it:
$relPath = RelPath\getRelativePath( '/srv/mediawiki/resources/src/startup.js', '/srv/mediawiki' ); // Result: string(24) "resources/src/startup.js" $fullPath = RelPath\joinPath( '/srv/mediawiki', 'resources/src/startup.js' ); // Result: string(39) "/srv/mediawiki/resources/src/startup.js"
License
MIT