lephare / import
导入 CSV/XLS 文件
v2.2.0
2024-05-23 07:21 UTC
Requires
- php: ^7.4|^8.0
- behat/transliterator: ^1.1
- doctrine/collections: ^1.6|^2.0
- doctrine/dbal: ^2.13|^3.0
- monolog/monolog: ^2.0|^3.0
- neitanod/forceutf8: ^2.0
- 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
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
This package is auto-updated.
Last update: 2024-09-11 14:12:02 UTC
README
资源
存档
当触发 ImportEvents::POST_COPY
事件时,存档会影响导入的文件/资源。
为了使存档对导入的资源生效,您需要显式定义
archive.enabled
的值为true
resources.references.load
节点
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$"
文件将移动到定义的 source_dir
中默认的 archives
目录,或者在您显式定义其值的情况下移动到 archive.dir
。
archive.rotation
定义在删除之前保留的文件数量。
隔离
当触发 ImportEvents::EXCEPTION
事件时(之前),隔离会影响导入的文件/资源
为了使隔离对导入的资源生效,您需要显式定义
quarantine.enabled
的值为true
resources.references.load
节点
如果在导入过程中发生导入异常,随后的 stock.csv
文件将被隔离。
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$"
文件将移动到定义的 source_dir
中默认的 quarantine
目录,或者在您显式定义其值的情况下移动到 quarantine.dir
。
quarantine.rotation
定义在删除之前保留的文件数量。