Skip to content

Commit 5bd10e7

Browse files
committed
refactor(bootstrap.php): removed unnecesary $ds
1 parent 6c82d6c commit 5bd10e7

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

app/config/bootstrap.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
* required services, plugins, connections, etc. are loaded and ready to go
66
* for every request made to the application.
77
*/
8+
require_once __DIR__ . '/../../vendor/autoload.php';
89

9-
$ds = DIRECTORY_SEPARATOR;
10-
require_once __DIR__ . $ds . '..' . $ds . '..' . $ds . 'vendor' . $ds . 'autoload.php';
11-
12-
if (file_exists(__DIR__ . $ds . 'config.php') === false) {
10+
if (!file_exists(__DIR__ . '/config.php')) {
1311
Flight::halt(500, 'Config file not found. Please create a config.php file in the app/config directory to get started.');
1412
}
1513

1614
// this has to be hard code required because autoload hasn't been registered yet.
17-
require_once __DIR__ . $ds . '..' . $ds . 'utils' . $ds . 'CustomFlight.php';
15+
require_once __DIR__ . '/../utils/CustomFlight.php';
1816

1917
// It is better practice to not use static methods for everything. It makes your
2018
// app much more difficult to unit test easily.
@@ -25,7 +23,7 @@
2523
* P.S. When you require a php file and that file returns an array, the array
2624
* will be returned by the require statement where you can assign it to a var.
2725
*/
28-
$config = require __DIR__ . $ds . 'config.php';
26+
$config = require __DIR__ . '/config.php';
2927
$app->set('config', $config);
3028

3129
// Whip out the ol' router and we'll pass that to the routes file
@@ -38,7 +36,7 @@
3836
* When someone hits that URL, you point them to a function or method
3937
* that will handle the request.
4038
*/
41-
require_once __DIR__ . $ds . 'routes.php';
39+
require_once __DIR__ . '/routes.php';
4240

4341
/*
4442
* You additionally could just define the routes in this file. It's up to you.
@@ -63,7 +61,7 @@
6361
* That's a discussion for another day. Suffice to say, that Flight has a basic concept
6462
* of a services container by registering classes to the Engine class.
6563
*/
66-
require_once __DIR__ . $ds . 'services.php';
64+
require_once __DIR__ . '/services.php';
6765

6866
// At this point, your app should have all the instructions it needs and it'll
6967
// "start" processing everything. This is where the magic happens.

public/index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@
2424
Cessna 402 (Wings)
2525
by Dick Williams, [email protected]
2626
*/
27-
$ds = DIRECTORY_SEPARATOR;
28-
require_once __DIR__ . $ds . '..' . $ds . 'app' . $ds . 'config' . $ds . 'bootstrap.php';
27+
require_once __DIR__ . '/../app/config/bootstrap.php';

0 commit comments

Comments
 (0)