Skip to content

Commit

Permalink
Merge pull request #27 from PhpSlides/dev
Browse files Browse the repository at this point in the history
Completed Command for creating forge database & tables and styled ASC…
  • Loading branch information
dconco authored Sep 1, 2024
2 parents 4a6ebc1 + 8fba2d3 commit ed0d3dc
Show file tree
Hide file tree
Showing 30 changed files with 909 additions and 501 deletions.
7 changes: 0 additions & 7 deletions ChangeLog.md

This file was deleted.

22 changes: 19 additions & 3 deletions Console/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Console extends Command implements CommandInterface, ConsoleInterface
private static array $listen = [];
private static bool $serve = false;
private static bool $is_debug = false;
private static string $resolve = 'src/bootstrap';
private static string $resolve = 'src/bootstrap/';
private static ?array $commands = null;

/**
Expand All @@ -38,12 +38,16 @@ public function __construct(array $argv)
$arguments = array_slice($command, 1);
$options = getopt('h', ['help']);

if (isset($options['help']) || isset($options['h'])) {
if (
isset($options['help']) ||
isset($options['h']) ||
!isset($command[0])
) {
self::showHelp();
}

# Handle commands
switch ($command[0] ?? null) {
switch ($command[0]) {
case 'serve':
self::$serve = true;
break;
Expand Down Expand Up @@ -75,6 +79,15 @@ public function __construct(array $argv)
self::$commands = ['auth-guard', $arguments];
break;

case 'make:forge-db':
if (count($arguments) < 1) {
exit(
"[db] argument is required! Type --help for list of commands\n"
);
}
self::$commands = ['forge-db', $arguments];
break;

case 'generate:secret-key':
self::$commands = ['secret-key', $arguments];
break;
Expand Down Expand Up @@ -114,6 +127,9 @@ public function __destruct()
case 'auth-guard':
self::makeAuthGuard(self::$commands[1], self::$resolve);
break;
case 'forge-db':
self::makeForgeDB(self::$commands[1], self::$resolve);
break;
case 'secret-key':
self::generateSecretKey(self::$commands[1]);
break;
Expand Down
Loading

0 comments on commit ed0d3dc

Please sign in to comment.