Skip to content

Commit

Permalink
Merge pull request #46 from ezsystems/ezp_32259
Browse files Browse the repository at this point in the history
EZP-32259: Replaced "ezplatform" commands namespace with "ibexa"
  • Loading branch information
ViniTou authored Jan 12, 2021
2 parents 0e60714 + d7739b1 commit 75cadb7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/bundle/Command/ExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace EzSystems\EzRecommendationClientBundle\Command;

use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand;
use EzSystems\EzRecommendationClient\Factory\ExportParametersFactoryInterface;
use EzSystems\EzRecommendationClient\Http\HttpEnvironmentInterface;
use EzSystems\EzRecommendationClient\Service\ExportServiceInterface;
Expand All @@ -20,7 +21,7 @@
/**
* Generates and export content to Recommendation Server for a given command options.
*/
final class ExportCommand extends Command
final class ExportCommand extends Command implements BackwardCompatibleCommand
{
public const SUCCESS = 0;

Expand Down Expand Up @@ -56,7 +57,8 @@ public function __construct(
protected function configure()
{
$this
->setName('ezrecommendation:export:run')
->setName('ibexa:recommendation:run-export')
->setAliases(['ezrecommendation:export:run'])
->setDescription('Run export to files.')
->addOption('webHook', null, InputOption::VALUE_OPTIONAL, 'Guzzle Client base_uri parameter, will be used to send recommendation data')
->addOption('host', null, InputOption::VALUE_OPTIONAL, 'Host used in exportDownload url for notifier in export feature')
Expand Down Expand Up @@ -99,4 +101,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
throw $e;
}
}

/**
* @return string[]
*/
public function getDeprecatedAliases(): array
{
return ['ezrecommendation:export:run'];
}
}
13 changes: 12 additions & 1 deletion src/bundle/Command/UserAttributesUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace EzSystems\EzRecommendationClientBundle\Command;

use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand;
use EzSystems\EzRecommendationClient\Client\EzRecommendationClientInterface;
use EzSystems\EzRecommendationClient\Event\UpdateUserAPIEvent;
use Symfony\Component\Console\Command\Command;
Expand All @@ -16,7 +17,7 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Response;

final class UserAttributesUpdateCommand extends Command
final class UserAttributesUpdateCommand extends Command implements BackwardCompatibleCommand
{
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */
private $eventDispatcher;
Expand All @@ -40,6 +41,8 @@ public function __construct(
protected function configure(): void
{
$this
->setName('ibexa:recommendation:update-user')
->setAliases(['ezrecommendation:user:update'])
->setDescription('Update the set of the user attributes');
}

Expand Down Expand Up @@ -78,4 +81,12 @@ protected function execute(InputInterface $input, OutputInterface $output): void
$output->writeln('<fg=green>User attributes updated successfully!</>');
}
}

/**
* @return string[]
*/
public function getDeprecatedAliases(): array
{
return ['ezrecommendation:user:update'];
}
}
4 changes: 2 additions & 2 deletions src/bundle/Resources/config/services/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ services:
$exportParametersFactory: '@EzSystems\EzRecommendationClient\Factory\ConfigurableExportParametersFactory'

tags:
- { name: console.command, command: ezrecommendation:export:run }
- { name: console.command }
- { name: monolog.logger, channel: ezrecommendation }

EzSystems\EzRecommendationClientBundle\Command\UserAttributesUpdateCommand:
tags:
- { name: console.command, command: ezrecommendation:user:update }
- { name: console.command }
- { name: monolog.logger, channel: ezrecommendation }

0 comments on commit 75cadb7

Please sign in to comment.