README, LICENSE, CHANGELOG
parent
b70f1fb0de
commit
a49fd421d0
|
@ -0,0 +1,7 @@
|
|||
# Changelog
|
||||
|
||||
## 1.0.0
|
||||
|
||||
*date*
|
||||
|
||||
Initial release
|
|
@ -0,0 +1,25 @@
|
|||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © 2021 Anton Smirnov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the “Software”), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,55 @@
|
|||
# PHP Path Library
|
||||
|
||||
[](https://packagist.org/packages/arokettu/path)
|
||||
[](https://packagist.org/packages/arokettu/path)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://gitlab.com/sandfox/php-path/-/pipelines)
|
||||
[](https://codecov.io/gl/sandfox/php-path/)
|
||||
|
||||
A PHP library to work with absolute and relative paths.
|
||||
|
||||
## Usage
|
||||
|
||||
```php
|
||||
<?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
|
||||
|
||||
```bash
|
||||
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].
|
||||
|
||||
[MIT License]: https://opensource.org/licenses/MIT
|
Loading…
Reference in New Issue