Changeset 23487
- Timestamp:
- 10/31/09 22:06:03 (4 years ago)
- Files:
-
- tools/routing_performance/routing_performance.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/routing_performance/routing_performance.php
r23486 r23487 36 36 } 37 37 38 $t->diag('Creating routing yml with 1500+ routes'); 39 // %1$s will be replaced by 1..500 by the sprintf below 40 $template = ' 38 if (!is_file('routing.yml')) 39 { 40 $t->diag('Creating routing yml with 1500+ routes'); 41 // %1$s will be replaced by 1..500 by the sprintf below 42 $template = ' 41 43 moduleA%1$s: 42 44 url: /symfony%1$s/:build/:file … … 51 53 '; 52 54 53 $singleRoutes = '55 $singleRoutes = ' 54 56 star1: 55 57 url: /star/* 56 58 param: {module: star, action: all} 57 59 '; 58 $routingConfigYml = ''; 59 foreach(range(1, 500) as $num) 60 $routingConfigYml = ''; 61 foreach(range(1, 500) as $num) 62 { 63 $routingConfigYml .= sprintf($template, $num); 64 } 65 file_put_contents('routing.yml', $routingConfigYml.$singleRoutes); 66 } 67 68 if (!is_file($patch.'/routing.php')) 60 69 { 61 $routingConfigYml .= sprintf($template, $num); 70 $t->diag(sprintf('%s Routing - Creating Config', $patch)); 71 $stats = new Stats(); 72 $routingConfigHandlerNew = new sfRoutingConfigHandlerNew(); 73 file_put_contents($patch.'/routing.php', $routingConfigHandlerNew->execute(array(realpath('routing.yml')))); 74 $stats->log($t); 62 75 } 63 file_put_contents('routing.yml', $routingConfigYml.$singleRoutes);64 65 $t->diag(sprintf('%s Routing - Creating Config', $patch));66 $stats = new Stats();67 $routingConfigHandlerNew = new sfRoutingConfigHandlerNew();68 file_put_contents($patch.'/routing.php', $routingConfigHandlerNew->execute(array(realpath('routing.yml'))));69 $stats->log($t);70 76 71 77 // real world test starts here