From a7b160e57537b3f71390d86155e3fab8872df413 Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Sat, 4 Dec 2021 03:14:23 +0100 Subject: [PATCH] Mise en conformité de config/app.default.php avec norme CAKEPHP 3.10 --- .gitignore | 22 +++++++++++----------- CHANGELOG | 5 +++++ README.md | 4 ++-- config/app.default.php | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------- src/View/AjaxView.php | 26 +++++++++++++++++--------- src/View/AppView.php | 6 +++--- 6 files changed, 123 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index 3db7e19..aa5ca96 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ .mysql_history -src/Application.php.OLD +/src/Application.php.OLD # OS generated files # ###################### @@ -93,25 +93,25 @@ nbproject/* # Fichiers lies a Composer # On ne versionne QUE composer.json -composer.json.* -!composer.json.commented +/composer.json.* +!/composer.json.commented # On ne versionne NI composer.lock NI aucune copie de ce fichier -composer.lock -#composer.lock.* -composer.lock* +/composer.lock +#/composer.lock.* +/composer.lock* #old/ # webroot/ # - liens (ou dossiers) auto-installed par cakephp avec "bin/cake plugin assets symlink" -webroot/debug_kit -webroot/dompdf -webroot/bootstrap_u_i +/webroot/debug_kit +/webroot/dompdf +/webroot/bootstrap_u_i # - Autres sous-dossiers a ignorer #webroot.* -webroot/test +/webroot/test # Autres dossiers -MODIFS_DE_VENDOR/* +/MODIFS_DE_VENDOR/* # Ne pas ignorer les fichier "empty" diff --git a/CHANGELOG b/CHANGELOG index 5cba125..6b37881 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -484,6 +484,11 @@ rien ? ======= CHANGES ======= ------- +03/12/2021 v5.5.1-3.10.1 + - (i) Mise en conformité de config/app.default.php avec la nouvelle norme CAKEPHP 3.10 + => (A) *** CHAQUE LABO doit mettre à jour son config/app.php en fonction du nouveau config/app.default.php *** + +------- 02/12/2021 v5.5.0-3.10.1 - (e) Evolution du framework CakePhp de v3.7 (mal configuré) à v3.10 (proprement configuré) !!! - (i) Beaucoup de modifs pour adapter le logiciel à la nouvelle version du framework diff --git a/README.md b/README.md index b7b942a..6b03043 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ Logiciel testé et validé sur les configurations suivantes : -------------------------------------------------------------------------------------------- -Date: 02/12/2021 -Version: v5.5.0-3.10.1 +Date: 03/12/2021 +Version: v5.5.1-3.10.1 HISTORIQUE DES CHANGEMENTS DE VERSION : voir le fichier CHANGES.txt (ou la page web /pages/changes) diff --git a/config/app.default.php b/config/app.default.php index bf3458b..c6fd63f 100755 --- a/config/app.default.php +++ b/config/app.default.php @@ -1,13 +1,22 @@ [ - //'salt' => env('SECURITY_SALT', '__SALT__'), + //'salt' => env('SECURITY_SALT', '96de0165eccc596056b9dcd608f7f45888ab9154abf32bdd1a8087e640478028'), 'salt' => env('SECURITY_SALT', '597495ab489fda98efb7fc70db7606b2a9b556dbce9ea96c1f0833b091e71afe'), ], @@ -102,7 +111,9 @@ return [ // AVANT //'className' => 'File', // CAKEPHP 3.7 - 'className' => 'Cake\Cache\Engine\FileEngine', + //'className' => 'Cake\Cache\Engine\FileEngine', + // CAKEPHP 3.10 + 'className' => FileEngine::class, 'path' => CACHE, 'url' => env('CACHE_DEFAULT_URL', null), ], @@ -117,7 +128,9 @@ return [ // AVANT //'className' => 'File', // CAKE3.7 - 'className' => 'Cake\Cache\Engine\FileEngine', + //'className' => 'Cake\Cache\Engine\FileEngine', + // CAKE3.7 + 'className' => FileEngine::class, 'prefix' => 'myapp_cake_core_', 'path' => CACHE . 'persistent/', 'serialize' => true, @@ -135,7 +148,10 @@ return [ * Duration will be set to '+2 minutes' in bootstrap.php when debug = true */ '_cake_model_' => [ - 'className' => 'Cake\Cache\Engine\FileEngine', + // 3.7 + //'className' => 'Cake\Cache\Engine\FileEngine', + // 3.10 + 'className' => FileEngine::class, //'className' => 'File', 'prefix' => 'myapp_cake_model_', 'path' => CACHE . 'models/', @@ -152,7 +168,10 @@ return [ * Duration will be set to '+2 seconds' in bootstrap.php when debug = true */ '_cake_routes_' => [ - 'className' => 'Cake\Cache\Engine\FileEngine', + // 3.7 + //'className' => 'Cake\Cache\Engine\FileEngine', + // 3.10 + 'className' => FileEngine::class, 'prefix' => 'myapp_cake_routes_', 'path' => CACHE, 'serialize' => true, @@ -201,8 +220,11 @@ return [ // - Pour branche master : Sans les deprecated ni les Warnings 'errorLevel' => E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_WARNING, - - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', + + // 3.7 + //'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', + // 3.10 + 'exceptionRenderer' => ExceptionRenderer::class, 'skipLog' => [], 'log' => true, 'trace' => true, @@ -230,24 +252,37 @@ return [ 'EmailTransport' => [ 'default' => [ // CAKE3.7 - 'className' => 'Cake\Mailer\Transport\MailTransport', + //'className' => 'Cake\Mailer\Transport\MailTransport', + // 3.10 + 'className' => MailTransport::class, // AVANT //'className' => 'Mail', /* - * The following keys are used in SMTP transports: + * The keys host, port, timeout, username, password, client and tls + * are used in SMTP transports */ 'host' => 'localhost', 'port' => 25, 'timeout' => 30, + + /* + * It is recommended to set these options through your environment or app_local.php + */ // CAKE3.7 //'username' => null, //'password' => null, 'username' => 'user', 'password' => 'secret', + 'client' => null, - 'tls' => null, + // 3.7 + //'tls' => null, + // 3.10 + 'tls' => false, 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), ], + + // (EP) ajouté pour dev send mail 'dev' => [ 'className' => 'Smtp', 'host' => 'ssl://smtp.gmail.com', @@ -278,6 +313,9 @@ return [ 'default' => [ 'transport' => 'default', 'from' => 'you@localhost', + /* + * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8. + */ //'charset' => 'utf-8', //'headerCharset' => 'utf-8', ], @@ -298,8 +336,14 @@ return [ */ 'Datasources' => [ 'default' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', + // 3.7 + //'className' => 'Cake\Database\Connection', + // 3.10 + 'className' => Connection::class, + // 3.7 + //'driver' => 'Cake\Database\Driver\Mysql', + // 3.10 + 'driver' => Mysql::class, 'persistent' => false, /*d*/'host' => 'localhost', /* @@ -308,7 +352,10 @@ return [ * the following line and set the port accordingly */ //'port' => 'non_standard_port_number', - /*d*/'username' => 'db_username', + /* + * It is recommended to set these options through your environment or app_local.php + */ + /*d*/'username' => 'db_username', /*d*/'password' => 'db_password', /*d*/'database' => 'database', /* @@ -348,8 +395,14 @@ return [ * The test connection is used during the test suite. */ 'test' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', + + // 3.7 + //'className' => 'Cake\Database\Connection', + //'driver' => 'Cake\Database\Driver\Mysql', + // 3.10 + 'className' => Connection::class, + 'driver' => Mysql::class, + 'persistent' => false, /*t*/'host' => 'localhost', //'port' => 'non_standard_port_number', @@ -364,7 +417,7 @@ return [ 'quoteIdentifiers' => false, 'log' => false, //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - 'url' => env('DATABASE_TEST_URL', null), + //'url' => env('DATABASE_TEST_URL', null), ], ], @@ -373,7 +426,10 @@ return [ */ 'Log' => [ 'debug' => [ - 'className' => 'Cake\Log\Engine\FileLog', + // 3.7 + //'className' => 'Cake\Log\Engine\FileLog', + // 3.10 + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'debug', 'url' => env('LOG_DEBUG_URL', null), @@ -382,7 +438,10 @@ return [ 'scopes' => false, ], 'error' => [ - 'className' => 'Cake\Log\Engine\FileLog', + // 3.7 + //'className' => 'Cake\Log\Engine\FileLog', + // 3.10 + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'error', 'url' => env('LOG_ERROR_URL', null), @@ -393,7 +452,10 @@ return [ // NEW IN CAKE3.7 // To enable this dedicated query log, you need set your datasource's log flag to true 'queries' => [ - 'className' => 'Cake\Log\Engine\FileLog', + // 3.7 + //'className' => 'Cake\Log\Engine\FileLog', + // 3.10 + 'className' => FileLog::class, 'path' => LOGS, 'file' => 'queries', 'url' => env('LOG_QUERIES_URL', null), @@ -447,7 +509,7 @@ return [ // Pour changer le timeout de session (en minutes) // Voir un bon exemple de comment gérer l'event timeout ici : // https://stackoverflow.com/questions/32298817/how-to-prevent-cakephp-3-0-from-extending-session-timeout-with-ajax-requests - 'timeout' => 5, // mn + 'timeout' => 15, // mn /* Pour changer le timeout de cookie (en secondes) * diff --git a/src/View/AjaxView.php b/src/View/AjaxView.php index 6b272fa..e5885b6 100755 --- a/src/View/AjaxView.php +++ b/src/View/AjaxView.php @@ -1,19 +1,24 @@ response->type('ajax'); - $this->response->withType('ajax'); + // 3.7 + //$this->response->withType('ajax'); + // 3.10 + $this->response = $this->response->withType('ajax'); + } } diff --git a/src/View/AppView.php b/src/View/AppView.php index 0d3acee..0f2c4d0 100755 --- a/src/View/AppView.php +++ b/src/View/AppView.php @@ -7,9 +7,9 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @since 3.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license http://opensource.org/licenses/mit-license.php MIT License */ namespace App\View; @@ -30,7 +30,7 @@ use BootstrapUI\View\UIView; * * Your application’s default view class * - * @link http://book.cakephp.org/3.0/en/views.html#the-app-view + * @link https://book.cakephp.org/3/en/views.html#the-app-view */ // Modified for bootstrap-ui (EP 28/1/20) //class AppView extends UIView -- libgit2 0.21.2