From 1eff9801e86676926e5af6a7bbe40181fb4bb29d Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 16 Sep 2018 18:36:02 +0200 Subject: [PATCH 1/3] Updated references to short code and replaced them to short URL where appropriate --- module/CLI/config/cli.config.php | 12 +++++----- module/CLI/config/dependencies.config.php | 24 +++++++++---------- .../Command/Config/GenerateCharsetCommand.php | 2 +- .../DeleteShortUrlCommand.php} | 10 ++++---- .../GeneratePreviewCommand.php | 6 ++--- .../GenerateShortUrlCommand.php} | 10 ++++---- .../GetVisitsCommand.php | 6 ++--- .../ListShortUrlsCommand.php} | 10 ++++---- .../ResolveUrlCommand.php | 6 ++--- .../DeleteShortCodeCommandTest.php | 6 ++--- .../GeneratePreviewCommandTest.php | 4 ++-- .../GenerateShortcodeCommandTest.php | 6 ++--- .../GetVisitsCommandTest.php | 4 ++-- .../ListShortcodesCommandTest.php | 6 ++--- .../ResolveUrlCommandTest.php | 4 ++-- 15 files changed, 58 insertions(+), 58 deletions(-) rename module/CLI/src/Command/{Shortcode/DeleteShortCodeCommand.php => ShortUrl/DeleteShortUrlCommand.php} (92%) rename module/CLI/src/Command/{Shortcode => ShortUrl}/GeneratePreviewCommand.php (93%) rename module/CLI/src/Command/{Shortcode/GenerateShortcodeCommand.php => ShortUrl/GenerateShortUrlCommand.php} (95%) rename module/CLI/src/Command/{Shortcode => ShortUrl}/GetVisitsCommand.php (95%) rename module/CLI/src/Command/{Shortcode/ListShortcodesCommand.php => ShortUrl/ListShortUrlsCommand.php} (95%) rename module/CLI/src/Command/{Shortcode => ShortUrl}/ResolveUrlCommand.php (94%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/DeleteShortCodeCommandTest.php (94%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/GeneratePreviewCommandTest.php (96%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/GenerateShortcodeCommandTest.php (90%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/GetVisitsCommandTest.php (96%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/ListShortcodesCommandTest.php (94%) rename module/CLI/test/Command/{Shortcode => ShortUrl}/ResolveUrlCommandTest.php (96%) diff --git a/module/CLI/config/cli.config.php b/module/CLI/config/cli.config.php index eb27be7f..501cb668 100644 --- a/module/CLI/config/cli.config.php +++ b/module/CLI/config/cli.config.php @@ -9,12 +9,12 @@ return [ 'cli' => [ 'locale' => Common\env('CLI_LOCALE', 'en'), 'commands' => [ - Command\Shortcode\GenerateShortcodeCommand::NAME => Command\Shortcode\GenerateShortcodeCommand::class, - Command\Shortcode\ResolveUrlCommand::NAME => Command\Shortcode\ResolveUrlCommand::class, - Command\Shortcode\ListShortcodesCommand::NAME => Command\Shortcode\ListShortcodesCommand::class, - Command\Shortcode\GetVisitsCommand::NAME => Command\Shortcode\GetVisitsCommand::class, - Command\Shortcode\GeneratePreviewCommand::NAME => Command\Shortcode\GeneratePreviewCommand::class, - Command\Shortcode\DeleteShortCodeCommand::NAME => Command\Shortcode\DeleteShortCodeCommand::class, + Command\ShortUrl\GenerateShortUrlCommand::NAME => Command\ShortUrl\GenerateShortUrlCommand::class, + Command\ShortUrl\ResolveUrlCommand::NAME => Command\ShortUrl\ResolveUrlCommand::class, + Command\ShortUrl\ListShortUrlsCommand::NAME => Command\ShortUrl\ListShortUrlsCommand::class, + Command\ShortUrl\GetVisitsCommand::NAME => Command\ShortUrl\GetVisitsCommand::class, + Command\ShortUrl\GeneratePreviewCommand::NAME => Command\ShortUrl\GeneratePreviewCommand::class, + Command\ShortUrl\DeleteShortUrlCommand::NAME => Command\ShortUrl\DeleteShortUrlCommand::class, Command\Visit\ProcessVisitsCommand::NAME => Command\Visit\ProcessVisitsCommand::class, diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 065c720c..f6f441c6 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -17,12 +17,12 @@ return [ 'factories' => [ Application::class => ApplicationFactory::class, - Command\Shortcode\GenerateShortcodeCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ResolveUrlCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ListShortcodesCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GetVisitsCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GeneratePreviewCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\DeleteShortCodeCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GenerateShortUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ResolveUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ListShortUrlsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GetVisitsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GeneratePreviewCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\DeleteShortUrlCommand::class => ConfigAbstractFactory::class, Command\Visit\ProcessVisitsCommand::class => ConfigAbstractFactory::class, @@ -41,24 +41,24 @@ return [ ], ConfigAbstractFactory::class => [ - Command\Shortcode\GenerateShortcodeCommand::class => [ + Command\ShortUrl\GenerateShortUrlCommand::class => [ Service\UrlShortener::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], - Command\Shortcode\ListShortcodesCommand::class => [ + Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], + Command\ShortUrl\ListShortUrlsCommand::class => [ Service\ShortUrlService::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], - Command\Shortcode\GeneratePreviewCommand::class => [ + Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], + Command\ShortUrl\GeneratePreviewCommand::class => [ Service\ShortUrlService::class, PreviewGenerator::class, 'translator', ], - Command\Shortcode\DeleteShortCodeCommand::class => [ + Command\ShortUrl\DeleteShortUrlCommand::class => [ Service\ShortUrl\DeleteShortUrlService::class, 'translator', ], diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php index caa64c28..c7287f7f 100644 --- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php +++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php @@ -28,7 +28,7 @@ class GenerateCharsetCommand extends Command public function configure() { $this->setName(self::NAME) - ->setDescription(sprintf($this->translator->translate( + ->setDescription(\sprintf($this->translator->translate( 'Generates a character set sample just by shuffling the default one, "%s". ' . 'Then it can be set in the SHORTCODE_CHARS environment variable' ), UrlShortener::DEFAULT_CHARS)); diff --git a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php similarity index 92% rename from module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php rename to module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php index f02750a1..50fed1c4 100644 --- a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php +++ b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php @@ -1,7 +1,7 @@ addArgument( 'shortCode', InputArgument::REQUIRED, - $this->translator->translate('The short code to be deleted') + $this->translator->translate('The short code for the short URL to be deleted') ) ->addOption( 'ignore-threshold', diff --git a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php similarity index 93% rename from module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php rename to module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index e777b331..3b41eb44 100644 --- a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -1,7 +1,7 @@ setName(self::NAME) ->setAliases(self::ALIASES) ->setDescription( - $this->translator->translate('Generates a short code for provided URL and returns the short URL') + $this->translator->translate('Generates a short URL for provided long URL and returns it') ) ->addArgument('longUrl', InputArgument::REQUIRED, $this->translator->translate('The long URL to parse')) ->addOption( diff --git a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php similarity index 95% rename from module/CLI/src/Command/Shortcode/GetVisitsCommand.php rename to module/CLI/src/Command/ShortUrl/GetVisitsCommand.php index b27b6962..373b9169 100644 --- a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php +++ b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php @@ -1,7 +1,7 @@ isLastPage($result)) { $continue = false; - $io->success($this->translator->translate('Short codes properly listed')); + $io->success($this->translator->translate('Short URLs properly listed')); } else { $continue = $io->confirm( \sprintf($this->translator->translate('Continue with page') . ' %s?', $page), diff --git a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php similarity index 94% rename from module/CLI/src/Command/Shortcode/ResolveUrlCommand.php rename to module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php index b4a8394f..57f50a79 100644 --- a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php @@ -1,7 +1,7 @@ service = $this->prophesize(DeleteShortUrlServiceInterface::class); - $command = new DeleteShortCodeCommand($this->service->reveal(), Translator::factory([])); + $command = new DeleteShortUrlCommand($this->service->reveal(), Translator::factory([])); $app = new Application(); $app->add($command); diff --git a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php rename to module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php index ee63a378..de62f193 100644 --- a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php @@ -1,12 +1,12 @@ urlShortener = $this->prophesize(UrlShortener::class); - $command = new GenerateShortcodeCommand($this->urlShortener->reveal(), Translator::factory([]), [ + $command = new GenerateShortUrlCommand($this->urlShortener->reveal(), Translator::factory([]), [ 'schema' => 'http', 'hostname' => 'foo.com', ]); diff --git a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php rename to module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php index 4035de78..54ce2f6f 100644 --- a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php @@ -1,12 +1,12 @@ shortUrlService = $this->prophesize(ShortUrlServiceInterface::class); $app = new Application(); - $command = new ListShortcodesCommand($this->shortUrlService->reveal(), Translator::factory([]), []); + $command = new ListShortUrlsCommand($this->shortUrlService->reveal(), Translator::factory([]), []); $app->add($command); $this->commandTester = new CommandTester($command); } diff --git a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php rename to module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php index dfa2e483..b5e7aff2 100644 --- a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php @@ -1,11 +1,11 @@ Date: Sun, 16 Sep 2018 18:37:54 +0200 Subject: [PATCH 2/3] Updated few translations --- module/CLI/lang/es.mo | Bin 9985 -> 9997 bytes module/CLI/lang/es.po | 17 ++++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/module/CLI/lang/es.mo b/module/CLI/lang/es.mo index 8492b93940c0f9efcf1c8681a5cd50155cb3c40a..c2ea3578657240217e47a928f5681f8fbc3f02ca 100644 GIT binary patch delta 1308 zcmXxiTWkzb7{KvwX}juDU8QyJD5ZL*sFjFI1rJoCi0Ffiow40??KHDv>%I{Y2^E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qx(IkmTzsOGLcw3=ZJT`vt?6Q#-9$nW2!pHZ{> zGWDoW+(!S1Z@)L~pGmIj30t;tEbJHqPIxG2*_Lr&Uz=g}TZUst2c7J#ry`ed@9i=<<2PP-9ZJYYMaVIvfbL~Y9(%z8G@+nZhH^Vb?18aA!3_C|9m{W(U@ zW6uiqhS|W0hK&K!F^!O$X=LXO8\n" "Language-Team: \n" "Language: es_ES\n" @@ -83,8 +83,8 @@ msgstr "Clave secreta: \"%s\"" msgid "Deletes a short URL" msgstr "Elimina una URL" -msgid "The short code to be deleted" -msgstr "El código corto a eliminar" +msgid "The short code for the short URL to be deleted" +msgstr "El código corto de la URL corta a eliminar" msgid "" "Ignores the safety visits threshold check, which could make short URLs with " @@ -135,9 +135,8 @@ msgstr " ¡Correcto!" msgid "Error" msgstr "Error" -msgid "Generates a short code for provided URL and returns the short URL" -msgstr "" -"Genera un código corto para la URL proporcionada y devuelve la URL acortada" +msgid "Generates a short URL for provided long URL and returns it" +msgstr "Genera una URL corta para la URL larga proporcionada y la devuelve" msgid "The long URL to parse" msgstr "La URL larga a procesar" @@ -268,8 +267,8 @@ msgstr "Número de visitas" msgid "Tags" msgstr "Etiquetas" -msgid "Short codes properly listed" -msgstr "Códigos cortos correctamente listados" +msgid "Short URLs properly listed" +msgstr "URLs cortas listadas correctamente" msgid "Continue with page" msgstr "Continuar con la página" From d4168bebc66aeb546a4743d26da0fe2c5fcf47f3 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 16 Sep 2018 18:47:42 +0200 Subject: [PATCH 3/3] Ensured install tool knows the install command is the only one --- bin/install | 1 + bin/update | 1 + module/CLI/src/Command/Install/InstallCommand.php | 2 +- module/CLI/src/Factory/InstallApplicationFactory.php | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/install b/bin/install index d83df5f6..0d8dc72c 100755 --- a/bin/install +++ b/bin/install @@ -1,5 +1,6 @@ #!/usr/bin/env php io->writeln([ 'Welcome to Shlink!!', - 'This will guide you through the installation process.', + 'This tool will guide you through the installation process.', ]); // Check if a cached config file exists and drop it if so diff --git a/module/CLI/src/Factory/InstallApplicationFactory.php b/module/CLI/src/Factory/InstallApplicationFactory.php index 274100b4..c20d6706 100644 --- a/module/CLI/src/Factory/InstallApplicationFactory.php +++ b/module/CLI/src/Factory/InstallApplicationFactory.php @@ -50,7 +50,7 @@ class InstallApplicationFactory implements FactoryInterface $isUpdate ); $app->add($command); - $app->setDefaultCommand($command->getName()); + $app->setDefaultCommand($command->getName(), true); return $app; }