2017 © Pedro Peláez
 

library smartdata

Data from Open Data providers compiled into easy to use PHP objects

image

smartdata/smartdata

Data from Open Data providers compiled into easy to use PHP objects

  • Monday, March 6, 2017
  • by smartdata
  • Repository
  • 2 Watchers
  • 9 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

, (*1)

Build Status StyleCI Scrutinizer Code Quality Code Coverage Code Climate Latest Stable Version , (*2)

Data from Open Data providers compiled into easy to use PHP objects Edit, (*3)

  1. Features
  2. Sources
  3. Requirements
  4. Installation
  5. Country
  6. Region

Features

  • Multiple languages (Currently only supports English, French and German).
  • Country Database
  • Region Database (Currently only for Canada and the United States).

Sources

Requirements

This library does not require a database, but instead, uses JSON files., (*4)

This library uses PHP 5.6+., (*5)

Installation

You need to install the library through composer. To do so, use the following command, (*6)

composer require geobase/countries

Country

Database of all countries in the world., (*7)

Properties, (*8)

  • Names
  • Short Code (Alpha-2 code)
  • Code (Alpha-3 code)
  • Latitude
  • Longitude
  • Bounding Box
  • Currency
  • Continent
  • Population
  • Area
  • Capital
  • Timezone

Examples, (*9)

Get a list of all countries., (*10)

use GeoBase\Country\CountryRepository;
$countryCollection = CountryRepository::findAll();

Get country name in english., (*11)

foreach ($countryCollection as $country) {
   echo $country->getNames()->get('en');
}

Order by country name in english., (*12)

$countryCollection->orderByName();

Region

Database of all States, Federal Districts and Territories in the United States, Provinces and Territories in Canada., (*13)

Properties, (*14)

  • Name
  • Code (Alpha-2 code)
  • Country
  • Type
  • Latitude
  • Longitude
  • Bounding Box

Examples, (*15)

Get a list of all regions in the US., (*16)

use GeoBase\Country\CountryRepository;
use GeoBase\Regions\RegionRepository;

$country = CountryRepository::findByCode('US');
$regionCollection = RegionRepository::findByCountry($country);

Get region name and type in english., (*17)

foreach ($regionCollection as $region) {
   echo $region->getNames()->get('en') . " is a " . 
       $region->getType()::class . " of the " . 
       $country->getNames()->get('en);
}

The Versions

06/03 2017

dev-master

9999999-dev https://github.com/geobase/php-countries

Data from Open Data providers compiled into easy to use PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

06/03 2017

1.0.1

1.0.1.0 https://github.com/geobase/php-countries

Data from Open Data providers compiled into easy to use PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

06/03 2017

1.0.0

1.0.0.0 https://github.com/geobase/php-countries

Data from Open Data providers compiled into easy to use PHP objects

  Sources   Download

MIT

The Requires

 

database geoip geolocation data country state region province

06/03 2017

dev-analysis-q1ZMVP

dev-analysis-q1ZMVP https://github.com/geobase/php-countries

Data from Open Data providers compiled into easy to use PHP objects

  Sources   Download

MIT

The Requires

 

database geoip geolocation data country state region province