Skip to content

Compatibility with phpBB 3.1 - 3.3 and PHP 8.x - #17

Open
gn36 wants to merge 3 commits into
masterfrom
claude/busy-dirac-3sdso7
Open

gn36 wants to merge 3 commits into
masterfrom
claude/busy-dirac-3sdso7

Conversation

@gn36

@gn36 gn36 commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Summary

The extension's runtime code only uses stable events (core.posting_modify_cannot_edit_conditions, core.viewtopic_modify_post_action_conditions, core.permissions, core.modify_posting_auth) plus auth/user, so it already works on phpBB 3.1, 3.2 and 3.3. This PR fixes the remaining issues and makes the test suite run on PHPUnit 4 through 9.

  • event/listener.php: declare the $user property (dynamic properties are deprecated as of PHP 8.2).
  • tests/event/listener_base.php: replace the setUp() override with a @before method. phpBB 3.3 (PHPUnit 9) requires setUp(): void, which is a syntax error on PHP < 7.1 used by 3.1/3.2.
  • tests/compat.php + tests/functional/install_test.php: add an assertTextContains helper, since PHPUnit 9 no longer accepts strings in assertContains. Same approach as the hookup extension.
  • phpunit.xml.dist: drop syntaxCheck and the phpVersion attributes, which newer PHPUnit versions reject.
  • composer.json: version check now points to the phpBB.com extension database (from Update version check host and directory in composer.json #16, the old phpbb.gn36.de URL returns a 404).
  • .gitattributes: add .github/ to the export-ignore list (in the spirit of PPSSE fix & exclude irrelevant files #15) and mark composer.phar as binary to stop phantom line-ending changes.
  • README.md: mention 3.1, 3.2 and 3.3.

PHP requirement stays at >=5.3.3. The tests were not run (no phpBB checkout was available); all PHP files pass php -l. The CI matrix in .travis.yml and .github/workflows/tests.yml is unchanged.

Closes #16


Generated by Claude Code

- Declare the $user property in the listener (dynamic properties are deprecated in PHP 8.2)
- Tests: use @before instead of setUp() (PHPUnit 4 - 9 compatible), add compat trait for assertContains
- phpunit.xml.dist: drop options removed in newer PHPUnit
- Version check now points to the phpBB.com customisation database (PR #16)
- Exclude CI and dev files from export archives (PR #15)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXek2CuiLeFBsgjo8BdEU1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXek2CuiLeFBsgjo8BdEU1
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.

2 participants