Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.28 KB

readme.md

File metadata and controls

68 lines (46 loc) · 1.28 KB

Migrator Component

Migrator is a data transfer PHP application, based on ddeboer/data-import

Use as a library

You can install Migrator with composer by adding this configuration to your composer.json

{
    "repositories": [
        {
            "url": "https://github.com/AgenceStratis/migrator.git",
            "type": "git"
        }
    ],
    "require": {
        "AgenceStratis/migrator": "dev-master"
    }
}

Then you can download it with composer install and use it in your project

use Stratis\Component\Migrator\Migrator;

$migrator = new Migrator('config.yml');
$migrator->process();

Use as an executable

It's possible to create an application with PHP Box

Just clone this repo and run box.phar build

After migrator.phar is built, you can now use it with YAML files as parameter

Note: All the files will be merged in one configuration

Configuration

Configuration files use YAML language
It must include a source and a destination

Example
source:
    type: db
    dbname: app
    username: root
    table: users

dest:
    type: csv
    filename: users.csv