Skip to content

Commit b8ca165

Browse files
authored
[php] Update CakePHP to v5 (#8472)
* [php] Update CakePHP to v5 * Add extra files * Update composer.json * Fix salt
1 parent 8ad0c7a commit b8ca165

39 files changed

+1417
-222
lines changed

frameworks/PHP/cakephp/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<p align="center">
2+
<img src=" https://cakephp.org/img/cake-logo.svg" height=100>
3+
</p>
4+
https://www.cakephp.org
5+
16
# Cake PHP Benchmarking Test
27

38
This is the Cake PHP portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
@@ -18,10 +23,8 @@ Uses the CakePHP Model functionality.
1823
## Infrastructure Software Versions
1924
The tests were run with:
2025

21-
* [Cake Version 4.0](https://cakephp.org/)
22-
* [PHP Version 7.4](http://www.php.net/)
23-
* [nginx 1.12.0](http://nginx.org/)
24-
* [MySQL 5.7.20](https://dev.mysql.com/)
26+
* [Cake Version 5](https://cakephp.org/)
27+
* [PHP Version 8.2](http://www.php.net/)
2528

2629
Cake Debug mode is set to false in [core.php](config/app.php), as
2730
appropriate for a production deployment.

frameworks/PHP/cakephp/benchmark_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"webserver": "nginx",
2121
"os": "Linux",
2222
"database_os": "Linux",
23-
"display_name": "CakePHP 4.4",
23+
"display_name": "CakePHP 5",
2424
"notes": "",
2525
"versus": "php"
2626
},

frameworks/PHP/cakephp/composer.json

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,54 @@
55
"type": "project",
66
"license": "MIT",
77
"require": {
8-
"cakephp/cakephp": "^4.4",
9-
"cakephp/plugin-installer": "^1.3",
10-
"cakephp/chronos": "2.3.*"
8+
"php": ">=8.1",
9+
"cakephp/cakephp": "^5.0.1",
10+
"cakephp/migrations": "^4.0.0",
11+
"cakephp/plugin-installer": "^2.0",
12+
"mobiledetect/mobiledetectlib": "^3.74"
13+
},
14+
"require-dev": {
15+
"cakephp/bake": "^3.0.0",
16+
"cakephp/cakephp-codesniffer": "^5.0",
17+
"cakephp/debug_kit": "^5.0.0",
18+
"josegonzalez/dotenv": "^4.0",
19+
"phpunit/phpunit": "^10.1.0"
20+
},
21+
"suggest": {
22+
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
23+
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.",
24+
"phpstan/phpstan": "PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.",
25+
"cakephp/repl": "Console tools for a REPL interface for CakePHP applications."
1126
},
1227
"autoload": {
1328
"psr-4": {
1429
"App\\": "src/"
1530
}
1631
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"App\\Test\\": "tests/",
35+
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
36+
}
37+
},
1738
"scripts": {
39+
"post-install-cmd": "App\\Console\\Installer::postInstall",
40+
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
1841
"check": [
1942
"@test",
2043
"@cs-check"
2144
],
22-
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
23-
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
24-
"stan": "phpstan analyse src/",
25-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
45+
"cs-check": "phpcs --colors -p",
46+
"cs-fix": "phpcbf --colors -p",
47+
"stan": "phpstan analyse",
2648
"test": "phpunit --colors=always"
2749
},
2850
"config": {
51+
"platform-check": true,
2952
"sort-packages": true,
3053
"allow-plugins": {
31-
"*": true
54+
"cakephp/plugin-installer": true,
55+
"dealerdirect/phpcodesniffer-composer-installer": true
3256
}
3357
}
3458
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
# Used as a default to seed config/.env which
3+
# enables you to use environment variables to configure
4+
# the aspects of your application that vary by
5+
# environment.
6+
#
7+
# Having this file in production is considered a **SECURITY RISK** and also decreases
8+
# the bootstrap performance of your application.
9+
#
10+
# To use this file, first copy it into `config/.env`. Also ensure the related
11+
# code block for loading this file is uncommented in `config/bootstrap.php`
12+
#
13+
# In development .env files are parsed by PHP
14+
# and set into the environment. This provides a simpler
15+
# development workflow over standard environment variables.
16+
export APP_NAME="__APP_NAME__"
17+
export DEBUG="true"
18+
export APP_ENCODING="UTF-8"
19+
export APP_DEFAULT_LOCALE="en_US"
20+
export APP_DEFAULT_TIMEZONE="UTC"
21+
export SECURITY_SALT="__SALT__"
22+
23+
# Uncomment these to define cache configuration via environment variables.
24+
#export CACHE_DURATION="+2 minutes"
25+
#export CACHE_DEFAULT_URL="file:///path/to/tmp/cache/?prefix=${APP_NAME}_default_&duration=${CACHE_DURATION}"
26+
#export CACHE_CAKECORE_URL="file:///path/to/tmp/cache/persistent?prefix=${APP_NAME}_cake_core_&serialize=true&duration=${CACHE_DURATION}"
27+
#export CACHE_CAKEMODEL_URL="file:///path/to/tmp/cache/models?prefix=${APP_NAME}_cake_model_&serialize=true&duration=${CACHE_DURATION}"
28+
29+
# Uncomment these to define email transport configuration via environment variables.
30+
#export EMAIL_TRANSPORT_DEFAULT_URL=""
31+
32+
# Uncomment these to define database configuration via environment variables.
33+
#export DATABASE_URL="mysql://my_app:secret@localhost/${APP_NAME}?encoding=utf8&timezone=UTC&cacheMetadata=true&quoteIdentifiers=false&persistent=false"
34+
#export DATABASE_TEST_URL="mysql://my_app:secret@localhost/test_${APP_NAME}?encoding=utf8&timezone=UTC&cacheMetadata=true&quoteIdentifiers=false&persistent=false"
35+
36+
# Uncomment these to define logging configuration via environment variables.
37+
#export LOG_DEBUG_URL="file:///path/to/logs/?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
38+
#export LOG_ERROR_URL="file:///path/to/logs/?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"

0 commit comments

Comments
 (0)