1
0
Fork 0
mirror of synced 2024-09-09 14:21:24 +12:00

tasks get name function

This commit is contained in:
Damodar Lohani 2022-08-02 01:58:36 +00:00
parent b6ddf2a451
commit 6b2b9d0fde
11 changed files with 53 additions and 20 deletions

View file

@ -13,7 +13,10 @@ use Utopia\Platform\Action;
class Doctor extends Action
{
public const NAME = 'doctor';
public static function getName(): string
{
return 'doctor';
}
public function __construct()
{

View file

@ -14,7 +14,10 @@ use Utopia\Platform\Action;
class Install extends Action
{
public const NAME = 'install';
public static function getName(): string
{
return 'install';
}
public function __construct()
{

View file

@ -17,7 +17,10 @@ use Utopia\Platform\Action;
class Maintenance extends Action
{
public const NAME = 'maintenance';
public static function getName(): string
{
return 'maintenance';
}
protected function getConsoleDB(): Database
{

View file

@ -16,11 +16,15 @@ use Swoole\Event;
class Migrate extends Action
{
public const NAME = 'migrate';
public static function getName(): string
{
return 'migrate';
}
public function __construct()
{
$this
->desc('Migrate Appwrite to new version')
->param('version', APP_VERSION_STABLE, new Text(8), 'Version to migrate to.', true)
->callback(fn ($version) => $this->action($version));
}

View file

@ -27,11 +27,15 @@ use Throwable;
class SDKs extends Action
{
public const NAME = 'sdks';
public static function getName(): string
{
return 'sdks';
}
public function __construct()
{
$this
->desc('Generate Appwrite SDKs')
->callback(fn () => $this->action());
}

View file

@ -11,7 +11,10 @@ use Utopia\Validator\Hostname;
class SSL extends Action
{
public const NAME = 'ssl';
public static function getName(): string
{
return 'ssl';
}
public function __construct()
{

View file

@ -18,11 +18,15 @@ use Exception;
class Specs extends Action
{
public const NAME = 'specs';
public static function getName(): string
{
return 'specs';
}
public function __construct()
{
$this
->desc('Generate Appwrite API specifications')
->param('version', 'latest', new Text(8), 'Spec version', true)
->param('mode', 'normal', new WhiteList(['normal', 'mocks']), 'Spec Mode', true)
->callback(fn ($version, $mode) => $this->action($version, $mode));

View file

@ -12,7 +12,10 @@ use Utopia\Database\Validator\Authorization;
class Usage extends Task
{
public const NAME = 'usage';
public static function getName(): string
{
return 'usage';
}
public function __construct()
{

View file

@ -9,7 +9,10 @@ use Utopia\Platform\Action;
class Vars extends Action
{
public const NAME = 'vars';
public static function getName(): string
{
return 'vars';
}
public function __construct()
{

View file

@ -8,7 +8,10 @@ use Utopia\Platform\Action;
class Version extends Action
{
public const NAME = 'version';
public static function getName(): string
{
return 'version';
}
public function __construct()
{

View file

@ -20,15 +20,15 @@ class TasksService extends Service
{
$this->type = self::TYPE_CLI;
$this
->addAction(Version::NAME, new Version())
->addAction(Usage::NAME, new Usage())
->addAction(Vars::NAME, new Vars())
->addAction(SSL::NAME, new SSL())
->addAction(Doctor::NAME, new Doctor())
->addAction(Install::NAME, new Install())
->addAction(Maintenance::NAME, new Maintenance())
->addAction(Migrate::NAME, new Migrate())
->addAction(SDKs::NAME, new SDKs())
->addAction(Specs::NAME, new Specs());
->addAction(Version::getName(), new Version())
->addAction(Usage::getName(), new Usage())
->addAction(Vars::getName(), new Vars())
->addAction(SSL::getName(), new SSL())
->addAction(Doctor::getName(), new Doctor())
->addAction(Install::getName(), new Install())
->addAction(Maintenance::getName(), new Maintenance())
->addAction(Migrate::getName(), new Migrate())
->addAction(SDKs::getName(), new SDKs())
->addAction(Specs::getName(), new Specs());
}
}