|
1 | 1 | <?php |
2 | 2 |
|
3 | | -use flight\debug\tracy\TracyExtensionLoader; |
4 | | -use Tracy\Debugger; |
| 3 | +/********************************************** |
| 4 | + * FlightPHP Skeleton Sample Config * |
| 5 | + ********************************************** |
| 6 | + * |
| 7 | + * Copy this file to config.php and update values as needed. |
| 8 | + * All settings are required unless marked as optional. |
| 9 | + * |
| 10 | + * Example: |
| 11 | + * cp app/config/config_sample.php app/config/config.php |
| 12 | + * |
| 13 | + * This file is NOT tracked by git. Store sensitive credentials here. |
| 14 | + **********************************************/ |
5 | 15 |
|
6 | | -// Set the default timezone |
7 | | -date_default_timezone_set('America/New_York'); |
| 16 | +/********************************************** |
| 17 | + * Application Environment * |
| 18 | + **********************************************/ |
| 19 | +// Set your timezone (e.g., 'America/New_York', 'UTC') |
| 20 | +date_default_timezone_set('UTC'); |
8 | 21 |
|
9 | | -// Set the error reporting level |
| 22 | +// Error reporting level (E_ALL recommended for development) |
10 | 23 | error_reporting(E_ALL); |
11 | 24 |
|
12 | | -// Set the default character encoding |
13 | | -if(function_exists('mb_internal_encoding') === true) { |
| 25 | +// Character encoding |
| 26 | +if (function_exists('mb_internal_encoding') === true) { |
14 | 27 | mb_internal_encoding('UTF-8'); |
15 | 28 | } |
16 | 29 |
|
17 | | -// Set the default locale |
18 | | -if(function_exists('setlocale') === true) { |
| 30 | +// Default Locale Change as needed or feel free to remove. |
| 31 | +if (function_exists('setlocale') === true) { |
19 | 32 | setlocale(LC_ALL, 'en_US.UTF-8'); |
20 | 33 | } |
21 | 34 |
|
| 35 | +/********************************************** |
| 36 | + * FlightPHP Core Settings * |
| 37 | + **********************************************/ |
| 38 | + |
22 | 39 | // Get the $app var to use below |
23 | | -if(empty($app)) { |
| 40 | +if (empty($app) === true) { |
24 | 41 | $app = Flight::app(); |
25 | 42 | } |
26 | 43 |
|
27 | | -// if you want to load classes that have underscores in them, comment out the following line |
28 | | -// Loader::setV2ClassLoading(false); |
29 | | - |
30 | 44 | // This autoloads your code in the app directory so you don't have to require_once everything |
| 45 | +// You'll need to namespace your classes with "app\folder\" to include them properly |
31 | 46 | $app->path(__DIR__ . $ds . '..' . $ds . '..'); |
32 | 47 |
|
33 | | -// This is where you can set some flight config variables. |
34 | | -$app->set('flight.base_url', '/'); // if this is in a subdirectory, you'll need to change this |
35 | | -$app->set('flight.case_sensitive', false); // if you want case sensitive routes, set this to true |
36 | | -$app->set('flight.log_errors', true); // if you want to log errors, set this to true |
37 | | -$app->set('flight.handle_errors', false); // if you want flight to handle errors, set this to true, otherwise Tracy will handle them |
38 | | -$app->set('flight.views.path', __DIR__ . $ds . '..' . $ds . 'views'); // set the path to your view/template/ui files |
39 | | -$app->set('flight.views.extension', '.php'); // set the file extension for your view/template/ui files |
40 | | -$app->set('flight.content_length', false); // if flight should send a content length header |
| 48 | +// Core config variables |
| 49 | +$app->set('flight.base_url', '/',); // Base URL for your app. Change if app is in a subdirectory (e.g., '/myapp/') |
| 50 | +$app->set('flight.case_sensitive', false); // Set true for case sensitive routes. Default: false |
| 51 | +$app->set('flight.log_errors', true); // Log errors to file. Recommended: true in production |
| 52 | +$app->set('flight.handle_errors', false); // Let Tracy handle errors if false. Set true to use Flight's error handler |
| 53 | +$app->set('flight.views.path', __DIR__ . $ds . '..' . $ds . 'views'); // Path to views/templates |
| 54 | +$app->set('flight.views.extension', '.php'); // View file extension (e.g., '.php', '.latte') |
| 55 | +$app->set('flight.content_length', false); // Send content length header. Usually false unless required by proxy |
41 | 56 |
|
42 | | -/* |
43 | | - * Get Tracy up and running |
44 | | - * |
45 | | - * There lots of setup options for Tracy! Logs, emails, clicking to |
46 | | - * open in your editor and a lot more! |
47 | | - * Check out the docs here: |
48 | | - * https://tracy.nette.org/ |
49 | | - */ |
50 | | -Debugger::enable(); // auto tries to figure out your environment |
51 | | -// Debugger::enable(Debugger::DEVELOPMENT) // sometimes you have to be explicit (also Debugger::PRODUCTION) |
52 | | -// Debugger::enable('23.75.345.200'); // you can also provide an array of IP addresses |
53 | | -Debugger::$logDirectory = __DIR__ . $ds . '..' . $ds . 'log'; |
54 | | -Debugger::$strictMode = true; // display all errors |
55 | | -// Debugger::$strictMode = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED; // all errors except deprecated notices |
56 | | -if (Debugger::$showBar && php_sapi_name() !== 'cli') { |
57 | | - (new TracyExtensionLoader($app)); |
58 | | -} |
59 | | - |
60 | | -/* |
61 | | - * This is where you will store database credentials, api credentials |
62 | | - * and other sensitive information. This file will not be tracked by git |
63 | | - * as you shouldn't be pushing sensitive information to a public or private |
64 | | - * repository. |
65 | | - * |
66 | | - * What you store here is totally up to you. |
67 | | - */ |
| 57 | +/********************************************** |
| 58 | + * User Configuration * |
| 59 | + **********************************************/ |
68 | 60 | return [ |
| 61 | + /************************************** |
| 62 | + * Database Settings * |
| 63 | + **************************************/ |
69 | 64 | 'database' => [ |
70 | | - // uncomment the below 4 lines for mysql |
71 | | - // 'host' => 'localhost', |
72 | | - // 'dbname' => 'dbname', |
73 | | - // 'user' => 'user', |
74 | | - // 'password' => 'password' |
| 65 | + // MySQL Example: |
| 66 | + // 'host' => 'localhost', // Database host (e.g., 'localhost', 'db.example.com') |
| 67 | + // 'dbname' => 'your_db_name', // Database name (e.g., 'flightphp') |
| 68 | + // 'user' => 'your_username', // Database user (e.g., 'root') |
| 69 | + // 'password' => 'your_password', // Database password (never commit real passwords) |
75 | 70 |
|
76 | | - // uncomment the following line for sqlite |
77 | | - // 'file_path' => __DIR__ . $ds . '..' . $ds . 'database.sqlite' |
| 71 | + // SQLite Example: |
| 72 | + // 'file_path' => __DIR__ . $ds . '..' . $ds . 'database.sqlite', // Path to SQLite file |
78 | 73 | ], |
79 | 74 |
|
80 | | - // this is just here for an example |
| 75 | + // Google OAuth Credentials |
81 | 76 | // 'google_oauth' => [ |
82 | | - // 'client_id' => 'client_id', |
83 | | - // 'client_secret' => 'client_secret', |
84 | | - // 'redirect_uri' => 'redirect_uri' |
| 77 | + // 'client_id' => 'your_client_id', // Google API client ID |
| 78 | + // 'client_secret' => 'your_client_secret', // Google API client secret |
| 79 | + // 'redirect_uri' => 'your_redirect_uri', // Redirect URI for OAuth callback |
85 | 80 | // ], |
| 81 | + |
| 82 | + // Add more configuration sections below as needed |
86 | 83 | ]; |
0 commit comments