8000 [Routing] Match 5x faster by compiling routes in one regexp · symfony/symfony@9ba72eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ba72eb

Browse files
[Routing] Match 5x faster by compiling routes in one regexp
1 parent 2ef0d60 commit 9ba72eb

16 files changed

+1326
-1644
lines changed

src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Routing\Generator\Dumper;
1313

14+
use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
15+
1416
/**
1517
* PhpGeneratorDumper creates a PHP class able to generate URLs for a given set of routes.
1618
*
@@ -88,7 +90,7 @@ private function generateDeclaredRoutes()
8890
$properties[] = $compiledRoute->getHostTokens();
8991
$properties[] = $route->getSchemes();
9092

91-
$routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true)));
93+
$routes .= sprintf(" '%s' => %s,\n", $name, PhpMatcherDumper::export($properties));
9294
}
9395
$routes .= ' )';
9496

src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0