Skip to content

Load the imap extension, except in FrankenPHP - #109

Closed
rajtik76 wants to merge 1 commit into
flock-php:mainfrom
rajtik76:feature/107-imap-extension
Closed

rajtik76 wants to merge 1 commit into
flock-php:mainfrom
rajtik76:feature/107-imap-extension

Conversation

@rajtik76

@rajtik76 rajtik76 commented Nov 5, 2026

Copy link
Copy Markdown

Fixes #107

What and why

Loads the imap extension that flock-php/binaries#48 adds to the PHP builds.

  • imap is added to the extensions Flock loads from ext/ when present. On Windows 8.1–8.3 the official build already ships php_imap.dll, so it loads there right away.
  • imap isn't thread-safe. The macOS and Linux FrankenPHP builds don't ship it, but on Windows FrankenPHP shares the official build's ext/, so php.ThreadUnsafeExtensions keeps it out of FrankenPHP's ini.
  • docs/php.md lists imap and the FrankenPHP and Kerberos limits.

How I tested it

  • New TestExtensionsIniSkipsThreadUnsafeForFrankenPHP. go test ./internal/php ./internal/frankenphp passes on Linux and on Windows; go run ./tools/docslint passes.
  • CI on my fork: Build, all jobs green.
  • The builds from php: add the imap extension binaries#48, tested there with the official imap test suite.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review has no active issues for the IMAP-loading and FrankenPHP-exclusion changes.

No open issues 🎉

What changed in this PR

Adds automatic loading of bundled IMAP extensions for regular PHP, supporting #107, while excluding IMAP from FrankenPHP because it is not thread-safe.

Changes:

  • Adds IMAP to extension loading and introduces a skip list used by FrankenPHP.
  • Adds a test covering normal loading and thread-unsafe extension exclusion.
  • Documents IMAP availability and its FrankenPHP and Kerberos limitations.
File Description
internal/​php/​php.go Adds IMAP loading and optional extension exclusions.
internal/​php/​php_test.go Tests IMAP loading and exclusion while preserving other extensions.
internal/​frankenphp/​frankenphp.go Excludes thread-unsafe extensions from generated FrankenPHP configuration.
docs/​php.md Lists IMAP and documents its limitations.

Review effort: Balanced

@lukas-frey

Copy link
Copy Markdown
Member

Please see my reply in #107

@lukas-frey lukas-frey closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: include the imap extension in bundled PHP builds

3 participants