Skip to content

Commit

Permalink
Merge branch '2.x' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Sep 22, 2021
2 parents acba14f + 184e29f commit a613edd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 70 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
- name: Allow unstable dependencies
run: composer config minimum-stability dev

- name: Remove dev dependencies not compatible with Symfony 6
if: matrix.symfony-require == '6.0.*'
run: composer remove vimeo/psalm psalm/plugin-phpunit psalm/plugin-symfony weirdan/doctrine-psalm-plugin --dev --no-update --no-interaction

- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.8.0](https://github.com/sonata-project/exporter/compare/2.7.0...2.8.0) - 2021-09-21
### Changed
- [[#519](https://github.com/sonata-project/exporter/pull/519)] `SourceIteratorInterface` is not generic anymore ([@VincentLanglet](https://github.com/VincentLanglet))

### Fixed
- [[#519](https://github.com/sonata-project/exporter/pull/519)] Doctrine/orm deprecation ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#518](https://github.com/sonata-project/exporter/pull/518)] Fixed deprecations with Symfony 5.4 ([@jordisala1991](https://github.com/jordisala1991))
- [[#514](https://github.com/sonata-project/exporter/pull/514)] `AbstractPropertySourceIterator::$iterator` phpdoc ([@VincentLanglet](https://github.com/VincentLanglet))

### Removed
- [[#518](https://github.com/sonata-project/exporter/pull/518)] Removed support for Symfony 5.2 ([@jordisala1991](https://github.com/jordisala1991))

## [2.7.0](https://github.com/sonata-project/exporter/compare/2.6.2...2.7.0) - 2021-06-27
### Changed
- [[#485](https://github.com/sonata-project/exporter/pull/485)] Clear entity manager every 100 results to improve ORM iterator performance ([@EmmanuelVella](https://github.com/EmmanuelVella))
Expand Down
95 changes: 25 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,30 @@
# Data Exporter
<!--
DO NOT EDIT THIS FILE!
Data Exporter is a lightweight library to export data into different formats.
It's auto-generated by sonata-project/dev-kit package.
-->

# SonataExporter

Lightweight Exporter library

[![Latest Stable Version](https://poser.pugx.org/sonata-project/exporter/v/stable)](https://packagist.org/packages/sonata-project/exporter)
[![Latest Unstable Version](https://poser.pugx.org/sonata-project/exporter/v/unstable)](https://packagist.org/packages/sonata-project/exporter)
[![Psalm Type Coverage][shepherd_stable_badge]][shepherd_stable_link]
[![License](https://poser.pugx.org/sonata-project/exporter/license)](https://packagist.org/packages/sonata-project/exporter)

[![Total Downloads](https://poser.pugx.org/sonata-project/exporter/downloads)](https://packagist.org/packages/sonata-project/exporter)
[![Monthly Downloads](https://poser.pugx.org/sonata-project/exporter/d/monthly)](https://packagist.org/packages/sonata-project/exporter)
[![Daily Downloads](https://poser.pugx.org/sonata-project/exporter/d/daily)](https://packagist.org/packages/sonata-project/exporter)

Branch | Github Actions | Coverage |
------ | -------------- | -------- |
2.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] |
master | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] |

## Installation using Composer

```bash
composer require sonata-project/exporter
```

## Usage

### Standalone

```php
<?php

use Exporter\Handler;
use Exporter\Source\PDOStatementSourceIterator;
use Exporter\Writer\CsvWriter;

// Prepare the data source
$dbh = new \PDO('sqlite:foo.db');
$stm = $dbh->prepare('SELECT id, username, email FROM user');
$stm->execute();

$source = new PDOStatementSourceIterator($stm);

// Prepare the writer
$writer = new CsvWriter('data.csv');

// Export the data
Handler::create($source, $writer)->export();
```

### Symfony bridge

You can directly return an export as a streamed response like this:

```php
final class InvoicesExport
{
/**
* @Route("/invoices", name="invoices_export")
*/
public function __invoke(Request $request, Exporter $exporter): Response
{
$invoices = $this->getMyInvoices();
$format = $request->getRequestFormat();

return $exporter->getResponse(
$format,
'invoices.'.$format,
new ArraySourceIterator($invoices)
);
}
}
```
Branch | Github Actions | Code Coverage | Documentation |
------ | -------------- | ------------- | ------------- |
2.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] | [![Documentation Status][documentation_stable_badge]][documentation_stable_link] |
3.x | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] | [![Documentation Status][documentation_unstable_badge]][documentation_unstable_link] |

## Documentation

* [Introduction](docs/reference/introduction.rst)
* [Installation](docs/reference/installation.rst)
* [Sources](docs/reference/sources.rst)
* [Outputs](docs/reference/outputs.rst)
* [Symfony integration](docs/reference/symfony.rst)
Check out the documentation on the [official website](https://docs.sonata-project.org/projects/exporter).

## Support

Expand All @@ -91,10 +39,17 @@ This package is available under the [MIT license](LICENSE).

[test_stable_badge]: https://github.com/sonata-project/exporter/workflows/Test/badge.svg?branch=2.x
[test_stable_link]: https://github.com/sonata-project/exporter/actions?query=workflow:test+branch:2.x
[test_unstable_badge]: https://github.com/sonata-project/exporter/workflows/Test/badge.svg?branch=master
[test_unstable_link]: https://github.com/sonata-project/exporter/actions?query=workflow:test+branch:master
[test_unstable_badge]: https://github.com/sonata-project/exporter/workflows/Test/badge.svg?branch=3.x
[test_unstable_link]: https://github.com/sonata-project/exporter/actions?query=workflow:test+branch:3.x

[coverage_stable_badge]: https://codecov.io/gh/sonata-project/exporter/branch/2.x/graph/badge.svg
[coverage_stable_link]: https://codecov.io/gh/sonata-project/exporter/branch/2.x
[coverage_unstable_badge]: https://codecov.io/gh/sonata-project/exporter/branch/master/graph/badge.svg
[coverage_unstable_link]: https://codecov.io/gh/sonata-project/exporter/branch/master
[coverage_unstable_badge]: https://codecov.io/gh/sonata-project/exporter/branch/3.x/graph/badge.svg
[coverage_unstable_link]: https://codecov.io/gh/sonata-project/exporter/branch/3.x
[shepherd_stable_badge]: https://shepherd.dev/github/sonata-project/exporter/coverage.svg
[shepherd_stable_link]: https://shepherd.dev/github/sonata-project/exporter

[documentation_stable_badge]: https://readthedocs.org/projects/sonata-project-exporter/badge/?version=2.x
[documentation_stable_link]: https://docs.sonata-project.org/projects/exporter/en/2.x/?badge=2.x
[documentation_unstable_badge]: https://readthedocs.org/projects/sonata-project-exporter/badge/?version=3.x
[documentation_unstable_link]: https://docs.sonata-project.org/projects/exporter/en/3.x/?badge=3.x

0 comments on commit a613edd

Please sign in to comment.