Print warning when trying to create short URL from CLI on openswoole in verbose mode

This commit is contained in:
Alejandro Celaya
2023-04-12 18:30:02 +02:00
parent f078d95588
commit 399c56a097
4 changed files with 67 additions and 5 deletions

View File

@@ -176,6 +176,11 @@ class CreateShortUrlCommand extends Command
ShortUrlInputFilter::FORWARD_QUERY => !$input->getOption('no-forward-query'),
], $this->options));
$result->onEventDispatchingError(static fn () => $io->isVerbose() && $io->warning(
'Short URL properly created, but the real-time updates cannot be notified when generating the '
. 'short URL from the command line. Migrate to roadrunner in order to bypass this limitation.',
));
$io->writeln([
sprintf('Processed long URL: <info>%s</info>', $longUrl),
sprintf('Generated short URL: <info>%s</info>', $this->stringifier->stringify($result->shortUrl)),