2017 © Pedro Peláez
 

library ntp-client

NTP client

image

krzysztofmazur/ntp-client

NTP client

  • Monday, January 23, 2017
  • by krzysztofmazur
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ntp-client

Ntp-client is a PHP library to getting time from NTP server. It supports UPD and TCP protocol., (*1)

Installation

Run composer command, (*2)

composer require krzysztofmazur/ntp-client, (*3)

Usage

<?php

use KrzysztofMazur\NTPClient\Impl\UdpNtpClient;

$client = new UdpNtpClient('pool.ntp.org', 123);
var_dump($client->getUnixTime());

or, (*4)

<?php

use KrzysztofMazur\NTPClient\Impl\UdpNtpClient;
use KrzysztofMazur\NTPClient\Impl\CompositeNtpClient;

$clients = [
    new UdpNtpClient('pool.ntp.org', 123),
    new UdpNtpClient('ntp.pads.ufrj.br', 123)
];
$client = new CompositeNtpClient($clients);

var_dump($client->getTime(new DateTimeZone('Europe/Warsaw')));

License

MIT, (*5)

The Versions

23/01 2017

dev-master

9999999-dev https://github.com/krzysztofmazur

NTP client

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

by Krzysztof Mazur

23/01 2017

v1.0.0

1.0.0.0 https://github.com/krzysztofmazur

NTP client

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

by Krzysztof Mazur