Download the PHP package rtmatt/csvimport without Composer

On this page you can find all versions of the php package rtmatt/csvimport. 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 csvimport

CSVImport for Laravel 5

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Speed up the process of importing initial client information into a MySQL Database-driven CMS. This package contains everything you need to start importing CSVs into your database out of the box. It is configurable and extendable to allow for complex import logic.

Requirements

Installation

Install the package

Add the service provider in config/app.php BEFORE the application route service provider

Publish the package provider

Usage

Basic Usage Example

Background

You have a database table users with first_name, last_name, and email fields. You have a csv file that reflects the following spreadsheet:

alt tag

Step 1 - Create Importer

Create an importer. The following will create the importer stub app/CSVImports/UsersImporter.php

This will create the importer stub app/CSVImports/UsersImporter.php

Step 2 - Configure Importer

Configure importer stub. You will need to define the following methods.

Step 3 - Upload Importer and Run

Navigate to /csv-imports. You should see an input that corresponds with the importer you made. Upload your csv and click submit.

Step 4 - Have a drink

You earned it.

Configuration options

During installation, the package will create a config file config/csvimport.php with the following options

Import Order

If you have importers that need to run in a certain order, set this configuration option.

For example, you have the following in your importers directory:

If you need the UserPhotosImporter to run before the AffiliatesImporter, you would define the import_order configuration array as follows:

Authentication

If you want to require authentication to access the Importers, set the auth config to true

In order to use authentication, you will need to add the following to your User model:

SQL Directory

You can configure the directory to which the importer writes and reads files from. This directory needs to be writable by the server and readable by the mysql user. If you override this, use an absolute path.

Override Views

If you have an admin layout that you would like the importer to load within, simply change the override_layout_view config to a string representing how you would load the view in a controller:

The layout will load through the package's controller. If you have layout variables or logic that are not handled properly, you will likely encounter errors.

Override Importer Directory

If you would like to store your importers anywhere other than app/CSVImports, you can do so by changing the importer_directory config.

Make sure you also update the importer_namespace config to ensure proper Importer Loading.

Custom Routes

If you don't like the route /csv-imports and would like to define your own routes, you can do so by modifying your app's routes.php file with a controller route using the package's controller.

You should also set the custom_route config to true to ensure the default package routes are not registered.

Advanced Usage

There are some predefined points at which you can extend the functionality of your importers.

Override Import Command

You can completely override the MySQL command run by the importer by defining this method:

Example: You are importing properties into your database. The CSV you are working with has the following issues:

Post-Import Logic

Sometimes you need to run some logic after the sql statement has been executed. You do this by adding the following method to your importer:

Example:

Troubleshooting

Routing Doesn't Work

You may have cached routes. Clear the route cache by running

Photos

Currently, you need to write your own photo import logic and call it from the postSQLImport method in your importer. Photo import support is scheduled for future versions.


All versions of csvimport with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
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 rtmatt/csvimport contains the following files

Loading the files please wait ....