Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 3 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,20 @@ on:
types: [created]
jobs:
build:
name: PHP ${{ matrix.php-version }} (ZTS ${{ matrix.php-zts }})
runs-on: ubuntu-22.04
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php-version:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
php-zts:
- nts
- ts
exclude:
- php-version: '5.6'
php-zts: 'ts'
- php-version: '8.3'
php-zts: 'ts'
- '8.4'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
env:
phpts: ${{ matrix.php-zts }}
- name: PHP version
run: |
php --version
Expand All @@ -55,42 +36,4 @@ jobs:
./configure
make
make test REPORT_EXIT_STATUS=1 NO_INTERACTION=1 TESTS="--show-all"
- name: Save artifact (NTS)
uses: actions/upload-artifact@v4
if: matrix.php-zts == 'nts'
with:
name: timecop_${{ env.PHP_API }}.so
path: modules/timecop.so
if-no-files-found: error
- name: Save artifact (TS)
uses: actions/upload-artifact@v4
if: matrix.php-zts == 'ts'
with:
name: timecop_${{ env.PHP_API }}_zts.so
path: modules/timecop.so
if-no-files-found: error
package:
name: Package for download
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Combine artifacts
run: |
mkdir -p output

for dir in timecop_*.so; do
# Move/rename from timecop.so to timecop_PHPAPI.so
mv "${dir}/timecop.so" "output/${dir}"
done

cd output
sha256sum *.so > SHA256SUM
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: timecop
path: output/*
if-no-files-found: error
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ tests/*.out
.#*
.DS_Store
Thumbs.db
.vscode
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension=timecop.so
## SYSTEM REQUIREMENTS

- OS: Linux, macOS
- PHP: 5.6.x - 8.3.x
- PHP: 8.4.x+
- SAPI: Apache, CLI
- Other SAPIs are not tested, but there is no SAPI-dependent code.
- non-ZTS(recommended), ZTS
Expand All @@ -48,19 +48,17 @@ extension=timecop.so
- `getdate()`
- `localtime()`
- `strtotime()`
- `strftime()`
- `gmstrftime()`
- `microtime()`
- `gettimeofday()`
- `unixtojd()`
- `DateTime::_construct()`
- `DateTime::createFromFormat()` (PHP >= 5.3.0)
- `DateTimeImmutable::_construct()` (PHP >= 5.5.0)
- `DateTimeImmutable::createFromFormat()` (PHP >= 5.5.0)
- `DateTime::createFromFormat()`
- `DateTimeImmutable::_construct()`
- `DateTimeImmutable::createFromFormat()`
- `date_create()`
- `date_create_from_format()` (PHP >= 5.3.0)
- `date_create_immutable()` (PHP >= 5.5.0)
- `date_create_immutable_from_format()` (PHP >= 5.5.0)
- `date_create_from_format()`
- `date_create_immutable()`
- `date_create_immutable_from_format()`
- Rewrite value of the following global variables when the time has been moved.
- `$_SERVER['REQUEST_TIME']`

Expand Down Expand Up @@ -106,6 +104,13 @@ var_dump((new DateTime())->format("c")); // string(25) "2017-01-01T00:00:05+00:0

## CHANGELOG

### version 1.7.0, 2024/03/20
- Support PHP 8.4
- Drop support for PHP 5.x to 8.3.x
- Fix segmentation faults in PHP 8.4
- Improved memory management
- Drop support for `strftime` and `gmstrftime`

### version 1.6.0, 2024/02/09
- Support PHP 8.3

Expand Down
6 changes: 1 addition & 5 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,5 @@ if test "$PHP_TIMECOP" != "no"; then
AC_MSG_RESULT([$PHP_VERSION])
fi

if test "$PHP_MAJOR_VERSION" -eq 5; then
PHP_NEW_EXTENSION(timecop, timecop_php5.c tc_timeval.c, $ext_shared)
else
PHP_NEW_EXTENSION(timecop, timecop_php7.c tc_timeval.c, $ext_shared)
fi
PHP_NEW_EXTENSION(timecop, timecop_php8.c tc_timeval.c, $ext_shared)
fi
Loading