Passed
Pull Request — 4 (#10016)
by Ingo
07:25
created

DatabaselessKernel::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace SilverStripe\Core;
4
5
use SilverStripe\EventDispatcher\Dispatch\Dispatcher;
6
use SilverStripe\EventDispatcher\Event\EventContextInterface;
7
use SilverStripe\EventDispatcher\Event\EventHandlerInterface;
8
use SilverStripe\ORM\Connect\NullDatabase;
9
use SilverStripe\ORM\DB;
10
11
/**
12
 * Boot a kernel without requiring a database connection.
13
 * This is a workaround for the lack of composition in the boot stages
14
 * of CoreKernel, as well as for the framework's misguided assumptions
15
 * around the availability of a database for every execution path.
16
 *
17
 * @internal
18
 */
19
class DatabaselessKernel extends CoreKernel
20
{
21
    protected $queryErrorMessage = 'Booted with DatabaseLessKernel, cannot execute query: %s';
22
23
    public function boot($flush = false)
24
    {
25
        $this->flush = $flush;
0 ignored issues
show
Bug introduced by
The property flush is declared private in SilverStripe\Core\CoreKernel and cannot be accessed from this context.
Loading history...
26
27
        $this->bootPHP();
28
        $this->bootManifests($flush);
29
        $this->bootErrorHandling();
30
        $this->bootConfigs();
31
32
        $this->booted = true;
0 ignored issues
show
Bug introduced by
The property booted is declared private in SilverStripe\Core\CoreKernel and cannot be accessed from this context.
Loading history...
33
    }
34
35
}
36