Skip to content

Commit 73f3dbe

Browse files
committed
corrected some logic with new composer commands
1 parent 8d61f04 commit 73f3dbe

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Replace `cool-project-name` with the desired directory name for your new applica
2020

2121
This is basically a single file application. The only exception to this is the config file which is still in the `app/config/` directory. This is a good starting point for smaller projects or projects that you don't anticipate will grow much.
2222

23-
To use the simple version, you'll need to copy the `app/config/config_sample.php` file to `app/config/config.php`.
24-
2523
With the simple setup, there is two very import security steps to be aware of.
2624
- **DO NOT SAVE SENSITIVE CREDENTIALS TO THE `index.php` FILE**.
2725
- **DO NOT COMMIT ANY TYPE OF SENSITIVE CREDENTIALS TO YOUR REPOSITORY**.

app/config/config_sample.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919
setlocale(LC_ALL, 'en_US.UTF-8');
2020
}
2121

22-
/*
23-
* Set some flight variables
24-
*/
22+
// Get the $app var to use below
2523
if(empty($app)) {
2624
$app = Flight::app();
2725
}
26+
2827
// if you want to load classes that have underscores in them, comment out the following line
2928
// Loader::setV2ClassLoading(false);
29+
30+
// This autoloads your code in the app directory so you don't have to require_once everything
3031
$app->path(__DIR__ . $ds . '..' . $ds . '..');
32+
33+
// This is where you can set some flight config variables.
3134
$app->set('flight.base_url', '/'); // if this is in a subdirectory, you'll need to change this
3235
$app->set('flight.case_sensitive', false); // if you want case sensitive routes, set this to true
3336
$app->set('flight.log_errors', true); // if you want to log errors, set this to true
@@ -36,9 +39,6 @@
3639
$app->set('flight.views.extension', '.php'); // set the file extension for your view/template/ui files
3740
$app->set('flight.content_length', true); // if flight should send a content length header
3841

39-
// This breaks the browser cache headers so requests don't get cached. This is good in a dynamic application
40-
$app->response()->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
41-
4242
/*
4343
* Get Tracy up and running
4444
*

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
},
3535
"scripts": {
3636
"start": "php -S localhost:8000 -t public",
37-
"post-create-project-cmd": "@php -r \"symlink('vendor/bin/runway', 'runway');\""
37+
"post-create-project-cmd": [
38+
"@php -r \"symlink('vendor/bin/runway', 'runway');\"",
39+
"@php -r \"copy('app/config/config_sample.php', 'app/config/config.php');\""
40+
]
3841
},
3942
"require-dev": {
4043
"flightphp/tracy-extensions": "^0.1.2"

0 commit comments

Comments
 (0)