Skip to content

v0.6.7

Latest

Choose a tag to compare

@EdmondDantes EdmondDantes released this 14 Apr 14:12
· 271 commits to main since this release

TrueAsync PHP 0.6.7 (php 8.6)

Highlights

  • FrankenPHP on Windows — both Release and Debug builds of FrankenPHP are now produced and shipped alongside the regular PHP artifacts.
  • Installer: optional FrankenPHP install — the Windows PowerShell installer now asks (or reads INSTALL_FRANKENPHP=true) whether to also install FrankenPHP next to php.exe.

Async extension

Added

  • PDO Pool: getAttribute() support for pool attributes. $pdo->getAttribute(PDO::ATTR_POOL_ENABLED) now returns true/false depending on whether the connection pool is active. PDO::ATTR_POOL_MIN and PDO::ATTR_POOL_MAX return the configured pool size limits (or false when pooling is disabled). PDO::ATTR_POOL_HEALTHCHECK_INTERVAL is a construction-only attribute and raises an error if read at runtime.

Fixed

  • Heap-use-after-free in await_all() / await_*() with string keys. When any await_* function received an array with non-interned string keys (e.g. from json_decode() or str_repeat()), the returned results/errors arrays had incorrect refcount on those keys. Root cause: async_waiting_callback_dispose was called twice per callback (once from zend_async_callbacks_remove during del_callback, once from ZEND_ASYNC_EVENT_CALLBACK_RELEASE), but did not check ref_count — it unconditionally called zval_ptr_dtor on the key each time, decrementing the string refcount twice instead of once. When the calling function's local variables were freed (i_free_compiled_variables), the already-freed string was accessed again. Fixed by adding a ref_count guard to async_waiting_callback_dispose: when ref_count > 1, decrement and return without touching resources; cleanup happens only on the final dispose (ref_count == 1).

Windows build

Added

  • FrankenPHP support for Windows (Release and Debug). Both build types now produce a slim *-frankenphp.zip addon archive containing only FrankenPHP-specific files: frankenphp.exe, libwatcher-c.dll, brotli*.dll and pthreadVC3.dll. The PHP runtime DLL and extensions are not duplicated — extract this archive on top of the main PHP package.
  • Debug FrankenPHP linkage. FrankenPHP's cgo configuration was split into cgo_windows.go / cgo_windows_debug.go gated by the zend_debug Go build tag. When building against a debug devel pack, the workflow passes -tags zend_debug so clang sees -DZEND_DEBUG=1, matching the signatures of _emalloc/_efree/_estrdup in php8ts_debug.lib (which gain ZEND_FILE_LINE_DC arguments in debug mode).
  • Installer: optional FrankenPHP install. installer/install.ps1 now exposes an INSTALL_FRANKENPHP environment variable and an interactive "Install FrankenPHP?" prompt. When enabled, the installer downloads the matching slim frankenphp addon archive (respecting the Release/Debug choice), verifies its checksum against the same sha256sums.txt, and extracts it on top of the main install — frankenphp.exe lands next to php.exe.

Fixed

  • Clang/MSVC ABI mismatch in frankenphp_extension.c. Calls to emalloc(sizeof(zval)) were routed through zend_alloc.h's __builtin_constant_p specialization to _emalloc_16, which MSVC-built php8ts.lib does not export. Replaced with safe_emalloc(1, sizeof(zval), 0) to hit the exported _safe_emalloc entry point.
  • strtok_r unresolved on Windows. The Windows CRT has no strtok_r. Replaced all four call sites in frankenphp_extension.c with php_strtok_r (portable wrapper from main/php_reentrancy.h).
  • Debug packaging hardcoded release DLL names. The Package FrankenPHP step tried to copy php8ts.dll, but debug builds ship php8ts_debug.dll (see win32/build/confutils.js PHPLIB). Packaging now globs php*ts*.dll and php*ts*.lib so both release and debug names work.

Installation

Windows (PowerShell)

irm https://raw.githubusercontent.com/true-async/releases/master/installer/install.ps1 | iex

To also install FrankenPHP non-interactively:

$env:INSTALL_FRANKENPHP="true"; irm https://raw.githubusercontent.com/true-async/releases/master/installer/install.ps1 | iex

Docker

docker pull trueasync/php-true-async:0.6.7-php8.6
docker pull trueasync/php-true-async:latest