Skip to content

Commit

Permalink
remove duplicate command (keep container aware version : support 2.3+)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianajir committed Mar 14, 2016
1 parent f707d66 commit 8f08b6b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 110 deletions.
15 changes: 6 additions & 9 deletions Command/DownloadDatasetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@
namespace Laposte\DatanovaBundle\Command;

use Laposte\DatanovaBundle\Service\Downloader;
use Symfony\Component\Console\Command\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Symfony 2.3+ DownloadDatasetCommand
*
* @author Florian Ajir <[email protected]>
*/
class DownloadDatasetCommand extends Command
class DownloadDatasetCommand extends ContainerAwareCommand
{
/** @var Downloader $downloader */
private $downloader;

/**
* @param Downloader $downloader
* Command configuration
*/
public function __construct(Downloader $downloader)
{
$this->downloader = $downloader;
parent::__construct();
}

protected function configure()
{
$this
Expand Down Expand Up @@ -59,6 +55,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->downloader = $this->getContainer()->get('data_nova.service.downloader');
$dataset = $input->getArgument('dataset');
$format = strtolower($input->getArgument('format'));
$query = $input->getArgument('q');
Expand Down
87 changes: 0 additions & 87 deletions Command/DownloadDatasetLegacyCommand.php

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ Options:
-f, --force-replace If set, the command will replace local storage
```

`Example: php app/console datanova:legacy:download:dataset laposte_hexasmal json -f`
`Example: php app/console datanova:download:dataset laposte_hexasmal json -f`
7 changes: 0 additions & 7 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ services:
calls:
- ['setLogger', ['@?logger']]

data_nova.command.download.dataset:
class: Laposte\DatanovaBundle\Command\DownloadDatasetCommand
arguments:
- '@data_nova.service.downloader'
tags:
- { name: console.command }

data_nova.parser.csv:
class: Laposte\DatanovaBundle\Parser\CsvParser
arguments:
Expand Down
6 changes: 0 additions & 6 deletions Resources/dataset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,3 @@ Options:
Help:
Download dataset records to use it locally
```

### Legacy command (Symfony < 2.4)

```
datanova:legacy:download:dataset
```

0 comments on commit 8f08b6b

Please sign in to comment.