Download the PHP package blobfolio/blob-domain without Composer

On this page you can find all versions of the php package blobfolio/blob-domain. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blob-domain

blob-domain

blob-domain is a simple PHP library for parsing and validating domain names. It supports the full Public Suffix ruleset, translates Unicode to ASCII or vice versa (if the PHP extension INTL is present), and can break down a host into its constituent parts: subdomain, domain, and suffix.

Build Status

 

Table of Contents

  1. Requirements
  2. Installation
  3. Reference
    • ::parse_host()
    • ::parse_host_parts()
    • is_valid()
    • is_ascii()
    • is_fqdn()
    • is_ip()
    • is_unicode()
    • has_dns()
    • strip_www()
  4. License

 

Requirements

blob-domain and its dependencies require PHP 7.0+ with the following modules:

 

Installation

Use Composer:

 

Reference

First up, the basics.

Basic Usage:

 

The following static methods exist if you don't want to initialize an object.

::parse_host()

Parse the hostname part of an arbitrary string, which might be a hostname, IP address, URL, etc.

Note: this will convert Unicode to ASCII.

Arguments

Returns

Returns the processed hostname or FALSE on failure.

Example

::parse_host_parts()

Pull out the different parts of a host name, i.e. what you'd get running get_data() on a domain object.

Note: this will convert Unicode to ASCII.

Arguments

Returns

Returns an array containing the processed parts or FALSE on failure.

Example

 

The object also comes with public methods. Aside from the various get_*() functions already demonstrated, you've got the following.

is_valid()

Is the host valid? This will be TRUE unless:

Arguments

Returns

Returns TRUE or FALSE.

is_ascii()

Whether or not a host is ASCII, like google.com. Unicode domains are still a bit unknown in many parts of the Western world and can cause problems with native PHP functions or databases, so good to know what you've got.

Note: IP addresses are considered ASCII for the purposes of this function.

Note: The various get_*() functions will always return the host in ASCII format by default. Passing TRUE to those functions will return Unicode hosts in their original Unicode, e.g. ☺.com.

Arguments

N/A

Returns

Returns TRUE or FALSE.

Example

is_fdqn()

Checks to see whether the host is a Fully-Qualified Domain Name (or at least a public IP address). In other words, can it be seen by the outside world?

Note: this does not imply the host actually exists.

Arguments

N/A

Returns

Returns TRUE or FALSE.

is_ip()

Is the host an IP address?

Arguments

Returns

Returns TRUE or FALSE.

is_unicode()

Whether or not a host is Unicode, like ☺.com. Unicode hosts can cause problems with native PHP functions and databases, so might be a good thing to know.

Note: The various get_*() functions will return an ASCIIfied version of a Unicode domain by default, like xn--74h.com. Passing TRUE will de-convert them back to the original Unicode.

Arguments

N/A

Returns

Returns TRUE or FALSE.

Example

has_dns()

Does this host have an A record in its DNS table or is it a public IP address?

Note: the A record cannot point to a restricted/reserved IP like 127.0.0.1 or the function will return FALSE.

Arguments

N/A

Returns

Returns TRUE or FALSE.

strip_www()

This removes the leading www. subdomain, if any, from the parsed result. You can also have this run automatically at initialization by passing a second argument to the constructor, TRUE.

Arguments

N/A

Returns

Returns TRUE or FALSE, indicating whether or not a change was made.

Example

 

License

Copyright © 2018 Blobfolio, LLC <[email protected]>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

Donations

Bitcoin QR If you have found this work useful and would like to contribute financially, Bitcoin tips are always welcome!

1Af56Nxauv8M1ChyQxtBe1yvdp2jtaB1GF

All versions of blob-domain with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.0
ext-filter Version *
ext-mbstring Version *
ext-json Version *
ext-intl Version *
blobfolio/blob-common Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blobfolio/blob-domain contains the following files

Loading the files please wait ....