webignition/absolute-url-deriver
最新稳定版本:3.0
Composer 安装命令:
composer require webignition/absolute-url-deriver
包简介
Derives an absolute URL from relative and source URLs
关键字:
README 文档
README
Overview
Derives absolute URL from relative and source URLs.
Useful when:
- extracting full HREF URLs for links in a HTML document
- determining absolute new URL for a 301 redirect where the HTTP server returned a relative Location value
Usage
The "Hello World" example
<?php use webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver; use webignition\Uri\Uri; $base = 'https://example.com'; $relative = '/path?query#fragment'; $this->assertEquals( 'https://example.com/path?query#fragment', AbsoluteUrlDeriver::derive(new Uri($base), new Uri($relative)) );
Building
Using as a library in a project
If used as a dependency by another project, update that project's composer.json and update your dependencies.
"require": {
"webignition/absolute-url-deriver": ">=3,<4"
}
Developing
This project has external dependencies managed with composer. Get and install this first.
# Make a suitable project directory
mkdir ~/absolute-url-deriver && cd ~/absolute-url-deriver
# Clone repository
git clone git@github.com:webignition/absolute-url-deriver.git .
# Retrieve/update dependencies
composer install
Testing
Have look at the project on travis for the latest build status, or give the tests a go yourself.
cd ~/absolute-url-deriver
phpunit tests
统计信息
- 总下载量: 14.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 0
- 依赖项目数: 11
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-07-16