Skip to content

v2.11.0

Choose a tag to compare

@ttsuru ttsuru released this 08 Oct 21:01
· 649 commits to 2.x since this release

Directory Structure Modernization and Documentation Improvements

This release modernizes the CakePHP 2.x directory structure to follow current PHP package standards and improves documentation for easier migration.

Major Changes

Directory Structure Modernization (PR #21)

Modern Directory Layout:

  • lib/Cake/ → src/Cake/ (framework source code)
  • lib/Cake/Test/Case/ → tests/TestCase/ (framework tests)
  • lib/Cake/Test/Fixture/ → tests/Fixture/ (test fixtures)
  • lib/Cake/Console/cake → bin/cake (console executable)
  • lib/Cake/Config/ → config/ (framework configuration)
  • lib/Cake/View/ and lib/Cake/Templates/ → templates/ (framework templates)

Modern Test Directory Support:

  • Applications and plugins can now use modern tests/TestCase/ and tests/Fixture/ directory structure
  • Test suite automatically detects both traditional and modern directory structures
  • Enables gradual migration to modern directory layout

Smart Console Executable:

  • bin/cake now auto-detects project structure (supports both app/ and src/ layouts)
  • Works seamlessly when installed via Composer (vendor/bin/cake)
  • No manual configuration needed

Documentation Improvements

New UPGRADE.md:

  • Comprehensive migration guide with all breaking changes
  • Post-Installation Steps for both legacy and modern directory structures
  • Detailed migration instructions for each breaking change

Improved README.md:

  • Simplified Migration Guide section
  • Clear references to detailed documentation

Plugin Extraction

Developer Experience

  • Added PHPDoc generic type annotations for better IDE support
  • Improved type inference for ClassRegistry::init() and Controller::loadModel()

Migration Guide

See UPGRADE.md for detailed migration instructions.

Post-Installation Steps

For Legacy Directory Structure (app/ directory):

composer require --dev pieceofcake2/bake
cp plugins/Bake/Console/Templates/skel/webroot/index.php app/webroot/index.php
cp plugins/Bake/Console/Templates/skel/webroot/test.php app/webroot/test.php
cp plugins/Bake/Console/Templates/skel/Console/cake app/Console/cake
chmod +x app/Console/cake

For Modern Directory Structure (src/ directory):
See pieceofcake2/app for the modern application skeleton.

Full Changelog

See CHANGELOG.md for complete details.