Skip to content

Commit

Permalink
feat: Allow run without config.php and give notice
Browse files Browse the repository at this point in the history
  • Loading branch information
linc committed Dec 11, 2022
1 parent a979afe commit 70e268b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Functions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
*/
function loadConfig(): array
{
return require(ROOT_DIR . '/config.php');
if (file_exists(ROOT_DIR . '/config.php')) {
return require(ROOT_DIR . '/config.php');
} else {
trigger_error('Missing config.php — Make a copy of config-sample.php!');
return require(ROOT_DIR . '/config-sample.php');
}

}

/**
Expand Down

0 comments on commit 70e268b

Please sign in to comment.