Skip to content

Commit

Permalink
V3 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
webignition authored Jan 9, 2019
1 parent eb31641 commit edfe940
Show file tree
Hide file tree
Showing 6 changed files with 491 additions and 329 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sudo: false
language: php
php:
- 7.2
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ Usage

```php
<?php
$deriver = new \webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver(
'/server.php?param1=value1',
'http://www.example.com/pathOne/pathTwo/pathThree'
);
use webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver;
use webignition\Uri\Uri;

$base = 'https://example.com';
$relative = '/path?query#fragment';

$this->assertEquals('http://www.example.com/server.php?param1=value1', $deriver->getAbsoluteUrl());
$this->assertEquals(
'https://example.com/path?query#fragment',
AbsoluteUrlDeriver::derive(new Uri($base), new Uri($relative))
);
```

Building
Expand All @@ -35,7 +39,7 @@ If used as a dependency by another project, update that project's composer.json
and update your dependencies.

"require": {
"webignition/absolute-url-deriver": "*"
"webignition/absolute-url-deriver": ">=3,<4"
}

#### Developing
Expand All @@ -46,10 +50,10 @@ This project has external dependencies managed with [composer][3]. Get and insta
mkdir ~/absolute-url-deriver && cd ~/absolute-url-deriver

# Clone repository
git clone [email protected]:webignition/absolute-url-deriver.git.
git clone [email protected]:webignition/absolute-url-deriver.git .

# Retrieve/update dependencies
composer.phar install
composer install

Testing
-------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require": {
"php": ">=7.2",
"webignition/url": "^2"
"webignition/uri": ">=0.3,<1"
},
"require-dev": {
"phpunit/phpunit": "^7",
Expand Down
Loading

0 comments on commit edfe940

Please sign in to comment.