Download the PHP package wwwision/import-service without Composer
On this page you can find all versions of the php package wwwision/import-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wwwision/import-service
More information about wwwision/import-service
Files in wwwision/import-service
Package import-service
Short Description Generic service for importing data from different sources to configurable targets such as the Neos Content Repository or an arbitrary database table
License MIT
Informations about the package import-service
Wwwision.ImportService
Neos Flow package for importing data from different sources to configurable targets such as the Neos Content Repository or an arbitrary database table
Usage
Setup
Install this package using composer via
Define an Import Preset
Add some Import Preset configuration to your projects Settings.yaml
, for example:
Run the import
Pre-process data
Sometimes the data has to be processed before it is mapped to. This can be done with a dataProcessor
.
Example:
Implementation
A processor is any public method of any class that can be instantiated by Flow without additional arguments:
Note: The processor class can have dependencies, but it should be possible to create a new instance via ObjectMananger::get($processorClassname)
without further arguments, i.e. the class should behave like a singleton (see https://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/ObjectManagement.html)
Configuration
Note: The syntax looks like the method has to be static, but that's not the case. It just has to satisfy PHPs is_callable()
function
Validate configuration
Configuration for this package is verbose and thus error-prone. The settings can be validated against a schema via the following command:
Which should produce the output
CLI
This package provides the following CLI commands:
import:run
Synchronizes data (add, update,delete) for the given preset.
Usage
Arguments
Options
import:prune
Removes all data for the given preset
Usage
Arguments
Options
import:presets
Lists all configured preset names
Usage
import:preset
Displays configuration for a given preset
Usage
Arguments
import:setup
Set up the configured data source and target for the specified preset and/or display status
Usage
Arguments
Neos ContentRepository import
Importing data from a 3rd party API into the Neos Content Repository is one of the main requirements for this package.
To import records into the Content Repository, the privided ContentRepositoryTarget
can be used, it has the following options:
Note: Either rootNodePath
or parentNodeResolver
have to be specified!
Example configuration:
Usage without Neos.ContentRepository package
If the Neos.ContentRepository package is not installed Flow's proxy class builder throws an UnknownObjectException
.
Disable auto-wiring in Objects.yaml
:
All versions of import-service with dependencies
ext-json Version *
neos/flow Version ^6.0 || ^7.0 || ^8.0
guzzlehttp/guzzle Version ^7.0