rzuw/lyra-url

A simple URL toolkit for Lyra


Keywords
lyra, php-curl
License
MIT

Documentation

Lyra URL

This library can be used to work with URLs in a PHP application. It is very simple and has limited functionality but helps you with repetitive task with the URLs.

Requirements

The following php extension are required to make this library work:

php-curl
php-mbstring

Configuration

This application accept proxy settings for configuration. Both Download and Check command can be used with the proxy option. By default they don't use proxies for queries to the given server. The configuration should be an array with the following parameters, the values with star are mandatory:

proxy_setting:
    host: your-hostname *
    port: your-port *
    auth: your-auth-settings (username:password)
    type: http

For the proxy type you can use one of the following:

http
http1
socks4
socks4a
socks5
socks5h

Usage

This library can be used like any other lyra library. Add the it to your composer.json

composer require rzuw/lyra-url
composer update

Then create an instance of this library with:

$url = new URL($config, $logger);
$res = $url->check("google.com"); // Checks if the google is available:)

Testing

To test this library you need phpunit installed on your machine. All test files are located in tests directory.

cd your-local-copy
export PROXY_HOST=""
export PROXY_PORT=""
export PROXY_TYPE=""
export PROXY_AUTH=""
phpunit

Contribution

This package is mirrored on Github, pull request are accepted, but can be only manually merged with the code base. Maybe with this Phabricator task implemented, we are going to be able to merge your commits automatically.

Change log

See CHANGELOG file.

License

See LICENSE file.

TODO

  • Write test cases for the download, headers and info
  • Add more examples of usage to the Documentation