loading...

re: Real life comparison of Symfony router and Mezon router VIEW POST

FULL DISCUSSION
 

Thanks for the update. You've got the wiring right, but $dumper->getCompiledRoutes() should never be called in a loop.

The way this is supposed to be used is:

  1. warm the list of routes by dumping the compiled routes once (eg using var_export() to generate a cache.php file)
  2. reuse the already dumped routes in the loop.
 

Mmmmmmm I have not dig so deep, but I shall change the benchmark.

reuse the already dumped routes in the loop.

Just include cache.php in my php script? or there is a method wich loads cached routes?

 

you can dump cache.php doing eg:
file_put_contents('cache.php', '<?php return '.var_export($dumper->getCompiledRoutes(), true).';');

then to get the compiled routes:
$compiledRoutes = require 'cache.php';

code of conduct - report abuse