Type
library
A library supporting generic Magento 2 import functionality
library
OSL-3.0
None
None
None
None
None
This is the core library for the Magento 2 Import Framework M2IF.
The objective of M2IF is to provide a fully functional replacement for the Magento 2 standard import functionality with a 100 % CSV file compatibility. In contrast to other approaches, the framework is not build as a Magento 2 extension, although it has no dependencies to other frameworks like Symfony, Laravel or others. Instead, it provides independent components, that can be tied together as needed, by adding them as composer dependency.
A simple command line implementation should give a brief overiew of how a simple import application could look like. For more information, have a look at the techdivision/import-cli-simple repository
Actually we've a pre-alpha status, so we STRONGLY recommend not to use M2IF in production now.
The following functionality is already available, for CE and EE
This and many more is, what we're actually working on
Planned with future versions, are importer types for
And finally the project will provide exporting functionality, but that has to be discussed.
The importer has a component based architecture and provides a plug-in mechanism to add new functionality. Each component is provided by it's own composer library, whereas the libraries will have dependencies to each other, at least to this library.
Each component COULD provide a subject that'll be executed synchronously by the command. When a
subject is executed, it's import()
method will be invoked and a unique ID for the actual import process,
as well as the name of the file that has to be imported, will be passed. To save memory, the import()
method opens a stream to parse the passed file line by line. For each line found, the importRow()
method
will be invoked, that has exactly one parameter, which is the actual row, that has to be processed.
As described above, a subject can implement the import functionality, it is responsible for, by itself. A
better and more generic solution are observers, that can be registered e. g. in a configuration file. A
subject can have one or more observers, that will be invoked, by the subject's importRow()
method. This
means, for each row in the CSV file, all registered observers are executed synchronously.