2017 © Pedro Peláez
 

library tld-database

Database abstraction for Public Suffix List

image

layershifter/tld-database

Database abstraction for Public Suffix List

  • Monday, July 16, 2018
  • by LayerShifter
  • Repository
  • 1 Watchers
  • 18 Stars
  • 300,204 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 65 Versions
  • 21 % Grown

The README.md

DEPRECATED

Please use https://github.com/jeremykendall/php-domain-parser., (*1)

, (*2)

TLDDatabase

Packagist.org Build Status Code Climate codecov , (*3)

Abstraction layer for Public Suffix List in PHP. Used by TLDExtract., (*4)

Main idea of library provide easy and fast access to actual database of Public Suffix List. Library always supplied with actual database., (*5)

This package is compliant with PSR-1, PSR-2, PSR-4. If you notice compliance oversights, please send a patch via pull request., (*6)

Requirements

The following versions of PHP are supported:, (*7)

  • PHP 5.5
  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • HHVM

Basic usage

First of all you need load Store class., (*8)

$store = new \LayerShifter\TLDDatabase\Store();

For check existence of entry in database you need use isExists method:, (*9)

$store->isExists(string $suffix) : bool;

$store->isExists('com'); // true
$store->isExists('comcom'); // false

Note: suffix must be without leading dot., (*10)

For get type of suffix you need use getType method:, (*11)

For check existence of entry in database you need use isExists method:, (*12)

$store->isExists(string $suffix): int;

$store->getType('com'); // \LayerShifter\TLDDatabase\Store::TYPE_ICANN = 1
$store->getType('s3.amazonaws.com'); // \LayerShifter\TLDDatabase\Store::TYPE_PRIVATE = 2

If entry doesn't exists method will throw exception, else it will return one of integer constants: - \LayerShifter\TLDDatabase\Store::TYPE_ICANN; - \LayerShifter\TLDDatabase\Store::TYPE_PRIVATE;, (*13)

For direct check of type you can use isICANN or isPrivate method., (*14)

$store->isICANN(string $suffix) : bool;

$store->isICANN'com'); // true
$store->isICANN('s3.amazonaws.com'); // false

$store->isPrivate(string $suffix) : bool;

$store->isPrivate('com'); // false
$store->isPrivate('s3.amazonaws.com'); // true

Advanced usage

There are some cool features for developers., (*15)

Custom database

If you need operate with custom (non-packaged) database you simply need to add argument to Store constructor., (*16)

$store = new \LayerShifter\TLDDatabase\Store(string $filename);
$store = new \LayerShifter\TLDDatabase\Store(__DIR__ . '/cache/datatabase.php');

Update

If you use custom database you need update it :wink: So, you can use Update class., (*17)

$update = new \LayerShifter\TLDDatabase\Update(string $filename);
$update = new \LayerShifter\TLDDatabase\Update(__DIR__ . '/cache/datatabase.php');

$update->run();

HTTP-adapter

Basically library uses cURL adapter for updates, but you can use custom adapter., (*18)

class customHttp implements \LayerShifter\TLDDatabase\Http\AdapterInterface {
    public function get() {} 
}

$update = new \LayerShifter\TLDDatabase\Update(__DIR__ . '/cache/datatabase.php', 'customHttp');
$update->run();

Install

Via Composer, (*19)

``` bash $ composer require layershifter/tld-database, (*20)


## Testing ``` bash $ composer test

Versioning

Library uses SemVer versioning. Where: - major makes incompatible API changes; - minor adds functionality, fully backwards-compatible; - patch is update of database from Public Suffix List., (*21)

Database has every week update cycle., (*22)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*23)

License

This library is released under the Apache 2.0 license. Please see License File for more information., (*24)

The Versions

16/07 2018

dev-master

9999999-dev

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

16/07 2018

1.0.61

1.0.61.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

25/05 2018

1.0.60

1.0.60.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

13/05 2018

1.0.59

1.0.59.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

24/04 2018

1.0.58

1.0.58.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

14/04 2018

1.0.57

1.0.57.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

17/03 2018

1.0.56

1.0.56.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

11/03 2018

1.0.55

1.0.55.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

25/02 2018

1.0.54

1.0.54.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

29/01 2018

1.0.53

1.0.53.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

01/01 2018

1.0.52

1.0.52.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

18/11 2017

dev-chore/php7.2

dev-chore/php7.2

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

31/10 2017

1.0.51

1.0.51.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

11/09 2017

1.0.50

1.0.50.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

23/08 2017

1.0.49

1.0.49.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

13/08 2017

1.0.48

1.0.48.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

14/07 2017

1.0.47

1.0.47.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

26/06 2017

1.0.46

1.0.46.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

18/06 2017

1.0.45

1.0.45.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

16/06 2017

1.0.44

1.0.44.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

12/06 2017

1.0.43

1.0.43.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

14/04 2017

1.0.42

1.0.42.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

10/04 2017

1.0.41

1.0.41.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

05/04 2017

1.0.40

1.0.40.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

01/04 2017

1.0.39

1.0.39.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

06/03 2017

1.0.38

1.0.38.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

24/02 2017

1.0.37

1.0.37.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

07/02 2017

1.0.36

1.0.36.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

19/01 2017

1.0.35

1.0.35.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

10/01 2017

1.0.34

1.0.34.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

03/01 2017

1.0.33

1.0.33.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

28/12 2016

1.0.32

1.0.32.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

23/12 2016

1.0.31

1.0.31.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

17/12 2016

1.0.30

1.0.30.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

15/12 2016

dev-chore/cleanups

dev-chore/cleanups

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

12/12 2016

1.0.29

1.0.29.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

09/12 2016

1.0.28

1.0.28.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

05/12 2016

1.0.27

1.0.27.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

30/11 2016

1.0.26

1.0.26.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

28/11 2016

1.0.25

1.0.25.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

21/11 2016

1.0.24

1.0.24.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

12/11 2016

1.0.23

1.0.23.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

09/11 2016

1.0.22

1.0.22.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

05/11 2016

1.0.21

1.0.21.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

31/10 2016

1.0.20

1.0.20.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

24/10 2016

1.0.19

1.0.19.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

21/10 2016

1.0.18

1.0.18.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

17/10 2016

1.0.17

1.0.17.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

02/10 2016

1.0.16

1.0.16.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

27/08 2016

1.0.15

1.0.15.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

17/08 2016

1.0.14

1.0.14.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

08/08 2016

1.0.13

1.0.13.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

05/08 2016

1.0.12

1.0.12.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

01/08 2016

1.0.11

1.0.11.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

25/07 2016

1.0.10

1.0.10.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

20/07 2016

1.0.9

1.0.9.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

10/07 2016

1.0.8

1.0.8.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

08/07 2016

1.0.7

1.0.7.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

public suffix list psl domain database tld database

07/07 2016

1.0.6

1.0.6.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

03/07 2016

1.0.5

1.0.5.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

02/07 2016

1.0.4

1.0.4.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

30/06 2016

1.0.3

1.0.3.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

29/06 2016

1.0.2

1.0.2.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

23/06 2016

1.0.1

1.0.1.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov

16/06 2016

1.0.0

1.0.0.0

Database abstraction for Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Alexander Fedyashov