From 4c278d845d7355ba2529eb33e505f336b210fa36 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 21 Sep 2023 16:13:42 +0200 Subject: [PATCH] Init 5.x upgrade. --- composer.json | 2 +- composer.lock | 17 ++++++++++++----- config/app.php | 2 +- config/app_custom.php | 2 +- config/bootstrap.php | 30 ++++++++++++++++++++++-------- src/Application.php | 2 +- src/Controller/AppController.php | 1 - 7 files changed, 38 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 72f1c08d..a6eed81f 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": ">=8.1", "spryker/cakephp-statemachine": "dev-cake5", "cakephp/plugin-installer": "^2.0.1", - "cakephp/cakephp": "^5.0.0", + "cakephp/cakephp": "5.x-dev as 5.0.0", "cakephp/bake": "^3.0.2", "mobiledetect/mobiledetectlib": "3.*", "dereuromark/cakephp-tinyauth": "dev-cake5", diff --git a/composer.lock b/composer.lock index 82ac21ff..3736cc75 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a0fb139ba74b9fa75abe62c5539428b8", + "content-hash": "476dfd92b0ff76d373cfd8ffb5fae01e", "packages": [ { "name": "brick/math", @@ -1721,12 +1721,12 @@ "source": { "type": "git", "url": "https://github.com/dereuromark/cakephp-dto.git", - "reference": "99707bf057e810e8a5bed9191ef2ec59debb88f8" + "reference": "1424a354e2d9fb66ece682b316cbd8cb68e64b0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dereuromark/cakephp-dto/zipball/99707bf057e810e8a5bed9191ef2ec59debb88f8", - "reference": "99707bf057e810e8a5bed9191ef2ec59debb88f8", + "url": "https://api.github.com/repos/dereuromark/cakephp-dto/zipball/1424a354e2d9fb66ece682b316cbd8cb68e64b0f", + "reference": "1424a354e2d9fb66ece682b316cbd8cb68e64b0f", "shasum": "" }, "require": { @@ -1784,7 +1784,7 @@ "issues": "https://github.com/dereuromark/cakephp-dto/issues", "source": "https://github.com/dereuromark/cakephp-dto/" }, - "time": "2023-09-21T09:45:02+00:00" + "time": "2023-09-21T12:57:09+00:00" }, { "name": "dereuromark/cakephp-expose", @@ -9692,6 +9692,12 @@ } ], "aliases": [ + { + "package": "cakephp/cakephp", + "version": "5.9999999.9999999.9999999-dev", + "alias": "5.0.0", + "alias_normalized": "5.0.0.0" + }, { "package": "dereuromark/cakephp-dto", "version": "dev-cake5", @@ -9720,6 +9726,7 @@ "minimum-stability": "dev", "stability-flags": { "spryker/cakephp-statemachine": 20, + "cakephp/cakephp": 20, "dereuromark/cakephp-tinyauth": 20, "dereuromark/cakephp-geo": 20, "dereuromark/cakephp-shim": 20, diff --git a/config/app.php b/config/app.php index f17442db..54420a18 100644 --- a/config/app.php +++ b/config/app.php @@ -140,7 +140,7 @@ */ 'Error' => [ 'errorLevel' => E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED, - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', + //'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', 'skipLog' => [], 'log' => true, 'trace' => true, diff --git a/config/app_custom.php b/config/app_custom.php index 6b48ff88..ec7bd152 100644 --- a/config/app_custom.php +++ b/config/app_custom.php @@ -255,7 +255,7 @@ ], 'generatorTasks' => [ ServiceTask::class, - FormatIconFontAwesome4Task::class, + //FormatIconFontAwesome4Task::class, IconRenderTask::class, ], 'classAnnotatorTasks' => [ diff --git a/config/bootstrap.php b/config/bootstrap.php index c8acdd28..a98ee0c3 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -53,6 +53,21 @@ use Detection\MobileDetect; use Tools\Mailer\Mailer; +/** + * Load global functions. + */ +require CAKE . 'functions.php'; + +if (!defined('SECOND')) { + define('SECOND', 1); + define('MINUTE', 60); + define('HOUR', 3600); + define('DAY', 86400); + define('WEEK', 604800); + define('MONTH', 2592000); + define('YEAR', 31536000); +} + /** * Read configuration file and inject configuration into various * CakePHP classes. @@ -172,20 +187,19 @@ FrozenDate::setToStringFormat('yyyy-MM-dd'); // For any immutable Date TypeFactory::build('time') - ->useImmutable()->setLocaleFormat('HH:mm:ss'); + ->setLocaleFormat('HH:mm:ss'); TypeFactory::build('date') - ->useImmutable()->setLocaleFormat('dd.MM.YYYY'); + ->setLocaleFormat('dd.MM.YYYY'); TypeFactory::build('datetime') - ->useImmutable()->setLocaleFormat('dd.MM.YYYY HH:mm:ss'); -TypeFactory::build('timestamp') - ->useImmutable(); + ->setLocaleFormat('dd.MM.YYYY HH:mm:ss'); +TypeFactory::build('timestamp'); /* Type::build('time') - ->useImmutable()->setLocaleFormat('HH:mm:ss'); + ->setLocaleFormat('HH:mm:ss'); Type::build('date') - ->useImmutable()->setLocaleFormat('dd.MM.YYYY'); + ->setLocaleFormat('dd.MM.YYYY'); Type::build('datetime') - ->useImmutable()->setLocaleFormat('dd.MM.YYYY HH:mm:ss'); + ->setLocaleFormat('dd.MM.YYYY HH:mm:ss'); FrozenTime::setToStringFormat('dd.MM.YYYY HH:mm:ss'); Time::setToStringFormat('dd.MM.YYYY HH:mm:ss'); diff --git a/src/Application.php b/src/Application.php index 78476a9a..02d5fb75 100644 --- a/src/Application.php +++ b/src/Application.php @@ -54,7 +54,7 @@ public function bootstrap(): void { $this->addPlugin('Markup'); $this->addPlugin('Feedback'); $this->addPlugin('Icings/Menu'); - $this->addPlugin('Menu'); + //$this->addPlugin('Menu'); $this->addPlugin('Expose'); // inside /plugins diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 0b5e98dd..bda3266e 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -19,7 +19,6 @@ class AppController extends Controller { public function initialize(): void { parent::initialize(); - $this->loadComponent('RequestHandler'); $this->loadComponent('Tools.Common'); $this->loadComponent('Flash.Flash'); $this->loadComponent('TinyAuth.Auth');