Commit a7b160e57537b3f71390d86155e3fab8872df413

Authored by Etienne Pallier
1 parent 3219dd51
Exists in master and in 1 other branch dev

Mise en conformité de config/app.default.php avec norme CAKEPHP 3.10

	=> (A) *** CHAQUE LABO doit mettre à jour son config/app.php en
fonction du nouveau config/app.default.php ***

v5.5.1-3.10.1
.gitignore
... ... @@ -38,7 +38,7 @@
38 38  
39 39 .mysql_history
40 40  
41   -src/Application.php.OLD
  41 +/src/Application.php.OLD
42 42  
43 43 # OS generated files #
44 44 ######################
... ... @@ -93,25 +93,25 @@ nbproject/*
93 93  
94 94 # Fichiers lies a Composer
95 95 # On ne versionne QUE composer.json
96   -composer.json.*
97   -!composer.json.commented
  96 +/composer.json.*
  97 +!/composer.json.commented
98 98 # On ne versionne NI composer.lock NI aucune copie de ce fichier
99   -composer.lock
100   -#composer.lock.*
101   -composer.lock*
  99 +/composer.lock
  100 +#/composer.lock.*
  101 +/composer.lock*
102 102 #old/
103 103  
104 104 # webroot/
105 105 # - liens (ou dossiers) auto-installed par cakephp avec "bin/cake plugin assets symlink"
106   -webroot/debug_kit
107   -webroot/dompdf
108   -webroot/bootstrap_u_i
  106 +/webroot/debug_kit
  107 +/webroot/dompdf
  108 +/webroot/bootstrap_u_i
109 109 # - Autres sous-dossiers a ignorer
110 110 #webroot.*
111   -webroot/test
  111 +/webroot/test
112 112  
113 113 # Autres dossiers
114   -MODIFS_DE_VENDOR/*
  114 +/MODIFS_DE_VENDOR/*
115 115  
116 116  
117 117 # Ne pas ignorer les fichier "empty"
... ...
CHANGELOG
... ... @@ -484,6 +484,11 @@ rien ?
484 484 ======= CHANGES =======
485 485  
486 486 -------
  487 +03/12/2021 v5.5.1-3.10.1
  488 + - (i) Mise en conformité de config/app.default.php avec la nouvelle norme CAKEPHP 3.10
  489 + => (A) *** CHAQUE LABO doit mettre à jour son config/app.php en fonction du nouveau config/app.default.php ***
  490 +
  491 +-------
487 492 02/12/2021 v5.5.0-3.10.1
488 493 - (e) Evolution du framework CakePhp de v3.7 (mal configuré) à v3.10 (proprement configuré) !!!
489 494 - (i) Beaucoup de modifs pour adapter le logiciel à la nouvelle version du framework
... ...
README.md
... ... @@ -52,8 +52,8 @@ Logiciel testé et validé sur les configurations suivantes :
52 52  
53 53 --------------------------------------------------------------------------------------------
54 54  
55   -Date: 02/12/2021
56   -Version: v5.5.0-3.10.1
  55 +Date: 03/12/2021
  56 +Version: v5.5.1-3.10.1
57 57  
58 58  
59 59 HISTORIQUE DES CHANGEMENTS DE VERSION : voir le fichier CHANGES.txt (ou la page web /pages/changes)
... ...
config/app.default.php
1 1 <?php
2   -// (EP202102) Mis à la norme CAKEPHP3.7
  2 +// (EP2021-12) Mis à la norme CAKEPHP3.10
  3 +
  4 +
  5 +use Cake\Cache\Engine\FileEngine;
  6 +use Cake\Database\Connection;
  7 +use Cake\Database\Driver\Mysql;
  8 +use Cake\Error\ExceptionRenderer;
  9 +use Cake\Log\Engine\FileLog;
  10 +use Cake\Mailer\Transport\MailTransport;
  11 +
3 12 return [
4 13 /**
5 14 * Debug Level:
6 15 *
7   - * - Production Mode:
  16 + * Production Mode:
8 17 * false: No error messages, errors, or warnings shown.
9 18 *
10   - * - Development Mode:
  19 + * Development Mode:
11 20 * true: Errors and warnings shown.
12 21 */
13 22 // (EP) Permet aussi que DebugKit soit activé
... ... @@ -77,7 +86,7 @@ return [
77 86 * You should treat it as extremely sensitive data.
78 87 */
79 88 'Security' => [
80   - //'salt' => env('SECURITY_SALT', '__SALT__'),
  89 + //'salt' => env('SECURITY_SALT', '96de0165eccc596056b9dcd608f7f45888ab9154abf32bdd1a8087e640478028'),
81 90 'salt' => env('SECURITY_SALT', '597495ab489fda98efb7fc70db7606b2a9b556dbce9ea96c1f0833b091e71afe'),
82 91 ],
83 92  
... ... @@ -102,7 +111,9 @@ return [
102 111 // AVANT
103 112 //'className' => 'File',
104 113 // CAKEPHP 3.7
105   - 'className' => 'Cake\Cache\Engine\FileEngine',
  114 + //'className' => 'Cake\Cache\Engine\FileEngine',
  115 + // CAKEPHP 3.10
  116 + 'className' => FileEngine::class,
106 117 'path' => CACHE,
107 118 'url' => env('CACHE_DEFAULT_URL', null),
108 119 ],
... ... @@ -117,7 +128,9 @@ return [
117 128 // AVANT
118 129 //'className' => 'File',
119 130 // CAKE3.7
120   - 'className' => 'Cake\Cache\Engine\FileEngine',
  131 + //'className' => 'Cake\Cache\Engine\FileEngine',
  132 + // CAKE3.7
  133 + 'className' => FileEngine::class,
121 134 'prefix' => 'myapp_cake_core_',
122 135 'path' => CACHE . 'persistent/',
123 136 'serialize' => true,
... ... @@ -135,7 +148,10 @@ return [
135 148 * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
136 149 */
137 150 '_cake_model_' => [
138   - 'className' => 'Cake\Cache\Engine\FileEngine',
  151 + // 3.7
  152 + //'className' => 'Cake\Cache\Engine\FileEngine',
  153 + // 3.10
  154 + 'className' => FileEngine::class,
139 155 //'className' => 'File',
140 156 'prefix' => 'myapp_cake_model_',
141 157 'path' => CACHE . 'models/',
... ... @@ -152,7 +168,10 @@ return [
152 168 * Duration will be set to '+2 seconds' in bootstrap.php when debug = true
153 169 */
154 170 '_cake_routes_' => [
155   - 'className' => 'Cake\Cache\Engine\FileEngine',
  171 + // 3.7
  172 + //'className' => 'Cake\Cache\Engine\FileEngine',
  173 + // 3.10
  174 + 'className' => FileEngine::class,
156 175 'prefix' => 'myapp_cake_routes_',
157 176 'path' => CACHE,
158 177 'serialize' => true,
... ... @@ -201,8 +220,11 @@ return [
201 220  
202 221 // - Pour branche master : Sans les deprecated ni les Warnings
203 222 'errorLevel' => E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_WARNING,
204   -
205   - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
  223 +
  224 + // 3.7
  225 + //'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
  226 + // 3.10
  227 + 'exceptionRenderer' => ExceptionRenderer::class,
206 228 'skipLog' => [],
207 229 'log' => true,
208 230 'trace' => true,
... ... @@ -230,24 +252,37 @@ return [
230 252 'EmailTransport' => [
231 253 'default' => [
232 254 // CAKE3.7
233   - 'className' => 'Cake\Mailer\Transport\MailTransport',
  255 + //'className' => 'Cake\Mailer\Transport\MailTransport',
  256 + // 3.10
  257 + 'className' => MailTransport::class,
234 258 // AVANT
235 259 //'className' => 'Mail',
236 260 /*
237   - * The following keys are used in SMTP transports:
  261 + * The keys host, port, timeout, username, password, client and tls
  262 + * are used in SMTP transports
238 263 */
239 264 'host' => 'localhost',
240 265 'port' => 25,
241 266 'timeout' => 30,
  267 +
  268 + /*
  269 + * It is recommended to set these options through your environment or app_local.php
  270 + */
242 271 // CAKE3.7
243 272 //'username' => null,
244 273 //'password' => null,
245 274 'username' => 'user',
246 275 'password' => 'secret',
  276 +
247 277 'client' => null,
248   - 'tls' => null,
  278 + // 3.7
  279 + //'tls' => null,
  280 + // 3.10
  281 + 'tls' => false,
249 282 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
250 283 ],
  284 +
  285 + // (EP) ajouté pour dev send mail
251 286 'dev' => [
252 287 'className' => 'Smtp',
253 288 'host' => 'ssl://smtp.gmail.com',
... ... @@ -278,6 +313,9 @@ return [
278 313 'default' => [
279 314 'transport' => 'default',
280 315 'from' => 'you@localhost',
  316 + /*
  317 + * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8.
  318 + */
281 319 //'charset' => 'utf-8',
282 320 //'headerCharset' => 'utf-8',
283 321 ],
... ... @@ -298,8 +336,14 @@ return [
298 336 */
299 337 'Datasources' => [
300 338 'default' => [
301   - 'className' => 'Cake\Database\Connection',
302   - 'driver' => 'Cake\Database\Driver\Mysql',
  339 + // 3.7
  340 + //'className' => 'Cake\Database\Connection',
  341 + // 3.10
  342 + 'className' => Connection::class,
  343 + // 3.7
  344 + //'driver' => 'Cake\Database\Driver\Mysql',
  345 + // 3.10
  346 + 'driver' => Mysql::class,
303 347 'persistent' => false,
304 348 /*d*/'host' => 'localhost',
305 349 /*
... ... @@ -308,7 +352,10 @@ return [
308 352 * the following line and set the port accordingly
309 353 */
310 354 //'port' => 'non_standard_port_number',
311   - /*d*/'username' => 'db_username',
  355 + /*
  356 + * It is recommended to set these options through your environment or app_local.php
  357 + */
  358 + /*d*/'username' => 'db_username',
312 359 /*d*/'password' => 'db_password',
313 360 /*d*/'database' => 'database',
314 361 /*
... ... @@ -348,8 +395,14 @@ return [
348 395 * The test connection is used during the test suite.
349 396 */
350 397 'test' => [
351   - 'className' => 'Cake\Database\Connection',
352   - 'driver' => 'Cake\Database\Driver\Mysql',
  398 +
  399 + // 3.7
  400 + //'className' => 'Cake\Database\Connection',
  401 + //'driver' => 'Cake\Database\Driver\Mysql',
  402 + // 3.10
  403 + 'className' => Connection::class,
  404 + 'driver' => Mysql::class,
  405 +
353 406 'persistent' => false,
354 407 /*t*/'host' => 'localhost',
355 408 //'port' => 'non_standard_port_number',
... ... @@ -364,7 +417,7 @@ return [
364 417 'quoteIdentifiers' => false,
365 418 'log' => false,
366 419 //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
367   - 'url' => env('DATABASE_TEST_URL', null),
  420 + //'url' => env('DATABASE_TEST_URL', null),
368 421 ],
369 422 ],
370 423  
... ... @@ -373,7 +426,10 @@ return [
373 426 */
374 427 'Log' => [
375 428 'debug' => [
376   - 'className' => 'Cake\Log\Engine\FileLog',
  429 + // 3.7
  430 + //'className' => 'Cake\Log\Engine\FileLog',
  431 + // 3.10
  432 + 'className' => FileLog::class,
377 433 'path' => LOGS,
378 434 'file' => 'debug',
379 435 'url' => env('LOG_DEBUG_URL', null),
... ... @@ -382,7 +438,10 @@ return [
382 438 'scopes' => false,
383 439 ],
384 440 'error' => [
385   - 'className' => 'Cake\Log\Engine\FileLog',
  441 + // 3.7
  442 + //'className' => 'Cake\Log\Engine\FileLog',
  443 + // 3.10
  444 + 'className' => FileLog::class,
386 445 'path' => LOGS,
387 446 'file' => 'error',
388 447 'url' => env('LOG_ERROR_URL', null),
... ... @@ -393,7 +452,10 @@ return [
393 452 // NEW IN CAKE3.7
394 453 // To enable this dedicated query log, you need set your datasource's log flag to true
395 454 'queries' => [
396   - 'className' => 'Cake\Log\Engine\FileLog',
  455 + // 3.7
  456 + //'className' => 'Cake\Log\Engine\FileLog',
  457 + // 3.10
  458 + 'className' => FileLog::class,
397 459 'path' => LOGS,
398 460 'file' => 'queries',
399 461 'url' => env('LOG_QUERIES_URL', null),
... ... @@ -447,7 +509,7 @@ return [
447 509 // Pour changer le timeout de session (en minutes)
448 510 // Voir un bon exemple de comment gérer l'event timeout ici :
449 511 // https://stackoverflow.com/questions/32298817/how-to-prevent-cakephp-3-0-from-extending-session-timeout-with-ajax-requests
450   - 'timeout' => 5, // mn
  512 + 'timeout' => 15, // mn
451 513  
452 514 /* Pour changer le timeout de cookie (en secondes)
453 515 *
... ...
src/View/AjaxView.php
1 1 <?php
2 2 /**
3   - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4   - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  3 + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4 + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5 5 *
6 6 * Licensed under The MIT License
7 7 * For full copyright and license information, please see the LICENSE.txt
8 8 * Redistributions of files must retain the above copyright notice.
9 9 *
10   - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11   - * @link http://cakephp.org CakePHP(tm) Project
  10 + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11 + * @link https://cakephp.org CakePHP(tm) Project
12 12 * @since 3.0.4
13   - * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13 + * @license https://opensource.org/licenses/mit-license.php MIT License
14 14 */
15 15 namespace App\View;
16 16  
  17 +// NEW in CAKEPHP3.10
  18 +use Cake\Event\EventManager;
  19 +use Cake\Http\Response;
  20 +use Cake\Http\ServerRequest;
  21 +
17 22 /**
18 23 * A view class that is used for AJAX responses.
19 24 * Currently only switches the default layout and sets the response type -
... ... @@ -24,9 +29,8 @@ class AjaxView extends AppView
24 29  
25 30 /**
26 31 * The name of the layout file to render the view inside of.
27   - * The name
28   - * specified is the filename of the layout in /src/Template/Layout without
29   - * the .ctp extension.
  32 + * The name specified is the filename of the layout in /src/Template/Layout
  33 + * without the .ctp extension.
30 34 *
31 35 * @var string
32 36 */
... ... @@ -42,6 +46,10 @@ class AjaxView extends AppView
42 46 parent::initialize();
43 47  
44 48 //$this->response->type('ajax');
45   - $this->response->withType('ajax');
  49 + // 3.7
  50 + //$this->response->withType('ajax');
  51 + // 3.10
  52 + $this->response = $this->response->withType('ajax');
  53 +
46 54 }
47 55 }
... ...
src/View/AppView.php
... ... @@ -7,9 +7,9 @@
7 7 * Redistributions of files must retain the above copyright notice.
8 8 *
9 9 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
10   - * @link http://cakephp.org CakePHP(tm) Project
  10 + * @link https://cakephp.org CakePHP(tm) Project
11 11 * @since 3.0.0
12   - * @license http://www.opensource.org/licenses/mit-license.php MIT License
  12 + * @license http://opensource.org/licenses/mit-license.php MIT License
13 13 */
14 14 namespace App\View;
15 15  
... ... @@ -30,7 +30,7 @@ use BootstrapUI\View\UIView;
30 30 *
31 31 * Your application’s default view class
32 32 *
33   - * @link http://book.cakephp.org/3.0/en/views.html#the-app-view
  33 + * @link https://book.cakephp.org/3/en/views.html#the-app-view
34 34 */
35 35 // Modified for bootstrap-ui (EP 28/1/20)
36 36 //class AppView extends UIView
... ...