Skip to content

v2.12.0

Choose a tag to compare

@ttsuru ttsuru released this 09 Oct 05:42
· 635 commits to 2.x since this release

Composer Autoloading Migration

Migrates CakePHP framework from include-path to Composer classmap autoloading, removing 798+ App::uses() declarations from framework classes while maintaining backward compatibility.

What Changed

  • Removed all App::uses() declarations from CakePHP framework classes (798 occurrences)
  • Framework classes are now automatically loaded via Composer's classmap autoloader
  • Application classes can be automatically loaded by configuring Composer classmap autoloading in composer.json
  • Maintained App::uses() only for framework classes that extend application classes (AppController, AppModel, AppShell, AppHelper) to ensure backward compatibility

Benefits

  • Simplifies class loading mechanism
  • Improves compatibility with modern PHP tooling
  • Reduces framework code complexity
  • Enables gradual migration path for applications

Backward Compatibility

  • Legacy applications using app/ directory structure continue to work without changes
  • Framework's remaining App::uses() calls for application base classes ensure compatibility
  • Plugins continue to use App::uses() as before

Migration Path

  • Modern projects (src/): Add classmap autoloading to composer.json (see pieceofcake2/app)
  • Legacy projects (app/): No action required - works automatically
  • See UPGRADE.md for detailed migration instructions

Files Changed

  • 338 files modified
  • 1,515 deletions (removed App::uses() declarations)
  • 476 insertions (documentation, error handling improvements)

Full Changelog

See CHANGELOG.md for complete list of changes.