first commit.

This commit is contained in:
kj
2026-10-05 15:08:39 -03:00
commit b7799f9fff
93 changed files with 8966 additions and 0 deletions
@@ -0,0 +1,44 @@
<?php
namespace Toolbox\Commands;
use Toolbox\Installer;
use Toolbox\ToolboxException;
final class RemoveCommand extends Command
{
public static function describe(): string
{
return 'Quita componentes instalados (sólo sus archivos)';
}
public function run(array $args): int
{
$parsed = $this->parse($args);
if ($parsed['args'] === []) {
$this->console->error('Indica al menos un componente (paquete:componente).');
return 1;
}
$root = $this->root($parsed['options']);
$toolbox = $this->toolboxDir($parsed['options']);
$installer = new Installer($root, $toolbox, $this->console, $this->rootCore($parsed['options'], $root));
try {
$result = $installer->remove($parsed['args'], $this->behaviorOptions($parsed['options']));
} catch (ToolboxException $e) {
$this->console->error($e->getMessage());
return 1;
}
foreach ($result['removed'] as $id) {
$this->console->ok('quitado ' . $id);
}
foreach ($result['aborted'] as $aborted) {
$this->console->error('abortado (edición local): ' . $aborted);
}
return $result['aborted'] === [] ? 0 : 1;
}
}