File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ final class Application
1818{
1919 public function __construct ()
2020 {
21+ // Default config
22+ if (is_file (__DIR__ . '/../../../../../unitary.config.php ' )) {
23+ // From the vendor dir
24+ EmitronKernel::setConfigFilePath (__DIR__ . '/../../../../../unitary.config.php ' );
25+ } else {
26+ // From the repo dir
27+ EmitronKernel::setConfigFilePath (__DIR__ . '/../../unitary.config.php ' );
28+ }
2129 EmitronKernel::setRouterFilePath (__DIR__ . "/ConsoleRouter.php " );
2230 }
2331
Original file line number Diff line number Diff line change 2525
2626class Kernel
2727{
28- private const DEFAULT_ROUTER_FILE = '/src/Console/ConsoleRouter.php ' ;
29- public const UNITARY_DIR = __DIR__ . '/../../ ' ;
30- public const DEFAULT_CONFIG_FILE_NAME = 'unitary.config.php ' ;
31-
3228 private ContainerInterface $ container ;
3329 private array $ userMiddlewares ;
3430 private ?DispatchConfig $ config ;
@@ -48,16 +44,6 @@ public function __construct(
4844 $ this ->container = $ container ;
4945 $ this ->userMiddlewares = $ userMiddlewares ;
5046 $ this ->config = $ dispatchConfig ;
51-
52- if (EmitronKernel::getRouterFilePath () === null ) {
53- if (is_file (__DIR__ . '/../../../../../unitary.config.php ' )) {
54- // From the vendor dir
55- EmitronKernel::setConfigFilePath (__DIR__ . '/../../../../../unitary.config ' );
56- } else {
57- // From the the repo dir
58- EmitronKernel::setConfigFilePath (__DIR__ . '/../../unitary.config.php ' );
59- }
60- }
6147 }
6248
6349 /**
You can’t perform that action at this time.
0 commit comments