Initial commit

This commit is contained in:
2025-12-28 02:28:35 +01:00
commit 57582a2e53
11 changed files with 2855 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Command\BaseCommand;
class PackageCommand extends BaseCommand
{
protected function configure(): void
{
$this
->setName('package')
->setDescription("Package the library into a zipball, or publish directly");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Executing');
return 0;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Command\BaseCommand;
class PackageLoginCommand extends BaseCommand
{
protected function configure(): void
{
$this
->setName('package:login')
->setDescription("Login to a composer package registry");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Executing');
return 0;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Command\BaseCommand;
class PackagePublishCommand extends BaseCommand
{
protected function configure(): void
{
$this
->setName('package:publish')
->setDescription("Publish a package to a composer repository");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Executing');
return 0;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Command\BaseCommand;
class PackageUnpublishCommand extends BaseCommand
{
protected function configure(): void
{
$this
->setName('package:unpublish')
->setDescription("Unpublish a version of a package or a package from a composer repository");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Executing');
return 0;
}
}

18
src/CommandProvider.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin;
use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
class CommandProvider implements CommandProviderCapability
{
public function getCommands()
{
return [
new Command\PackageCommand(),
new Command\PackageLoginCommand(),
new Command\PackagePublishCommand(),
new Command\PackageUnpublishCommand(),
];
}
}

35
src/PackagePlugin.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace NoccyLabs\Composer\PackagePlugin;
use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Plugin\Capable;
class PackagePlugin implements PluginInterface, Capable
{
protected $composer;
protected $io;
public function activate(Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->io = $io;
}
public function deactivate(Composer $composer, IOInterface $io)
{
}
public function uninstall(Composer $composer, IOInterface $io)
{
}
public function getCapabilities()
{
return [
'Composer\Plugin\Capability\CommandProvider' => 'NoccyLabs\Composer\PackagePlugin\CommandProvider',
];
}
}