Skip to content

A PHP library to retrieve and properly format prayer data from external sources.

Notifications You must be signed in to change notification settings

MalaysiaPrayerTimes/provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPT Provider

Build Status codecov

This library is used by MPT to retrieve and properly format prayer data from external sources.

Supported Providers

Requirements

  • PHP 7+

Usage

Setup

$adapter = new \Ivory\HttpAdapter\CurlHttpAdapter();
$geotools = new \League\Geotools\Geotools();
$geocoder = new \Geocoder\ProviderAggregator();
$goutte = new \Goutte\Client();

$geocoder->registerProviders([
    new \Geocoder\Provider\GoogleMaps($adapter, null, null, true, '<api-key>'),
]);

$provider = new \Mpt\Provider();
$provider->registerPrayerTimeProvider($jp);

Add Providers

$jp = new \Mpt\Providers\Jakim\JakimProvider($geotools, $geocoder, $goutte);

// or any other providers implementing PrayerTimeProvider
// $sg = new CustomProvider();

$provider->registerPrayerTimeProvider($jp);

Get Prayer Data

/**
 * Get prayer data by provider's code
 *
 * @var PrayerData
 */
$times = $provider->getTimesByCode('ext-352');

/**
 * Get prayer data by coordinates
 *
 * @var PrayerData
 */
$times = $provider->getTimesByCoordinates(3.04466, 101.707);

About

A PHP library to retrieve and properly format prayer data from external sources.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages