Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .htaccess

This file was deleted.

69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,75 @@

## Unreleased

### PHPUnit Integration

- **PHPUnit 9+ Migration**: Complete migration to PHPUnit 9+ ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- Refactored `CakeTestLoader` to implement `TestSuiteLoader` interface with composition pattern
- Fixed critical infinite recursion bug in `CakeTestLoader::reload()` method
- Updated `CakeBaseReporter` from extending `PHPUnit_TextUI_ResultPrinter` to implementing `ResultPrinter` interface
- Added missing interface methods: `write()`, `addWarning()`, `addRiskyTest()` to `CakeBaseReporter`
- Added type declarations throughout TestSuite classes for PHP 8.0+ compatibility
- Added `run()` method to `CakeTestSuiteCommand` with proper test file resolution
- Updated all PHPUnit class references from `PHPUnit_Framework_*` to `PHPUnit\Framework\*` namespace
- Removed legacy `CakeTestRunner` class (functionality moved to `CakeTestSuiteCommand`)
- Updated test assertions to use `withConsecutive()` and callback-based output verification
- Fixed `HtmlCoverageReportTest` to use `CakeHtmlReporter` instead of `CakeBaseReporter`
- All tests now pass with PHPUnit 9.6+

### Code Modernization

- **Legacy PHP Version Checks Removal**: Removed compatibility code for PHP < 8.0 ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- Removed PHP 5.3/5.4 version checks from `ErrorHandler`, `Debugger`, `CakeSocket`
- Removed PHP 5.4 fallback logic in `CakeNumber::_numberFormat()`
- Removed PHP version checks from `CakeTimeTest`
- Simplified SSL/TLS configuration in `CakeSocket` (removed PHP 5.3.2/5.6.0 checks)
- Removed obsolete Debugger workarounds for PHP < 5.3
- Updated `strpos()` to `str_ends_with()` in `CakeTestLoader`
- Changed `include` to `require_once` in bootstrap files for consistency
- Fixed indentation in `basics.php` to standardize whitespace

### Performance Improvements

- **JSON Output Optimization**: Improved JSON rendering performance ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- `JsonView` now only applies `JSON_PRETTY_PRINT` when debug mode is enabled
- Reduces JSON encoding overhead in production environments

### Autoloading Improvements

- **App::load() Enhancement**: Added class existence check ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- `App::load()` now returns early if class already exists
- Prevents unnecessary file loading and improves performance
- Replaced direct `ShellDispatcher` require with `App::load()` in test bootstrap
- Added `class_exists()` guard in test bootstrap to prevent double definition errors

### Code Quality

- **Coding Standards**: Applied phpcs fixes and removed deprecated exclusions ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- Removed `get_magic_quotes_gpc` exclusion from phpcs.xml (function removed in PHP 7.4)
- Added trailing commas to `trigger_error()` calls for consistency
- Added `CakeHtmlReporter` to unused variable exclusion list

### Documentation

- **GitHub URLs Update**: Updated all GitHub organization references ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))
- Changed GitHub URLs from `cakephp` to `friendsofcake2` in `home.ctp` templates
- Updated changelog, issues, wiki, and plugin repository links
- Removed upstream `CONTRIBUTING.md` (fork has different contribution guidelines)

### Dispatcher Improvements

- **Simplified Dispatcher Entry Points**: Streamlined autoload handling in dispatcher files
- Removed manual `CAKE_CORE_INCLUDE_PATH` detection from dispatcher files (set automatically in bootstrap.php)
- Removed `include_path` manipulation logic (Composer autoload handles this)
- Removed legacy `app/Vendor/cakephp/cakephp` path detection
- Added clear error messages when Composer vendors directory or autoload.php is missing
- Added clear error messages when CakePHP core is not installed via Composer
- **Breaking Change**: Projects must use Composer for installation (non-Composer installation no longer supported)
- **Migration**: If upgrading, copy updated dispatcher files from `vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/` to your project:
- `skel/webroot/index.php` → `app/webroot/index.php`
- `skel/webroot/test.php` → `app/webroot/test.php`
- `skel/Console/cake` → `app/Console/cake`

### PHP Support

- **PHP 8.5 Support**: Added PHP 8.5 to CI testing matrix ([PR #12](https://github.com/friendsofcake2/cakephp/pull/12))
Expand Down
81 changes: 0 additions & 81 deletions CONTRIBUTING.md

This file was deleted.

72 changes: 56 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ The original CakePHP 2.x branch [reached End of Life in June 2021](https://baker

## Installation

> [!IMPORTANT]
> This fork requires Composer for installation. Manual installation is not supported.

Install via Composer:

```json
Expand All @@ -59,9 +62,22 @@ Then run:
composer update
```

After installation, copy dispatcher files from the package to your application:

```bash
# Copy web 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

# Copy console dispatcher
cp vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/Console/cake app/Console/cake
chmod +x app/Console/cake
```

> [!NOTE]
> This package uses Composer's `replace` directive to replace `cakephp/cakephp`.
> This ensures that all plugins and packages that depend on `cakephp/cakephp:^2.x` will continue to work correctly with this fork.
> - This package uses Composer's `replace` directive to replace `cakephp/cakephp`.
> - This ensures that all plugins and packages that depend on `cakephp/cakephp:^2.x` will continue to work correctly with this fork.
> - Dispatcher files provide better error messages and simplified autoload handling.

## Security

Expand Down Expand Up @@ -97,7 +113,31 @@ Before migrating to this fork, ensure:

### Breaking Changes

#### 1. Cache Engines Removed ([PR #4](https://github.com/friendsofcake2/cakephp/pull/4))
#### 1. Composer-Only Installation Required ([PR #14](https://github.com/friendsofcake2/cakephp/pull/14))

**Breaking Change:**
- **Non-Composer installation is no longer supported**
- Dispatcher files (`app/webroot/index.php`, `app/webroot/test.php`, `app/Console/cake`) require Composer autoload
- Removed manual `CAKE_CORE_INCLUDE_PATH` detection from dispatcher files
- Removed `include_path` manipulation logic
- Removed legacy `app/Vendor/cakephp/cakephp` path detection
- Removed `app/Console/cake.bat` and `app/Console/cake.php` (Windows batch file and PHP wrapper no longer needed)

**Migration:**
1. Ensure you're using Composer for dependency management
2. Copy updated dispatcher files from `vendors/friendsofcake2/cakephp/lib/Cake/Console/Templates/skel/` to your application:
```bash
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
```
3. Remove old dispatcher files if present:
```bash
rm -f app/Console/cake.bat app/Console/cake.php
```
4. Run `composer install` to ensure all dependencies are properly loaded

#### 2. Cache Engines Removed ([PR #4](https://github.com/friendsofcake2/cakephp/pull/4))

**Breaking Change:**
- **Xcache** support has been removed (not compatible with PHP 7.0+)
Expand All @@ -106,7 +146,7 @@ Before migrating to this fork, ensure:
**Migration:**
- If using these cache engines, migrate to Redis, Memcached, or APCu

#### 2. Database Driver Methods Added ([PR #3](https://github.com/friendsofcake2/cakephp/pull/3))
#### 3. Database Driver Methods Added ([PR #3](https://github.com/friendsofcake2/cakephp/pull/3))

**Breaking Change:**
- New methods added to database drivers (may cause issues if you have custom driver implementations)
Expand All @@ -123,7 +163,7 @@ Before migrating to this fork, ensure:
**Migration:**
- If you have custom database drivers extending these classes, implement these methods

#### 3. Database Charset Configuration Changes ([PR #11](https://github.com/friendsofcake2/cakephp/pull/11))
#### 4. Database Charset Configuration Changes ([PR #11](https://github.com/friendsofcake2/cakephp/pull/11))

**Breaking Change:**
- Character set configuration moved from `SET NAMES` to DSN connection options
Expand All @@ -136,11 +176,11 @@ Before migrating to this fork, ensure:
- `setEncoding()` methods still work for runtime changes
- More efficient connection setup with charset in DSN

#### 4. SQL Server Driver Updates ([PR #9](https://github.com/friendsofcake2/cakephp/pull/9))
#### 5. SQL Server Driver Updates ([PR #9](https://github.com/friendsofcake2/cakephp/pull/9))

**Breaking Changes:**

**4.1 Configuration Format**
**5.1 Configuration Format**
- **Schema-based configuration**: Use schema mapping instead of multiple databases
```php
// Old approach (still works)
Expand All @@ -165,7 +205,7 @@ Before migrating to this fork, ensure:

- **Port configuration**: Specify port separately (automatically appended to server)

**4.2 Method Signature Changes**
**5.2 Method Signature Changes**
- `describe($model): array` - Now has explicit return type
- `insertMulti()` - Now returns `bool` instead of `void`

Expand All @@ -174,7 +214,7 @@ Before migrating to this fork, ensure:
- Move SSL/TLS options to `options` array if using inline DSN
- If extending Sqlserver class, update method signatures to match

#### 5. Mail Function Updates ([PR #10](https://github.com/friendsofcake2/cakephp/pull/10))
#### 6. Mail Function Updates ([PR #10](https://github.com/friendsofcake2/cakephp/pull/10))

**Breaking Change:**
- `MailTransport::_mail()` method signature changed with strict types
Expand All @@ -185,7 +225,7 @@ Before migrating to this fork, ensure:
- No action required unless you've extended `MailTransport` class
- If extending, update method signature to match strict types

#### 6. CSRF Token Security Enhancement ([PR #5](https://github.com/friendsofcake2/cakephp/pull/5))
#### 7. CSRF Token Security Enhancement ([PR #5](https://github.com/friendsofcake2/cakephp/pull/5))

**Breaking Change:**
- New CSRF tokens use HMAC-SHA1 signatures (prevents CVE-2020-15400)
Expand All @@ -196,7 +236,7 @@ Before migrating to this fork, ensure:
- Existing tokens continue to work
- New tokens generated with enhanced security

#### 7. strftime() Replacement
#### 8. strftime() Replacement

**Breaking Change:**
- `strftime()` deprecated in PHP 8.1, removed in PHP 8.2
Expand All @@ -208,24 +248,24 @@ Before migrating to this fork, ensure:
- Edge cases may produce slightly different output
- Test date formatting in your application

#### 8. Development Tools Updates
#### 9. Development Tools Updates

**8.1 PHP CodeSniffer ([PR #8](https://github.com/friendsofcake2/cakephp/pull/8))**
**9.1 PHP CodeSniffer ([PR #8](https://github.com/friendsofcake2/cakephp/pull/8))**
- Updated from 1.0.0 to 5.3
- Applied automatic formatting fixes

**Migration:**
- Development-time change only
- Update `phpcs.xml` if you have custom coding standards

**8.2 PHPUnit Compatibility**
**9.2 PHPUnit Compatibility**
- Framework tests migrated to PHPUnit 9.6
- All deprecated PHPUnit features fixed

**Migration:**
- Update your tests if using deprecated PHPUnit features

#### 9. PHP 8 Syntax Modernization ([PR #7](https://github.com/friendsofcake2/cakephp/pull/7))
#### 10. PHP 8 Syntax Modernization ([PR #7](https://github.com/friendsofcake2/cakephp/pull/7))

**Breaking Change:**
- Codebase modernized to PHP 8 syntax
Expand All @@ -241,7 +281,7 @@ Before migrating to this fork, ensure:
**Migration:**
- **No action required** - syntax changes only, no functionality changes

#### 10. CookieComponent 'cipher' Type - Insecure and Should Be Replaced
#### 11. CookieComponent 'cipher' Type - Insecure and Should Be Replaced

**Breaking Change:**
- The default `CookieComponent` encryption type `'cipher'` is horribly insecure
Expand Down
8 changes: 0 additions & 8 deletions app/.htaccess

This file was deleted.

Loading