lephare / import
Import CSV/XLS files
Installs: 6 688
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 8
Forks: 1
Open Issues: 5
pkg:composer/lephare/import
Requires
- php: ^7.4|^8.0
- doctrine/collections: ^1.6|^2.0
- doctrine/dbal: ^2.13|^3.0|^4.0
- monolog/monolog: ^2.0|^3.0
- neitanod/forceutf8: ^2.0.4
- psr/log: ^1.0|^2.0|^3.0
- symfony/config: ^5.4|^6.0|^7.0
- symfony/event-dispatcher: ^5.4|^6.0|^7.0
- symfony/finder: ^5.4|^6.0|^7.0
- symfony/string: ^5.4|^6.0|^7.0
- symfony/translation-contracts: ^1|^2|^3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- jangregor/phpstan-prophecy: ^1.0
- php-mock/php-mock-prophecy: ^0.1.1
- phpoffice/phpspreadsheet: ^1.19
- phpspec/prophecy: ^1.10
- phpspec/prophecy-phpunit: ^2.2
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.6
- symfony/phpunit-bridge: ^5.4|^6.0|^7.0
Suggests
- phpoffice/phpspreadsheet: Import XLS files
- dev-master
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- 1.0
- dev-release-please--branches--master--components--release-please-action
- dev-fix/composer-do-not-require-symfony-translation-contracts-directly
- dev-feat-single-file-error-handling
- dev-update-strategy
- dev-fix-message-translation
This package is auto-updated.
Last update: 2025-10-02 08:49:13 UTC
README
Resources
Archive
Archive affects imported files/resources when a ImportEvents::POST_COPY event is triggered.
For archive to take effect on a imported resource, you need to explicitly define:
- the
archive.enabledvalue totrue - the
resources.references.loadnode
name: stock source_dir: "var/exchange/in" archive: enabled: true dir: "var/exchange/in/foo/stock" rotation: 60 resources: references: tablename: import.stock load: pattern: "^stock.csv$"
The file will move to a default archives directory in the defined source_dir or in the archive.dir if you explicitly define its value.
The archive.rotation define define the number of files to keep before deletion.
Quarantine
Quarantine affects imported files/resources when a ImportEvents::EXCEPTION event is triggered (before)
For quarantine to take effect on a imported resource, you need to explicitly define:
- the
quarantine.enabledvalue totrue - the
resources.references.loadnode
The subsequent stock.csv file will be quarantined if an import exception happen during the import process.
name: stock source_dir: "var/exchange/in" quarantine: enabled: true dir: "var/exchange/in/bar/stock" rotation: 60 resources: references: tablename: import.stock load: pattern: "^stock.csv$"
The file will move to a default quarantine directory in the defined source_dir or in the quarantine.dir value if you explicitly define its value.
The quarantine.rotation define define the number of files to keep before deletion.
IDE Integration
Beyond validating YAML syntax in your IDE, you can validate the definition of an import configuration using
the JSON schema ./lephare-import.schema.json.
This also provides contextual help for autocompletion and when hovering over a YAML key.