Path manipulation library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anton Smirnov 21956c0788 Allow plugins 3 weeks ago
docs Fix VCS paths 11 months ago
src Helper classes doc 11 months ago
tests test PathUtils 11 months ago
.gitattributes Init package 11 months ago
.gitignore Docs stub 11 months ago
.gitlab-ci.yml GitLab CI 11 months ago
CHANGELOG.md Changelog for 1.0.0 11 months ago
LICENSE.md README, LICENSE, CHANGELOG 11 months ago
README.md README, LICENSE, CHANGELOG 11 months ago
composer.json Allow plugins 3 weeks ago
phpcs.xml Init package 11 months ago
phpunit.xml Update phpunit config 3 months ago
psalm.xml Init package 11 months ago

README.md

PHP Path Library

Packagist PHP License Gitlab pipeline status Codecov

A PHP library to work with absolute and relative paths.

Usage

<?php

use Arokettu\Path\PathUtils;
use Arokettu\Path\RelativePath;
use Arokettu\Path\UrlPath;

// simple interface

PathUtils::resolveRelativePath('/some/path', '../other/path');
// => /some/other/path
PathUtils::makeRelativePath('/some/path', '/some/other/path');
// => ../other/path

// OOP interface, more control

$url = UrlPath::parse('https://example.com/some/path');
$rel = RelativePath::unix('../other/path');
$url->resolveRelative($rel)->toString();
// => https://example.com/some/other/path

Installation

composer require arokettu/path

Documentation

Read full documentation here: https://sandfox.dev/php/path.html

Also on Read the Docs: https://php-path.readthedocs.io/

Support

Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/path/-/issues

License

The library is available as open source under the terms of the MIT License.