Download the PHP package quince/data-importer without Composer

On this page you can find all versions of the php package quince/data-importer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package data-importer

data-importer

Tool for importing data from tabular data files into laravel models

Installation

Add data-importer to your composer.json file.

for laravel 4:

and for laravel 5:

Use composer to install this package.

Registering the Package

Register the service provider within the providers array found in app/config/app.php:

Configuration

Next step is to publish package configuration by running:

in laravel 4 run:

and in laravel 5 run:

Config file could be found in app/config/packages/quince/data-importer/config.php for laravel 4 and in config/quince/data-importer.php

Usage

You can use data-importer in two ways

Using Laravel IoC Container

Make sure exporter service manager is registered in your app config.

Using Laravel Dependency Injection

You can also inject Quince\DataImporterManager in your class, and use it.

Advanced Usages

Each row of file is a presenter of a record in database, and each record may have relation records. In your csv file, a column may be present these relation records. Header of this column is a concatenation of relation name and field name of relation that is provide in that column (Concat with relation_joint is set in config file). if a column have many relation records, values should be separated with relation_value_delimiter which is set in config file.

Example

The file below:

name username email phones.number
John Doe Johny [email protected] 0941120773
Jane Doe Jane6 [email protected] 0929339687|0916740160

will be converted to something like this (as json):

Additional Fields

When only some of the table fields are provided in given file, you can set those field manualy

NOTE: You should specify additional fields are for main record or relation records

If fields that specified as additional fields exist in csv file, data will be loaded from csv file. But if you pass true as second parameter for setAdditionalFields aditional fields will overwrite existing data in csv file.

Translating file headers

When column headers of your file are defferent from your table columns, you can map them to your database table columns. Assume your file is like:

Real Name Nickname Mail Address Phone Numbers
John Doe Johny [email protected] 0941120773
Jane Doe Jane6 [email protected] 0929339687|0916740160

you can pass a dictionary for your file custom header to translate them to their table-column names.

you can also map a single column of your file to a column in your database table.

For more information about advanced usage visit wiki pages

Config file

field description default value
delimiter The character is used to separate each column in a row. ,
enclosure The character is used to specify the enclosure. "
escape The character to escape invalid characters. \
chunk_size The size of rows to be processed by closure you pass to import method. 100
relation_joint The character to join relation name and column of relation table you want to import. .
relation_value_delimiter The character to delimit relation value from each other. \|

All versions of data-importer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version ~4.0
illuminate/database Version ~4.0
illuminate/config Version ~4.0
league/csv Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package quince/data-importer contains the following files

Loading the files please wait ....