Making bin/daenerys more extensible

In order to make bin/daenerys more extensible and usable from outside with
more configuration, the bootstrap of the game object has been moved to
bin/daenerys where it is a closure stored in LotGD\Core\Console\Main.
Commands now call Main::createGame() instead of Bootstrap::createGame().

Added the command database:init

Merges #43
Closes #40
This commit is contained in:
Basilius Sauter
2016-07-18 19:42:46 +02:00
parent 6083e5c170
commit 77aab6f9cb
5 changed files with 75 additions and 8 deletions
+8 -1
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env php
<?php
use LotGD\Core\Bootstrap;
function includeIfExists($file)
{
if (file_exists($file)) {
@@ -13,4 +16,8 @@ includeIfExists(getcwd() . '/vendor/autoload.php') ||
includeIfExists(__DIR__ . '/../vendor/autoload.php') ||
includeIfExists(__DIR__ . '/../autoload.php');
LotGD\Core\Console\Main::main();
$loader = function () {
return Bootstrap::createGame();
};
LotGD\Core\Console\Main::main($loader);