Initial commit

This commit is contained in:
Chris 2025-03-12 16:15:15 +01:00
commit c4877471f8
10 changed files with 1388 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/vendor/
/*.phar
/*.yaml

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
.PHONY: help all phar
help:
@echo "\e[1mTargets:\e[0m"
@echo " \e[3mall\e[0m — build everything\n \e[3mphar\e[0m — build the phar"
all: phar
phar:
box compile
mv bin/slotcli.phar ./slotcli.phar

4
bin/slotcli Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php
require_once __DIR__."/../src/bootstrap.php";

31
composer.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "slotdb/cli",
"description": "SlotDB command line client",
"type": "application",
"license": "GPL-2.0-or-later",
"autoload": {
"psr-4": {
"SlotDb\\Cli\\": "src/"
}
},
"authors": [
{
"name": "Christopher Vagnetoft",
"email": "labs@noccy.com"
}
],
"require": {
"slotdb/client": "@dev",
"guzzlehttp/guzzle": "^7.9",
"symfony/console": "^7.2"
},
"repositories": {
"slotdb-client": {
"type": "vcs",
"url": "../slotdb-client-php"
}
},
"bin": [
"bin/slotcli"
]
}

1284
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

14
src/Application.php Normal file
View File

@ -0,0 +1,14 @@
<?php
namespace SlotDb\Cli;
class Application extends \Symfony\Component\Console\Application
{
public function __construct()
{
parent::__construct("slotcli", "0.0.0");
$this->add(new Command\ImportCommand());
$this->add(new Command\ExportCommand());
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace SlotDb\Cli\Command;
use Symfony\Component\Console\Command\Command;
abstract class BaseCommand extends Command
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace SlotDb\Cli\Command;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name:"export", description:"Export the database to a file")]
class ExportCommand extends BaseCommand
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace SlotDb\Cli\Command;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name:"import", description:"Import database from file")]
class ImportCommand extends BaseCommand
{
}

7
src/bootstrap.php Normal file
View File

@ -0,0 +1,7 @@
<?php
require_once __DIR__."/../vendor/autoload.php";
$app = new SlotDb\Cli\Application();
$app->run();