ironshark / typo3-data-importer
Import data from XLS files into an Typo3 database
v0.0.1
2016-07-26 14:01 UTC
Requires
- php: ~5.5|~7.0
- box/spout: ^2.5
- doctrine/dbal: ^2.5
- nikic/php-parser: ^2.1
- symfony/console: ^3.1
This package is not auto-updated.
Last update: 2024-11-21 04:47:59 UTC
README
Import data from XLS files into an Typo3 database.
Features
- Single file / directory import
- Customizeable column name mapping
- Dafault values for specified columns
- Generate dynamic defalut values like dates / timestamps on the fly
- Customizable value transformig
- Updates for existing rows
- Moving successful / failed files
- Transaction rollbacks on errors
Install
Via Composer
$ composer require ironshark/typo3-data-importer
Usage
php vendor/bin/typo3-data-importer import /path/to/file
Possible options
Dynamic defaults
Arguments / Shortcuts / Defaults
Usage: import [options] [--] <data-file> Arguments: data-file Path to data file, or directory with files to be imported. Options: -c, --config-file[=CONFIG-FILE] Path typo3 configuration file, db configs fill be loaded from this file. [default: false] --column[=COLUMN] Import file column, to db field mapping in following format db_field:ImportFileColumn (multiple values allowed) -t, --table[=TABLE] Database table name [default: "fe_users"] -m, --map[=MAP] Data mapping, transform imported values before inserting in database: "column:source_value:target_value" e.g "gender:Herr:1" (multiple values allowed) -u, --unique-field[=UNIQUE-FIELD] Unique field names, to find entities witch could be updated (multiple values allowed) -d, --default[=DEFAULT] Default values, to insert some values not listed in the import file. (multiple values allowed) --success-directory[=SUCCESS-DIRECTORY] Successful imported files will be moved to given directory if option is set. --error-directory[=ERROR-DIRECTORY] Unsuccessful imported files will be moved to given directory if option is set. --no-trim Disables trimming of field values. -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Example
php vendor/bin/typo3-data-importer import --config-file="/var/www/src/typo3conf/localconf.php" --data-file="import" --column="last_name:Name" --column="first_name:Vorname" --column="gender:Anrede" --column="email:E-Mailadresse" --colu="language:Sprachcode" --column="username:E-Mailadresse" --map="gender:Herr:1" --unique-field="email" --default="pid:1709" --default="usergroup:4" --error-directory="error" --default="tstamp:{date:U}" --default="password:{date:U}"
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email pauli@ironshark.de instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.