GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — dev-master ( af39f5...6388f1 )
by Vijay
02:39
created

CLI.php ➔ boot()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 47
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 3
eloc 26
c 3
b 0
f 0
nc 4
nop 0
dl 0
loc 47
rs 9.0303
1
<?php
2
3
namespace App;
4
5
/**
6
 * Load, configure, run application
7
 */
8
function boot()
9
{
10
    if (session_status() == PHP_SESSION_NONE) {
11
        ini_set('session.auto_start', 'Off');
12
    } else {
13
        ini_set('session.lazy_write', 'On');
14
    }
15
16
    chdir(realpath(__DIR__ . '/../../'));
17
    require_once '../lib/autoload.php';
18
19
    // bootstrap initial environment
20
    $f3 = \Base::instance();
21
22
    if (empty($f3->get('CLI'))) {
23
        die('This can only be executed in CLI mode.');
1 ignored issue
show
Coding Style Compatibility introduced by
The function boot() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
24
    }
25
26
    \FFMVC\App::start();
27
    $f3->set('UNLOAD', function () {
28
        \FFMVC\App::finish();
29
    });
30
31
    // load dependency injection container
32
    $dice = new \Dice\Dice;
33
34
    // logging for application
35
    $logfile = $f3->get('log.file');
36
    $dice->addRule('Log', ['shared' => true, 'constructParams' => [$logfile]]);
37
38
    // database connection used by app
39
    $dbConfig = $f3->get('db');
40
    $dice->addRule('DB\\SQL', ['shared' => true, 'constructParams' => [
41
        \FFMVC\Helpers\DB::createDbDsn($dbConfig),
42
        $dbConfig['user'],
43
        $dbConfig['pass'],
44
        [\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION],
45
    ]]);
46
47
    // auto-create database if options set
48
    \App\Setup::database($dice);
49
50
    // run the main application
51
    require_once 'lib/App/App.php';
52
    $app = $dice->create('App\\App');
53
    $app->Main();
54
}
55
56
// run the application
57
boot();
58