2017 © Pedro Peláez
 

library libflexport

FINDOLOGIC export toolkit for XML and CSV data export

image

findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  • Tuesday, July 3, 2018
  • by g.sorst@findologic.com
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,802 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 6 Open issues
  • 25 Versions
  • 247 % Grown

The README.md

FINDOLOGIC export toolkit

Github Actions Latest Stable Version Code Climate Codecov, (*1)

Table of Contents

  1. Synopsis
  2. Export recommendation
  3. Limitations
  4. Basic usage
    1. Setup
    2. XML Export
    3. CSV Export
  5. Examples
  6. Compatibility
  7. Contributors

Synopsis

This project provides an export library for XML and CSV generation according to the FINDOLOGIC export patterns. * XML https://docs.findologic.com/doku.php?id=xml_export_documentation:XML_2_format * CSV https://docs.findologic.com/doku.php?id=csv_export_documentation:csv_2_format * Note that CSV support is still relatively new. Consider it beta-quality., (*2)

Export recommendation

Using the XML export is recommended by FINDOLOGIC. The XML is easier to read and has some advantages over the CSV export like:, (*3)

  • No encoding issues as the encoding attribute is provided in the XML response <?xml version="1.0" encoding="UTF-8"?>.
  • Validation is more reliable.
  • Simple escaping of content using the <![CDATA[...]]>-tag.
  • Standardized structure.
  • Dynamically extract the products from the database via start and count parameter in the url.
  • No limited file size for XML because of pagination.
  • Using multiple groups per product.

The key advantage for CSV is that it is possible to use way more groups than for XML. On the other hand:, (*4)

  • Groups only regulate visibility - it's not possible to show different values per group.
  • The format is prone to encoding issues if non-UTF-8 data is fed into it.
  • Total export size is limited by file size, while XML pagination theoretically allows exports of arbitrary size.

Limitations

Currently, only input text encoded in UTF-8 is supported. To use this library with other types of encoding, one of the following is necessary:, (*5)

  • Convert all text to UTF-8 prior to passing it to libflexport.
  • Use the XML exporter and modify the library to change the XML header to contain the required encoding.
    • FINDOLOGIC is capable of handling most encodings, but only with XML.

Basic usage

Setup

  1. Include as composer dependency using composer require findologic/libflexport
  2. Load ./vendor/autoload.php into the project

XML export

require_once './vendor/autoload.php';

use FINDOLOGIC\Export\Exporter;

$exporter = Exporter::create(ExporterType::XML);

$item = $exporter->createItem('123');

$item->addName('Test');
$item->addUrl('http://example.org/test.html');
$item->addPrice(13.37);
// Alternative long form:
// $name = new Name();
// $name->setValue('Test');
// $item->setName($name);
// $url = new Url();
// $url->setValue('http://example.org/test.html');
// $item->setUrl($url);
// $price = new Price();
// $price->setValue(13.37);
// $item->setPrice($price);

$xmlOutput = $exporter->serializeItems([$item], 0, 1, 1);

CSV export

require_once './vendor/autoload.php';

use FINDOLOGIC\Export\Exporter;

$exporter = Exporter::create(ExporterType::CSV);

$item = $exporter->createItem('123');

$item->addPrice(13.37);
$item->addName('Test');
$item->addUrl('http://example.org/test.html');
// Alternative long form:
// $name = new Name();
// $name->setValue('Test');
// $item->setName($name);
// $url = new Url();
// $url->setValue('http://example.org/test.html');
// $item->setUrl($url);
// $price = new Price();
// $price->setValue(13.37);
// $item->setPrice($price);

// Date is mandatory for CSV.
$item->addDateAdded(new \DateTime());

$csvOutput = $exporter->serializeItems([$item], 0, 1, 1);

Examples

For more specific examples, please have a look at the examples directory., (*6)

Compatibility

The status of the major versions of libflexport is outlined below. Version numbers generally follow semantic versioning principles., (*7)

Version Branch PHP support Receives bug fixes Receives enhancements End of life
3.X develop >=8.1 :heavy_check_mark: :heavy_check_mark: Not in the foreseeable future
2.X 2.x >=7.1 :heavy_check_mark: :x: Not in the foreseeable future
1.X 1.x 5.6 - 7.3 :heavy_check_mark: :x: TBD
0.X :x: 5.6 - 7.0 :x: :x: 2017-11-24

All versions will most likely remain available for as long as the infrastructure to do so exists., (*8)

Contributors

See contribution guide., (*9)

The Versions

03/07 2018

dev-develop

dev-develop https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

21/06 2018

dev-update_license

dev-update_license https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

15/06 2018

dev-additional_validation_check

dev-additional_validation_check https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

05/06 2018

dev-master

9999999-dev https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

05/06 2018

v1.2.2

1.2.2.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

04/06 2018

v1.2.1

1.2.1.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

01/06 2018

v1.2.0

1.2.0.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

02/05 2018

dev-check_invalid_url

dev-check_invalid_url https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

29/04 2018

dev-csv_support

dev-csv_support https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

01/04 2018

dev-validate_sort_as_integer

dev-validate_sort_as_integer https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

30/03 2018

v1.1.1

1.1.1.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

29/01 2018

v1.1.0

1.1.0.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

29/01 2018

dev-simplify_adding_simple_values_to_items

dev-simplify_adding_simple_values_to_items https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

28/01 2018

dev-travis_build_matrix

dev-travis_build_matrix https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

28/01 2018

dev-add_xml_example

dev-add_xml_example https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

16/01 2018

v1.0.3

1.0.3.0 https://github.com/findologic/libflexport

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner
by Dominik Brader
by Markus Machatschek

13/12 2017

1.0.2

1.0.2.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

11/12 2017

1.0.1

1.0.1.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

07/12 2017

dev-analyze_code_coverage

dev-analyze_code_coverage

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

24/11 2017

1.0.0

1.0.0.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

06/10 2017

dev-use_count_value_of_request

dev-use_count_value_of_request

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

25/08 2017

0.0.4

0.0.4.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

16/06 2017

0.0.3

0.0.3.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner

02/06 2017

0.0.2

0.0.2.0

FINDOLOGIC export toolkit for XML and CSV data export

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Ortner