Download the PHP package beste/clock without Composer

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

Clock

Current version Packagist PHP Version Support Tests

A collection of PSR-20 Clock implementations.

Table of Contents

Installation

Clocks

SystemClock

A System Clock will return a time just as if you would use new DateTimeImmutable(). The time zone of the returned value is determined by the clock's environment, for example by the time zone that has been configured in your application, by a previously used date_default_timezone_set() or by the value of date.timezone in the php.ini. If none of these are explicitly set, it uses the UTC timezone.

LocalizedClock

A localized clock is aware of the time zone in which it is located. While the time zone of the SystemClock is determined from the environment (your PHP configuration), this clock uses the time zone that you initialize it with.

UTCClock

UTC is the abbreviation for Coordinated Universal Time and a special kind of time zone that is not affected by daylight saving time. It is commonly used for the communication of time across different systems (e.g. between your PHP application and a database, or between a backend and a frontend). An UTCClock instance behaves exactly the same as an instance of LocalizedClock::in('UTC').

FrozenClock

A frozen clock doesn't move - the time we set it with will stay the same... unless we change it. That makes the frozen clock perfect for testing the behaviour of your time-based use cases, for example in Unit Tests.

MinuteClock

In some cases, microseconds, milliseconds, or even seconds are too precise for some use cases - sometimes it's just enough if something happened in the same minute. Using the minute

WrappingClock

If you already have an object with a now() method returning a DateTimeImmutable object, you can wrap it in a WrappingClock to make it a "real" Clock.

as a "real" clock.

Running tests


All versions of clock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/clock Version ^1.0
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 beste/clock contains the following files

Loading the files please wait ....