Skip to content

Commit

Permalink
sf2.3 bundle branch
Browse files Browse the repository at this point in the history
  • Loading branch information
florianajir committed Mar 10, 2016
1 parent cb3e512 commit fb969d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 116 deletions.
15 changes: 1 addition & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,9 @@ php:
- '5.6'
- '7.0'

env:
- SYMFONY_VERSION=2.3.*
- SYMFONY_VERSION=2.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*

matrix:
exclude:
- php: 5.3
env: SYMFONY_VERSION=3.0.*
- php: 5.4
env: SYMFONY_VERSION=3.0.*

before_script:
- composer self-update
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --prefer-source --no-update --no-interaction
- composer require symfony/framework-bundle:2.3.* --prefer-source --no-update --no-interaction
- composer update --prefer-source --dev --no-interaction

script:
Expand Down
22 changes: 7 additions & 15 deletions Command/DownloadDatasetCommand.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
<?php
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 ContainerAwareCommand version of 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,16 +50,17 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$downloader = $this->getContainer()->get('data_nova.service.downloader');
$dataset = $input->getArgument('dataset');
$format = strtolower($input->getArgument('format'));
$query = $input->getArgument('q');
$download = $this->downloader->download(
$download = $downloader->download(
$dataset,
$format,
$input->getArgument('q'),
$input->getOption('force-replace')
);
$filepath = $this->downloader->findDownload($dataset, $format, $query);
$filepath = $downloader->findDownload($dataset, $format, $query);
if ($download) {
$output->writeln(sprintf(
'Dataset %s downloaded to "%s" : %d bytes',
Expand Down
87 changes: 0 additions & 87 deletions Command/DownloadDatasetLegacyCommand.php

This file was deleted.

0 comments on commit fb969d2

Please sign in to comment.