Skip to content

v2.10.24.5

Choose a tag to compare

@ttsuru ttsuru released this 02 Oct 18:15

This release includes PHPUnit 9+ migration, CA certificate bundle modernization, and numerous improvements for PHP 8.0-8.5 compatibility.

Highlights

PHPUnit 9+ Migration (PR #14)

Complete migration to PHPUnit 9+ architecture:

  • All tests now pass with PHPUnit 9.6+ on PHP 8.0-8.5
  • Fixed critical infinite recursion bug in CakeTestLoader::reload()
  • Refactored CakeTestLoader to implement TestSuiteLoader interface with composition pattern
  • Updated CakeBaseReporter from extending PHPUnit_TextUI_ResultPrinter to implementing ResultPrinter interface
  • Updated all PHPUnit class references from PHPUnit_Framework_* to PHPUnit\Framework\* namespace
  • Removed legacy CakeTestRunner class (functionality moved to CakeTestSuiteCommand)

CA Bundle Modernization (PR #15)

Replaced static cacert.pem with composer/ca-bundle:

  • Uses system CA certificate bundle when available (OpenSSL default cert dir/file)
  • Falls back to Mozilla CA bundle maintained by composer/ca-bundle
  • Automatically updated through Composer ecosystem
  • Removed outdated lib/Cake/Config/cacert.pem file (3,921 lines, last updated 2023)
  • Supports both cafile (single bundle file) and capath (certificate directory) configurations

Dispatcher Simplification

Streamlined autoload handling in dispatcher files:

  • Breaking Change: Non-Composer installation no longer supported
  • Removed manual CAKE_CORE_INCLUDE_PATH detection from dispatcher files
  • Removed include_path manipulation logic (Composer autoload handles this)
  • Removed legacy app/Vendor/cakephp/cakephp path detection
  • Added clear error messages when Composer dependencies are missing

Legacy Code Removal

Removed compatibility code for PHP < 8.0:

  • Removed PHP 5.3/5.4 version checks from ErrorHandler, Debugger, CakeSocket
  • Removed PHP 5.4 fallback logic in CakeNumber::_numberFormat()
  • Simplified SSL/TLS configuration in CakeSocket (removed PHP 5.3.2/5.6.0 checks)
  • Removed obsolete Debugger workarounds for PHP < 5.3

Performance Improvements

  • JSON Output Optimization: JsonView now only applies JSON_PRETTY_PRINT when debug mode is enabled
  • Autoloading Enhancement: Added class existence check to App::load() to prevent unnecessary file loading

PHP 8.5 Support (PR #12)

  • All tests pass on PHP 8.5
  • Confirmed compatibility across all database types (MySQL, PostgreSQL, SQLite, SQL Server)
  • Fixed int cast warnings for values outside int range
  • Added return type hints to database limit() methods

Compatibility

PHP Versions:

  • PHP 8.0, 8.1, 8.2, 8.3, 8.4, 8.5

Databases:

  • MySQL 5.7, 8.0+
  • PostgreSQL 9.4+
  • SQLite 3
  • Microsoft SQL Server 2022+

Testing:

  • All tests pass with PHPUnit 9.6+

Breaking Changes

Composer-Only Installation Required

Non-Composer installation is no longer supported.

Projects must use Composer for dependency management. Manual installation paths and include_path manipulation have been removed from dispatcher files.

Migration Required:

  1. Copy updated dispatcher files:
cp vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/webroot/index.php app/webroot/index.php
cp vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/webroot/test.php app/webroot/test.php
cp vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/Console/cake app/Console/cake
  1. Remove old dispatcher files:
rm -f app/Console/cake.bat app/Console/cake.php
  1. Run Composer:
composer install

Impact: Applications already using Composer (recommended setup) require only file updates. Applications using manual installation will need to migrate to Composer.

Installation

New Installation

composer require friendsofcake2/cakephp:^2.10

Update Existing Installation

composer update friendsofcake2/cakephp

After updating, copy the updated dispatcher files as described in the Breaking Changes section.

Full Changelog

See CHANGELOG.md for complete details.

Resources

Note: This is a community-maintained fork for PHP 8.x compatibility. For new projects, please use CakePHP 5.x.