daaquan/chronos-ext

There is no license information available for the latest version (v1.0.1) of this package.

A PHP extension for the Chronos library

v1.0.1 2025-07-08 08:31 UTC

This package is auto-updated.

Last update: 2025-07-08 08:32:17 UTC


README

Chronos is a lightweight date/time extension for PHP 8+. It extends the native DateTime class and offers Carbon-like helpers implemented in Zephir.

Building the Extension

  1. Compile the source and install the module:
cd ext
phpize
./configure
make
sudo make install
  1. Enable the extension by adding the following line to your php.ini:
extension=chronos.so

Usage

<?php
$chronos = \Chronos\Chronos::now();
echo $chronos->format('Y-m-d H:i:s');

Running Tests

Install development dependencies and execute the test suite:

composer install
php vendor/bin/pest --configuration ide-stubs/phpunit.xml.dist

All tests should pass without failures.

Packaging for PECL

Create the package.xml file describing the extension and run the pecl package command from the repository root:

pecl package

This will generate a distributable chronos-0.0.1.tgz archive that can be uploaded to PECL.