2017 © Pedro Peláez
 

library url

Makes working with URLs easier

image

noccylabs/url

Makes working with URLs easier

  • Monday, July 14, 2014
  • by noccy80
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

URL

Installing

With composer:, (*1)

    $ composer require noccylabs/url:0.1.*

Using

To canonize URLs

If you have an input URL that may not be fully canonized, pass it through the Url::canonizeUrl() static method:, (*2)

    $ugly = "google.com";
    $pretty = Url::canonizeUrl($ugly, "https");
    echo $pretty; // <- https://google.com

To apply partial URLs to base URLs

If you are crawling a page, this can be used to find the appropriate linked resource names from the document:, (*3)

    $base = new Url("http://www.domain.tld/some/page.html");
    $image = "../image.jpg";
    $image_url = $base->apply($image)->getUrl();
    echo $image_url; // <- http://www.domain.tld/image.jpg

To create and manipulate URLs

    $url = new Url();
    $url->setHost("google.com");
    $qs = new QueryString();
    $qs->set("q", "Hello World");
    $url->query = $qs;
    echo $url; // <- http://google.com?q=Hello%20World

The Versions

14/07 2014

dev-master

9999999-dev

Makes working with URLs easier

  Sources   Download

GPL-3.0

by Christopher Vagnetoft

14/07 2014

0.1.1

0.1.1.0

Makes working with URLs easier

  Sources   Download

GPL-3.0

by Christopher Vagnetoft

29/06 2014

0.1.0

0.1.0.0

Makes working with URLs easier

  Sources   Download

GPL-3.0

by Christopher Vagnetoft