Download the PHP package vladyslav-dyba/server-clock without Composer

On this page you can find all versions of the php package vladyslav-dyba/server-clock. 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 server-clock

ServerClock package

Packagist

Provide correct server time based on its external IP

Table of Contents

Installation

Composer Installation

To install the package, you can use Composer:

This will add the package to your composer.json file and download it into the vendor directory. Manual Installation

In case you want to include it manually, you can also follow these steps:

 - Download the package files.
 - Include the Composer autoloader in your project:

Test run

Once you clone the package sepparetly, you can perform a test run to get local time based on an IP

To get local time for specific IP

To get local time for external server IP

Usage

Here, explain how to use your package with practical examples. Provide some basic functionality and advanced use cases.

To get a local time of the external server IP:

To get a local time of the provided a specific IP:

Structure

Core

The core of the package is ServerClock object that implements TimeSourceInterface interface

TimeSource

ServerClock gets a time from a $timeSource that implements TimeSourceInterface

Package has only one basic implementation of the TimeSourceInterface - DefaultTimeSource and its TimeSourse DataProvider: TimeApi service

Client can substitute the DataProvider with their own solution that implements the TimeSourceInterface

IpSource

Since TimeSource works based on an IP information, IpSourceInterface implementation has to be provided.

Package has two basic implementation of the IpSourceInterface:

Configuration

Regardless, the package has its own TimeSourceInterface and IpSourceInterface implementations,

there is no any configuration that can be applied for the package because the package was created with minimum dependencies and its the primary approach to configure the package is substituting the interfaces implementations on a client side


All versions of server-clock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/clock Version ^1
guzzlehttp/guzzle Version ^7.9
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 vladyslav-dyba/server-clock contains the following files

Loading the files please wait ....