composer-plugincomposer/composercomposer-plugin-apiPluginInterfacenamespace MyComposerPlugin;
use ComposerPluginPluginInterface;
use ComposerIOIOInterface;
use ComposerComposer;
use ComposerEventDispatcherEventSubscriberInterface;
use ComposerPluginCapabilityCommandProvider as CommandProviderCapability;
class Plugin implements PluginInterface, EventSubscriberInterface
{
public function activate(Composer $composer, IOInterface $io)
{
// 注册命令提供者
}
public function getCapabilities()
{
return [
'ComposerPluginCapabilityCommandProvider' => 'MyComposerPluginCommandProvider'
];
}getCapabilities()Commandnamespace MyComposerPlugin;
use SymfonyComponentConsoleCommandCommand;
use SymfonyComponentConsoleInputInputInterface;
use SymfonyComponentConsoleOutputOutputInterface;
class MyCommand extends Command
{
protected function configure()
{
$this->setName('my-command')
->setDescription('这是一个自定义 Composer 命令');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('自定义命令执行成功! ');
return Command::SUCCESS;
}namespace MyComposerPlugin;
use ComposerPluginCapabilityCommandProvider as CommandProviderCapability;
Midjourney AI 提示词工具
PHP中文网提供Midjourney AI 提示词在线生成工具,专为解决 AI 绘画“词穷”痛点而生,用户只需输入“一只猫”等简单想法,工具便能利用 AI 智能扩展出包含艺术风格、光影构图、镜头参数及负面提示词的专业级英文 Prompt。它完美兼容 Midjourney V8.1 及 Niji 模型,支持一键复制与参数自动优化,大幅降低创作门槛,是提升出图质量与效率的必备辅助神器。
下载
class CommandProvider implements CommandProviderCapability
{
public function getCommands()
{
return [new MyCommand()];
}
}
getCommands()composer installCommandProvidertypeextra.class