Skip to content

Commit 203895c

Browse files
committed
refactor(config): removed $app
1 parent cc11d71 commit 203895c

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

app/config/config_sample.php

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use flight\Container;
34
use flight\debug\tracy\TracyExtensionLoader;
45
use Tracy\Debugger;
56

@@ -15,21 +16,13 @@
1516
// Set the default locale
1617
setlocale(LC_ALL, 'en_US.UTF-8');
1718

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
3326

3427
/*
3528
* Get Tracy up and running
@@ -42,13 +35,13 @@
4235
Debugger::enable(); // auto tries to figure out your environment
4336
// Debugger::enable(Debugger::DEVELOPMENT) // sometimes you have to be explicit (also Debugger::PRODUCTION)
4437
// 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';
4639
Debugger::$strictMode = true; // display all errors
4740
// Debugger::$strictMode = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED; // all errors except deprecated notices
4841

4942
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);
5245
}
5346

5447
/*

0 commit comments

Comments
 (0)