File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1616function Boot ( string $ ConfigPath ) : Application
1717{
1818 /** @var Neuron\Data\Setting\Source\ISettingSource $Settings */
19- $ Settings = new Yaml ( "$ ConfigPath/config.yaml " );
2019
21- $ BasePath = $ Settings ->get ( 'system ' , 'base_path ' );
20+ try
21+ {
22+ $ Settings = new Yaml ( "$ ConfigPath/config.yaml " );
23+ $ BasePath = $ Settings ->get ( 'system ' , 'base_path ' );
24+ }
25+ catch ( Exception $ e )
26+ {
27+ $ Settings = null ;
28+ $ BasePath = getenv ( 'SYSTEM_BASE_PATH ' ) ? : '. ' ;
29+ }
2230
2331 $ Version = new Version ();
2432 $ Version ->loadFromFile ( "$ BasePath/version.json " );
Original file line number Diff line number Diff line change @@ -15,5 +15,12 @@ public function testBootstrap()
1515 Dispatch ( $ App );
1616 }
1717
18+ public function testMissingConfig ()
19+ {
20+ $ cwd = getcwd ();
21+ $ App = Boot ( 'examples/non-there ' );
22+ $ this ->assertTrue ( is_object ( $ App ) );
1823
24+ Dispatch ( $ App );
25+ }
1926}
You can’t perform that action at this time.
0 commit comments