|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +use flight\Container; |
3 | 4 | use flight\debug\tracy\TracyExtensionLoader; |
4 | 5 | use Tracy\Debugger; |
5 | 6 |
|
|
15 | 16 | // Set the default locale |
16 | 17 | setlocale(LC_ALL, 'en_US.UTF-8'); |
17 | 18 |
|
18 | | -/* |
19 | | - * Set some flight variables |
20 | | - */ |
21 | | -if (empty($app)) { |
22 | | - $app = Flight::app(); |
23 | | -} |
24 | | - |
25 | | -$app->path(__DIR__ . $ds . '..' . $ds . '..'); |
26 | | -$app->set('flight.base_url', '/'); // if this is in a subdirectory, you'll need to change this |
27 | | -$app->set('flight.case_sensitive', false); // if you want case sensitive routes, set this to true |
28 | | -$app->set('flight.log_errors', true); // if you want to log errors, set this to true |
29 | | -$app->set('flight.handle_errors', false); // if you want flight to handle errors, set this to true |
30 | | -$app->set('flight.views.path', __DIR__ . $ds . '..' . $ds . 'views'); // set the path to your view/template/ui files |
31 | | -$app->set('flight.views.extension', '.php'); // set the file extension for your view/template/ui files |
32 | | -$app->set('flight.content_length', true); // if flight should send a content length header |
| 19 | +Flight::set('flight.base_url', '/'); // if this is in a subdirectory, you'll need to change this |
| 20 | +Flight::set('flight.case_sensitive', false); // if you want case sensitive routes, set this to true |
| 21 | +Flight::set('flight.log_errors', true); // if you want to log errors, set this to true |
| 22 | +Flight::set('flight.handle_errors', false); // if you want flight to handle errors, set this to true |
| 23 | +Flight::set('flight.views.path', __DIR__ . '/../views'); // set the path to your view/template/ui files |
| 24 | +Flight::set('flight.views.extension', '.php'); // set the file extension for your view/template/ui files |
| 25 | +Flight::set('flight.content_length', true); // if flight should send a content length header |
33 | 26 |
|
34 | 27 | /* |
35 | 28 | * Get Tracy up and running |
|
42 | 35 | Debugger::enable(); // auto tries to figure out your environment |
43 | 36 | // Debugger::enable(Debugger::DEVELOPMENT) // sometimes you have to be explicit (also Debugger::PRODUCTION) |
44 | 37 | // Debugger::enable('23.75.345.200'); // you can also provide an array of IP addresses |
45 | | -Debugger::$logDirectory = __DIR__ . $ds . '..' . $ds . 'log'; |
| 38 | +Debugger::$logDirectory = __DIR__ . '/../log'; |
46 | 39 | Debugger::$strictMode = true; // display all errors |
47 | 40 | // Debugger::$strictMode = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED; // all errors except deprecated notices |
48 | 41 |
|
49 | 42 | if (Debugger::$showBar) { |
50 | | - $app->set('flight.content_length', false); // if Debugger bar is visible, then content-length can not be set by Flight |
51 | | - new TracyExtensionLoader($app); |
| 43 | + Flight::set('flight.content_length', false); // if Debugger bar is visible, then content-length can not be set by Flight |
| 44 | + (new Container)->get(TracyExtensionLoader::class); |
52 | 45 | } |
53 | 46 |
|
54 | 47 | /* |
|
0 commit comments