Skip to content

Commit 3413e0b

Browse files
committed
PB-39713 Update app files based upon latest app template
1 parent 1defa92 commit 3413e0b

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

config/bootstrap.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,18 @@
4141
use Cake\Datasource\ConnectionManager;
4242
use Cake\Error\ErrorTrap;
4343
use Cake\Error\ExceptionTrap;
44-
use Cake\I18n\FrozenTime;
44+
use Cake\I18n\DateTime;
4545
use Cake\Log\Log;
4646
use Cake\Mailer\Mailer;
4747
use Cake\Mailer\TransportFactory;
4848
use Cake\Routing\Router;
4949
use Cake\Utility\Security;
5050

51+
/**
52+
* Load global functions.
53+
*/
54+
require CAKE . 'functions.php';
55+
5156
/*
5257
* Read configuration file and inject configuration into various
5358
* CakePHP classes.
@@ -102,7 +107,6 @@
102107
if (Configure::read('debug')) {
103108
Configure::write('Cache._cake_model_.duration', '+2 minutes');
104109
Configure::write('Cache._cake_core_.duration', '+2 minutes');
105-
Configure::write('Cache._cake_routes_.duration', '+2 seconds');
106110
}
107111

108112
/*
@@ -191,7 +195,7 @@
191195
Security::setSalt(Configure::consume('Security.salt'));
192196

193197
// Enforce the json time format
194-
FrozenTime::setJsonEncodeFormat("yyyy-MM-dd'T'HH':'mm':'ssxxx");
198+
DateTime::setJsonEncodeFormat("yyyy-MM-dd'T'HH':'mm':'ssxxx");
195199

196200
/*
197201
* Setup detectors for mobile and tablet.

config/routes.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* @link https://www.passbolt.com Passbolt(tm)
1313
* @since 2.0.0
1414
*/
15-
use Cake\Core\Plugin;
1615
use Cake\Routing\RouteBuilder;
1716
use Cake\Routing\Router;
1817
use Cake\Routing\Route\DashedRoute;

phpcs.xml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<exclude-pattern>*.js</exclude-pattern>
1111

1212
<rule ref="CakePHP"/>
13+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
14+
<exclude-pattern>*/src/Controller/*</exclude-pattern>
15+
</rule>
1316

1417
<rule ref="Generic.Formatting.SpaceAfterNot">
1518
<properties>

tests/bootstrap.php

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* unit tests in this file.
99
*/
1010

11+
use Cake\Chronos\Chronos;
1112
use Cake\TestSuite\ConnectionHelper;
1213
use Migrations\TestSuite\Migrator;
1314

@@ -16,5 +17,13 @@
1617

1718
$_SERVER['PHP_SELF'] = '/';
1819

20+
// Fixate now to avoid one-second-leap-issues
21+
Chronos::setTestNow(Chronos::now());
22+
23+
// Fixate sessionid early on, as php7.2+
24+
// does not allow the sessionid to be set after stdout
25+
// has been written to.
26+
session_id('cli');
27+
1928
(new ConnectionHelper())->addTestAliases();
2029
(new Migrator())->run();

0 commit comments

Comments
 (0)