Skip to content

Commit 928193f

Browse files
committed
Updated CHANGELOG and README
1 parent 4dec6d8 commit 928193f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
* 2.3.0 (2015-12-17)
5+
6+
* added `Url::makeRelative()` for calculating relative paths between URLs
7+
* fixed `Path::makeRelative()` to trim leading dots when moving outside of
8+
the base path
9+
410
* 2.2.3 (2015-10-05)
511

612
* fixed `Path::makeRelative()` to produce `..` when called with the parent

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Latest release: [2.2.3](https://packagist.org/packages/webmozart/path-util#2.2.3
1313
PHP >= 5.3.3
1414

1515
This package provides robust, cross-platform utility functions for normalizing,
16-
comparing and modifying file paths.
16+
comparing and modifying file paths and URLs.
1717

1818
Installation
1919
------------
@@ -27,6 +27,8 @@ $ composer require webmozart/path-util:^2.2
2727
Usage
2828
-----
2929

30+
Use the `Path` class to handle file paths:
31+
3032
```php
3133
use Webmozart\PathUtil\Path;
3234

@@ -86,11 +88,16 @@ Path::getHomeDirectory();
8688
// => /home/webmozart
8789
```
8890

91+
Use the `Url` class to handle URLs:
92+
8993
```php
9094
use Webmozart\PathUtil\Url;
9195

92-
echo Url::makeRelative('http://example.com/webmozart/css/style.css', 'http://example.com/webmozart/puli');
96+
echo Url::makeRelative('http://example.com/css/style.css', 'http://example.com/puli');
9397
// => ../css/style.css
98+
99+
echo Url::makeRelative('http://cdn.example.com/css/style.css', 'http://example.com/puli');
100+
// => http://cdn.example.com/css/style.css
94101
```
95102

96103
Learn more in the [Documentation] and the [API Docs].

0 commit comments

Comments
 (0)