2017 © Pedro Peláez
 

library spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

image

bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  • Thursday, September 17, 2015
  • by bickmista
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2,572 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

Spurl Build Status version Code Climate

A URL manipulation library, (*1)

Description

A PHP Library that can break down and build URLs into/from an array., (*2)

Implementations

Current

  • Breakdown URLs
  • Build up URLs

Planned

  • Replace segments before build
  • Shuffle segments before build (e.g. swap host.domain with path.2)

Requirements

  • PHP 5.4+

Installation

Using Composer

To install Spurl with Composer, just add the following to your composer.json file, (*3)

{
    "require": {
        "bickmista/spurl": "0.*"
    }
}

or by running the following command:, (*4)

composer require bickmista/spurl

Usage

General

Shatter

To break down a URL into segments pass it into our shatter function., (*5)

$url = 'http://test.com/example/path?some=query#anchor';

$splitUrl = Spurl\Url::shatter($url);

The output from the shatter function in the example above would be, (*6)

$splitUrl = [
  'protocol' => 'http',
  'host' => 'test.com',
  'path' => 'example/path',
  'query' => 'some=query',
  'anchor' => 'anchor'
];

You can also break down URLs further by passing true as an optional second parameter, (*7)

$url = 'http://test.com/';

$splitUrl = Spurl\Url::shatter($url, true);

which would return, (*8)

$splitUrl = [
  'protocol' => 'http',
  'host' => [
    'domain' => 'test',
    'suffix' => 'com'
  ]
];

The Versions

17/09 2015

dev-master

9999999-dev https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

17/09 2015

dev-development

dev-development https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

17/09 2015

0.3.1

0.3.1.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

17/09 2015

dev-feature/add_exceptions

dev-feature/add_exceptions https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

17/09 2015

0.3.0

0.3.0.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

16/08 2015

0.2.0

0.2.0.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

url

16/08 2015

0.1.3

0.1.3.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

url

13/08 2015

0.1.2

0.1.2.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

url

12/08 2015

0.1.1

0.1.1.0 https://github.com/bickmista/spurl

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

url

12/08 2015

0.0.1

0.0.1.0 https://github.com/bickmista/spurl

Spurl url manipulator

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-json *

 

url