Download the PHP package pixelant/pxa-pm-importer without Composer

On this page you can find all versions of the php package pixelant/pxa-pm-importer. 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 pxa-pm-importer

Product Manager Importer

Product manager

Short information

This extension was for created to make it easier to import products and products data from different sources.

By default it supports import from CSV and Excel files.

!!! If you want to use Excel source additionally install composer package composer req phpoffice/phpspreadsheet

Import configuration is provided by Yaml.

Example configuration and source files

You can find some examples of import configuration and source data structure in next folders:

Usage

How to create import configuration

Create new extension, for example "pm_myimport".

In ext_tables.php add next code:

This will register your extension as import configuration provider.

By default extension will look for configuration files in:

EXT:pm_myimport/Configuration/Yaml

But you can add as second parameter array of custom paths where to fetch YAML files, but these should be under Configuration folder.

Then in your import configuration file you can use your own importers, source providers, data adapter and processors.

Log

Every import execution is saved in separate log file. By default all log files are saved in typo3temp/var/logs, file prefix is pm_importer_YYYY_mm_dd_hours:minutes:seconds.log You can change log path in import configuration

Backend module

After import configuration is created you can run it from Backend module "PM importer".

Scheduler

In order to run import from scheduler, create new Execute console commands task. From available commands choose pxapmimporter:import: Import "pxa_product_manager" extension related records. Task accept next parameters:

Simple import

If you want to import data from CSV or Excel files and data is not really complex, possibilities of extension should be enough.

In case you want just run some custom configuration, but don't want to create extension for this, you can do it from command line.

Import yaml configuration

You can create new Yaml configuration file with you import configuration somewhere in "fileadmin".

Example:

Configuration parts
Log

In log settings it's possible to set custom path where to write file log and severity.

Source

Source is responsible for reading data from different sources. Currently extension support two import sources:

!!! It's possible to have multiple source. Script will run imports for each source.

CsvSource supports next options:

ExcelSource supports next options:

Import adapter

Every importer require adapter. Adapter should transform raw data from source to associative array.

Also adapter need to prepare data for language layers if there are such.

By default extension has Pixelant\PxaPmImporter\Adapter\DefaultDataAdapter

Adapter require mapping configuration:

Important to set "excelColumns: true" if you are using excel columns letters as column instead of nubmers. Only number or only letters can be used for one adapter configuration.

Use multiple columns to gerenate identifier:

Following configuration would set identifier to '1100101023se1' if column ITEMID is '1100101023' and DATAAREAID is 'se1', useful when no sigle field in source can be used as a unique identifier.

Use adapter filters to filter rows:

Sample usage: I have a single API source with all products I need to import, but they are one row per language and they should be stored in different PID:s. I also need to filter out rows where PROJCATEGORYID doesn't equal 'BE Online' and CAP_CustUniqueItem equals '1'.

Importer configuration

Processors

Processor purpose is to transform data(field value) in a way that it can be set to model property. Processors are responsible for setting value to property.

Extension has next processors out of box:

Simple properties processors:
Configuration example:
Relations(1:1, 1:n, n:m) processors:
Configuration example:
Files processor
Configuration example:
Processor validation

Every property may have many validators. Custom validators should implement instance of \Pixelant\PxaPmImporter\Validation\Validator\ValidatorInterface. See RequiredValidator for example.

Important that your custom classes implements required interface.

Import inside YAML

If you have one general configuration, for example product importer mapping, for all your imports and you want to have it in one place, you can create a subfolder inside "Configuration/Yaml", lets call it "imports"

EXT:pm_myimport/Configuration/Yaml/imports

Create "general_conf.yaml" YAML file there with and put configuration there. Then in your import file you can import like below

Developers useful info

During import process Singleton \Pixelant\PxaPmImporter\Context\ImportContext is available with related to import data. See class for more details.


All versions of pxa-pm-importer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
typo3/cms-core Version ^9.3
symfony/yaml Version *
pixelant/pxa-product-manager Version ^9.5.1
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 pixelant/pxa-pm-importer contains the following files

Loading the files please wait ...