Skip to content

Commit

Permalink
Moved commands into directories
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxwilko committed Dec 30, 2024
1 parent dd3fc6c commit 644052f
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 61 deletions.
58 changes: 29 additions & 29 deletions modules/system/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use System\Classes\ErrorHandler;
use System\Classes\Extensions\ModuleManager;
use System\Classes\Extensions\PluginManager;
use Winter\Storm\Foundation\Extension\WinterExtension;
use System\Classes\FileManifest;
use System\Classes\MailManager;
use System\Classes\MarkupManager;
Expand All @@ -32,6 +31,7 @@
use Twig\Extension\CoreExtension;
use Winter\Storm\Console\Command;
use Winter\Storm\Exception\SystemException;
use Winter\Storm\Foundation\Extension\WinterExtension;
use Winter\Storm\Router\Helper as RouterHelper;
use Winter\Storm\Support\ClassLoader;
use Winter\Storm\Support\Facades\Event;
Expand Down Expand Up @@ -314,34 +314,34 @@ protected function registerConsole()
/*
* Register console commands
*/
$this->registerConsoleCommand('create.command', \System\Console\CreateCommand::class);
$this->registerConsoleCommand('create.job', \System\Console\CreateJob::class);
$this->registerConsoleCommand('create.migration', \System\Console\CreateMigration::class);
$this->registerConsoleCommand('create.model', \System\Console\CreateModel::class);
$this->registerConsoleCommand('create.factory', \System\Console\CreateFactory::class);
$this->registerConsoleCommand('create.plugin', \System\Console\CreatePlugin::class);
$this->registerConsoleCommand('create.settings', \System\Console\CreateSettings::class);
$this->registerConsoleCommand('create.test', \System\Console\CreateTest::class);

$this->registerConsoleCommand('winter.up', \System\Console\WinterUp::class);
$this->registerConsoleCommand('winter.down', \System\Console\WinterDown::class);
$this->registerConsoleCommand('winter.update', \System\Console\WinterUpdate::class);
$this->registerConsoleCommand('winter.util', \System\Console\WinterUtil::class);
$this->registerConsoleCommand('winter.mirror', \System\Console\WinterMirror::class);
$this->registerConsoleCommand('winter.fresh', \System\Console\WinterFresh::class);
$this->registerConsoleCommand('winter.env', \System\Console\WinterEnv::class);
$this->registerConsoleCommand('winter.install', \System\Console\WinterInstall::class);
$this->registerConsoleCommand('winter.version', \System\Console\WinterVersion::class);
$this->registerConsoleCommand('winter.manifest', \System\Console\WinterManifest::class);
$this->registerConsoleCommand('winter.test', \System\Console\WinterTest::class);

$this->registerConsoleCommand('plugin.install', \System\Console\PluginInstall::class);
$this->registerConsoleCommand('plugin.remove', \System\Console\PluginRemove::class);
$this->registerConsoleCommand('plugin.disable', \System\Console\PluginDisable::class);
$this->registerConsoleCommand('plugin.enable', \System\Console\PluginEnable::class);
$this->registerConsoleCommand('plugin.refresh', \System\Console\PluginRefresh::class);
$this->registerConsoleCommand('plugin.rollback', \System\Console\PluginRollback::class);
$this->registerConsoleCommand('plugin.list', \System\Console\PluginList::class);
$this->registerConsoleCommand('create.command', Console\Create\CreateCommand::class);
$this->registerConsoleCommand('create.job', Console\Create\CreateJob::class);
$this->registerConsoleCommand('create.migration', Console\Create\CreateMigration::class);
$this->registerConsoleCommand('create.model', Console\Create\CreateModel::class);
$this->registerConsoleCommand('create.factory', Console\Create\CreateFactory::class);
$this->registerConsoleCommand('create.plugin', Console\Create\CreatePlugin::class);
$this->registerConsoleCommand('create.settings', Console\Create\CreateSettings::class);
$this->registerConsoleCommand('create.test', Console\Create\CreateTest::class);

$this->registerConsoleCommand('winter.up', Console\WinterUp::class);
$this->registerConsoleCommand('winter.down', Console\WinterDown::class);
$this->registerConsoleCommand('winter.update', Console\WinterUpdate::class);
$this->registerConsoleCommand('winter.util', Console\WinterUtil::class);
$this->registerConsoleCommand('winter.mirror', Console\WinterMirror::class);
$this->registerConsoleCommand('winter.fresh', Console\WinterFresh::class);
$this->registerConsoleCommand('winter.env', Console\WinterEnv::class);
$this->registerConsoleCommand('winter.install', Console\WinterInstall::class);
$this->registerConsoleCommand('winter.version', Console\WinterVersion::class);
$this->registerConsoleCommand('winter.manifest', Console\WinterManifest::class);
$this->registerConsoleCommand('winter.test', Console\WinterTest::class);

$this->registerConsoleCommand('plugin.install', Console\Plugin\PluginInstall::class);
$this->registerConsoleCommand('plugin.remove', Console\Plugin\PluginRemove::class);
$this->registerConsoleCommand('plugin.disable', Console\Plugin\PluginDisable::class);
$this->registerConsoleCommand('plugin.enable', Console\Plugin\PluginEnable::class);
$this->registerConsoleCommand('plugin.refresh', Console\Plugin\PluginRefresh::class);
$this->registerConsoleCommand('plugin.rollback', Console\Plugin\PluginRollback::class);
$this->registerConsoleCommand('plugin.list', Console\Plugin\PluginList::class);

$this->registerConsoleCommand('mix.compile', Console\Asset\Mix\MixCompile::class);
$this->registerConsoleCommand('mix.config', Console\Asset\Mix\MixCreate::class);
Expand Down
16 changes: 8 additions & 8 deletions modules/system/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@
'Illuminate\Support\Debug\HtmlDumper' => Symfony\Component\VarDumper\Dumper\HtmlDumper::class,

// Scaffolds were moved from the Storm library into their corresponding modules.
'Winter\Storm\Scaffold\Console\CreateCommand' => System\Console\CreateCommand::class,
'Winter\Storm\Scaffold\Console\CreateModel' => System\Console\CreateModel::class,
'Winter\Storm\Scaffold\Console\CreatePlugin' => System\Console\CreatePlugin::class,
'Winter\Storm\Scaffold\Console\CreateSettings' => System\Console\CreateSettings::class,
'Winter\Storm\Scaffold\Console\CreateCommand' => System\Console\Create\CreateCommand::class,
'Winter\Storm\Scaffold\Console\CreateModel' => System\Console\Create\CreateModel::class,
'Winter\Storm\Scaffold\Console\CreatePlugin' => System\Console\Create\CreatePlugin::class,
'Winter\Storm\Scaffold\Console\CreateSettings' => System\Console\Create\CreateSettings::class,
'Winter\Storm\Scaffold\Console\CreateController' => Backend\Console\CreateController::class,
'Winter\Storm\Scaffold\Console\CreateFormWidget' => Backend\Console\CreateFormWidget::class,
'Winter\Storm\Scaffold\Console\CreateReportWidget' => Backend\Console\CreateReportWidget::class,
'Winter\Storm\Scaffold\Console\CreateTheme' => Cms\Console\CreateTheme::class,
'Winter\Storm\Scaffold\Console\CreateComponent' => Cms\Console\CreateComponent::class,

'October\Rain\Scaffold\Console\CreateCommand' => System\Console\CreateCommand::class,
'October\Rain\Scaffold\Console\CreateModel' => System\Console\CreateModel::class,
'October\Rain\Scaffold\Console\CreatePlugin' => System\Console\CreatePlugin::class,
'October\Rain\Scaffold\Console\CreateSettings' => System\Console\CreateSettings::class,
'October\Rain\Scaffold\Console\CreateCommand' => System\Console\Create\CreateCommand::class,
'October\Rain\Scaffold\Console\CreateModel' => System\Console\Create\CreateModel::class,
'October\Rain\Scaffold\Console\CreatePlugin' => System\Console\Create\CreatePlugin::class,
'October\Rain\Scaffold\Console\CreateSettings' => System\Console\Create\CreateSettings::class,
'October\Rain\Scaffold\Console\CreateController' => Backend\Console\CreateController::class,
'October\Rain\Scaffold\Console\CreateFormWidget' => Backend\Console\CreateFormWidget::class,
'October\Rain\Scaffold\Console\CreateReportWidget' => Backend\Console\CreateReportWidget::class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use InvalidArgumentException;
use System\Console\BaseScaffoldCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use System\Console\BaseScaffoldCommand;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use System\Console\BaseScaffoldCommand;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use InvalidArgumentException;
use System\Classes\Extensions\Plugins\PluginVersionManager;
use System\Console\BaseScaffoldCommand;
use Winter\Storm\Database\Model;
use Winter\Storm\Support\Str;
use Yaml;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use Winter\Storm\Support\Str;
use System\Console\BaseScaffoldCommand;
use Winter\Storm\Support\Str;

class CreateModel extends BaseScaffoldCommand
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use System\Console\BaseScaffoldCommand;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Create;

use System\Console\BaseScaffoldCommand;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace System\Console;
namespace System\Console\Create;

use System\Console\BaseScaffoldCommand;
use Winter\Storm\Support\Str;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use System\Classes\Extensions\PluginManager;
use System\Console\Traits;
use Winter\Storm\Console\Command;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use System\Classes\Extensions\PluginManager;
use System\Console\Traits;
use Winter\Storm\Console\Command;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use System\Classes\Extensions\PluginManager;
use System\Classes\UpdateManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;
use System\Classes\Extensions\PluginManager;
use System\Models\PluginVersion;
use Winter\Storm\Console\Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use System\Classes\Extensions\PluginManager;
use System\Console\Traits;
use Winter\Storm\Console\Command;
use System\Classes\UpdateManager;

/**
* Console command to refresh a plugin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use File;
use System\Classes\Extensions\PluginManager;
use System\Classes\UpdateManager;
use System\Console\Traits;
use Winter\Storm\Console\Command;
use Winter\Storm\Exception\ApplicationException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php namespace System\Console;
<?php

namespace System\Console\Plugin;

use InvalidArgumentException;
use System\Classes\Extensions\PluginManager;
use System\Console\Traits;
use Winter\Storm\Console\Command;
use System\Classes\UpdateManager;
use System\Classes\VersionManager;

/**
* Console command to rollback a plugin.
Expand Down Expand Up @@ -37,7 +38,7 @@ class PluginRollback extends Command

/**
* Execute the console command.
* @throws Exception if the UpdateManager is unable to rollback the requested plugin to the requested version
* @throws \Exception if the UpdateManager is unable to rollback the requested plugin to the requested version
* @throws InvalidArgumentException if the requested rollback version can't be found
*/
public function handle(): int
Expand Down

0 comments on commit 644052f

Please sign in to comment.