Skip to content

Commit

Permalink
corrected some logic with new composer commands
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed Jun 29, 2024
1 parent 8d61f04 commit 73f3dbe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Replace `cool-project-name` with the desired directory name for your new applica

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.

To use the simple version, you'll need to copy the `app/config/config_sample.php` file to `app/config/config.php`.

With the simple setup, there is two very import security steps to be aware of.
- **DO NOT SAVE SENSITIVE CREDENTIALS TO THE `index.php` FILE**.
- **DO NOT COMMIT ANY TYPE OF SENSITIVE CREDENTIALS TO YOUR REPOSITORY**.
Expand Down
12 changes: 6 additions & 6 deletions app/config/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
setlocale(LC_ALL, 'en_US.UTF-8');
}

/*
* Set some flight variables
*/
// Get the $app var to use below
if(empty($app)) {
$app = Flight::app();
}

// if you want to load classes that have underscores in them, comment out the following line
// Loader::setV2ClassLoading(false);

// This autoloads your code in the app directory so you don't have to require_once everything
$app->path(__DIR__ . $ds . '..' . $ds . '..');

// This is where you can set some flight config variables.
$app->set('flight.base_url', '/'); // if this is in a subdirectory, you'll need to change this
$app->set('flight.case_sensitive', false); // if you want case sensitive routes, set this to true
$app->set('flight.log_errors', true); // if you want to log errors, set this to true
Expand All @@ -36,9 +39,6 @@
$app->set('flight.views.extension', '.php'); // set the file extension for your view/template/ui files
$app->set('flight.content_length', true); // if flight should send a content length header

// This breaks the browser cache headers so requests don't get cached. This is good in a dynamic application
$app->response()->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');

/*
* Get Tracy up and running
*
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
},
"scripts": {
"start": "php -S localhost:8000 -t public",
"post-create-project-cmd": "@php -r \"symlink('vendor/bin/runway', 'runway');\""
"post-create-project-cmd": [
"@php -r \"symlink('vendor/bin/runway', 'runway');\"",
"@php -r \"copy('app/config/config_sample.php', 'app/config/config.php');\""
]
},
"require-dev": {
"flightphp/tracy-extensions": "^0.1.2"
Expand Down

0 comments on commit 73f3dbe

Please sign in to comment.