Skip to content

Commit

Permalink
Issue #490: Enabled FastRoute caching
Browse files Browse the repository at this point in the history
Signed-off-by: alexmerlin <[email protected]>
  • Loading branch information
alexmerlin committed Oct 1, 2024
1 parent 987ee49 commit eab817d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
19 changes: 19 additions & 0 deletions config/autoload/debug.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This is a helper file that can be required by other config files to determine the debug status.
*/

declare(strict_types=1);

$path = getcwd() . '/config/development.config.php';
if (! file_exists($path)) {
return [
'_debug' => false,
];
}

$config = require $path;
return [
'_debug' => $config['debug'] ?? false,
];
13 changes: 13 additions & 0 deletions config/autoload/routes.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

$debug = require getcwd() . '/config/autoload/debug.global.php';

return [
'router' => [
'fastroute' => [
Mezzio\Router\FastRouteRouter::CONFIG_CACHE_ENABLED => $debug['_debug'],
],
],
];
4 changes: 2 additions & 2 deletions data/.gitignore → data/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
!.gitignore
cache
*
!.gitignore

0 comments on commit eab817d

Please sign in to comment.