2017 © Pedro Peláez
 

library import-export-files

Import-Export-Files - A simple library to work with Import and Export files as CSV,JSON and XML.

image

fbizi/import-export-files

Import-Export-Files - A simple library to work with Import and Export files as CSV,JSON and XML.

  • Saturday, February 10, 2018
  • by franciscobizi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 100 % Grown

The README.md

imporTExport-files

Downloads Last Stable Version v2.0, (*1)

A light library to work with Import and Export files (requires PHP 7.4 +). The implementation is based on the current draft. CSV, JSON and XML are the files extensions that supported for the library., (*2)

Installation

Package is available on Packagist, you can install it using Composer., (*3)

composer require fbizi/import-export-files or download the zip file, (*4)

Dependencies

  • PHP 7.4+
  • PHPUnit 9+

Basic usage

Importing & Exporting

Just use the Importer/Exporter class for work with:, (*5)


define("DIR_PATH", "_DIR_./../uploads/"); require __DIR__ .'/../vendor/autoload.php'; use FBIZI\IE\{Importer, Exporter}; // you can use only one of them depends of your needs use FBIZI\IE\Importers\{ // you can use only one of them depends of your needs ImportCsv, ImportJson, ImportXml }; use FBIZI\IE\Exporters\{ // you can use only one of them depends of your needs ExportCsv, ExportJson, ExportXml }; // Import xml file example $obj = new Importer( //new ImportCsv(DIR_PATH . "testes.csv") //new ImportJson(DIR_PATH . "testes.json") new ImportXml(DIR_PATH . "testes.xml") ); $data = $obj->importer->import(); foreach ($data['users'] as $user) { echo "{$user->fname} {$user->lname}\n"; } // Export xml file example $data = [ [ 'name' => 'John Deor', 'age' => '34', 'role' => 'Developer' ], [ 'name' => 'John Deep', 'age' => '37', 'role' => 'Seller' ], [ 'name' => 'John Walker', 'age' => '37', 'role' => 'Manager' ] ]; $obj = new Exporter( //new ExportCsv($data, DIR_PATH . "downloads/testes.csv") //new ExportJson($data, DIR_PATH . "downloads/testes.json") new ExportXml($data, DIR_PATH . "downloads/testes1.xml") ); $res = $obj->exporter->export(); echo $res;

Donation

Methods :, (*6)

If this project help you reduce time to develop, you can give me a cup of coffee :), (*7)

The Versions

10/02 2018

dev-master

9999999-dev https://github.com/franciscobizi/imporTExport-files

Import-Export-Files - A simple library to work with Import and Export files as CSV,JSON and XML.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

export import

10/02 2018

v1.1.0

1.1.0.0 https://github.com/franciscobizi/imporTExport-files

Import-Export-Files - A simple library to work with Import and Export files as CSV,JSON and XML.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

export import

07/02 2018

v1.0.0

1.0.0.0 https://github.com/franciscobizi/imporTExport-files

Import/Export files

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

export import