Skip to content

Instantly share code, notes, and snippets.

@thepsion5
Created January 13, 2020 15:51
Show Gist options
  • Select an option

  • Save thepsion5/2a622dc88836854e68f9f63d6ee578bc to your computer and use it in GitHub Desktop.

Select an option

Save thepsion5/2a622dc88836854e68f9f63d6ee578bc to your computer and use it in GitHub Desktop.

Revisions

  1. thepsion5 created this gist Jan 13, 2020.
    15 changes: 15 additions & 0 deletions bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?php
    //FILE LOCATION: project-directory/config/bootstrap.php
    declare(strict_types=1);

    //Composer autoloader file
    require_once __DIR__ . '/../vendor/autoload.php';
    error_reporting(E_ALL | E_NOTICE);
    //Load the files required for configuration
    $configuration = require __DIR__ . '/settings.php';
    $countyList = require __DIR__ . '/../vendor/some-other-package/list-of-tennessee-counties.php';

    $app = \App\Application::createFromConfig($config, $counties);

    unset($configuration, $counties);
    return $app;
    7 changes: 7 additions & 0 deletions index.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <?php
    //FILE LOCATION: project-directory/public/index.php
    declare(strict_types=1);

    $app = require_once __DIR__ . '/../config/bootstrap.php';

    /* route handling code here */