Download the PHP package ttree/contentrepositoryimporter without Composer

On this page you can find all versions of the php package ttree/contentrepositoryimporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contentrepositoryimporter

ContentRepositoryImporter

This package contains generic utility to help importing data in the Neos Content Repository.

What's included ?

A basic DataProvider

Every data provider must extend the DataProvider abstract class or implement the interface . Check the source code of the abstract data provider, there are some useful things to discover.

It's important to update the property when you process data from the external source. During the processing, you can decide to skip some data (invalid data, missing values, ...) so we can not use the SQL count feature.

Try to do most of the data cleaning up in the data provider, so the data would arrive to the importer ready for insertion. Basically the array build by the provider should contains the data with the property name that match your node type property name. If you need to transport value that will not match the node properties, please prefix them with '_'.

There is some magic value, those values MUST be on the first level of the array:

Tips: If the properties of your nodes are not at the first level of the array, you can override the method

Output of the provider

Your provider should output something like this:

Tips: If your provider does not return an array, you MUST registrer a TypeConverter to convert it to an array. The property mapper is used automatically by the Importer.

Content Dimensions support

If your data provider follow this convention, the importer can automatically create variants of your nodes:

The is a preset name, you must configuration the presets on your :

Share data between preset parts

You can split your import in multiple parts. Each parts is executed in a separate request. Sometimes it's useful to share data between parts (ex. in the first part you import the taxonomy, and in the second parts you map documents with the taxonomy). Those solve this use case, we integrate a feature called Vault. The Vault is simply a cache accessible in the importer and data provider by calling and . The current preset is the namespace, so you can use simple keys like name, ids, ...

The cache is flushed if you call .

Basic provider

A basic Importer

Every data importer must extend the AbstractImporter abstract class or implement the interface .

In the processRecord method you handle the processing of every record, such as creating Content Repository node for each incoming data record.

Do not forget to register the processed nodes with registerNodeProcessing. The method will handle feature like logging and tracking of imported node to decide if the local node need to be created or updated.

A basic preset

You can configure an import preset in your . A preset is split in multiple parts. If you use the , the current part will be executed by batch, by using a sub CLI request. This can solve memory or performance issue for big imports.

Start your import process

Tips: Do not forget to require this package from the package in which you do the importing, to ensure the correct loading order, so the settings would get overriden correctly.

From the CLI:

You can also filter the preset steps:

For testing purposes, or if you would like to override the value defined in your preset, you can also specify the number of records which should be imported at a time in an isolated sub-process:

Passing exceeding arguments to the DataProvider

The import process supports passing unnamed exceeding arguments to the DataProvider. This can be useful if you e.g. want to allow importing only a single record

Exceeding arguments will be available in the DataProvider through $this->getExceedingArguments(). You need to process this data yourself and apply it to your fetching logic.

Command based importers

Some data sources may consist of commands rather than data records. For example, a JSON file may contain create, update and delete instructions which reduce the guess-work on the importer's side, which records may be new, which should be updated and if the absence of a record means that the corresponding node should be deleted from the content repository.

For these cases you can extend the AbstractCommandBasedImporter. If your data records contain a mode field, the importer will try to call a corresponding command method within the same class.

Consider the following data source file as an example:

A corresponding ProductImporter might look like this:

CSV Data Provider

This package comes with a basic data provider for CSV files which will suffice for many scenarios. The class name for this data provider is Ttree\ContentRepositoryImporter\DataProvider\CsvDataProvider.

The following options can be passed to the data provider:

Here is an example for a preset using the CSV Data Provider:

Acknowledgments

Development sponsored by ttree ltd - neos solution provider.

We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us.

License

Licensed under GPLv3+, see LICENSE


All versions of contentrepositoryimporter with dependencies

PHP Build Version
Package Version
Requires neos/neos Version ^7.0 || ^8.0
ezyang/htmlpurifier Version ^4.10.0
cocur/slugify Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ttree/contentrepositoryimporter contains the following files

Loading the files please wait ....