Download the PHP package thelia/json-lines-importer-module without Composer

On this page you can find all versions of the php package thelia/json-lines-importer-module. 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 json-lines-importer-module

JsonLinesImporter

Product import for Thelia 3 from a JSON Lines file (.jsonl, one product per line), through a five-step back-office wizard: upload and analysis, data selection, parameters (mappings and options), preview, execution. A console command replays an import with the parameters the wizard exports.

Each line is a product object validated against the JSON Schema Config/schema/product-import-1.1.json (draft 2020-12, $id urn:thelia:json-lines-importer:product-import:1.1): product and translations, sale elements and variants, prices by currency, tax rule, categories, brand, features, images, documents, videos, accessories, and the old address of the product page.

Compatibility

Installation

The module is available on Packagist as thelia/json-lines-importer-module. Composer installs it in vendor/thelia/modules/JsonLinesImporter with its dependencies.

A copy placed by hand in local/modules/JsonLinesImporter is not installed by Composer: add its dependencies to the shop first (composer require opis/json-schema:^2.6 symfony/html-sanitizer:^7.4).

The activation creates four tables: jsonl_import, jsonl_import_line, jsonl_import_mapping, jsonl_import_media. Uploaded files are kept in local/media/jsonl-imports/. The activation also creates local/import/, the only directory media given by a path on the server are read from: place the files there, or link a directory from there.

Rules of a line

Back-office

Catalog menu, entry "JSONL import" (/admin/json_lines_importer). Access is granted on the module itself: VIEW for the screens, UPDATE for the actions. The Catalog menu itself only shows to administrators allowed to view the categories.

The analysis and the import run in successive HTTP batches driven by the page (30 seconds at most each, less when max_execution_time is lower or when the module configuration value batch_seconds asks for it). Closing the page pauses the import; it resumes from the list of imports at the next line. Only one import runs at a time.

Console

The parameters file is the one exported at step 3 ("Export the parameters"): selected data, options, excluded lines and mappings. A title missing from the exported mappings follows the memorized mapping, else the element with the same title, else it is ignored; the command never creates a referential element.

Traps of the core this module works around

Assets

The back-office scripts are Stimulus controllers built by webpack into templates/backOffice/default-twig/assets/dist/ (versioned output):

Tests

For a copy in local/modules, pass -c local/modules/JsonLinesImporter/phpunit.xml.dist. The CI runs both suites on a fresh Thelia 3 shop (.github/workflows/ci.yml).

THELIA_VENDOR_AUTOLOAD points the integration suite at the autoloader of the shop when PHPUnit comes from the module vendor.

The test database must be at the level of the core code (its product_video tables come with Thelia 3.2): a database stamped with the right version but created before a table was added to the update script of that version misses it, and the video tests fail on an unknown table. The video tests read their files from a local directory and need no network.

Changelog

See CHANGELOG.md.

Author

Samuel Diakité, OpenStudio

License

GPL-3.0-or-later


All versions of json-lines-importer-module with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
thelia/installer Version ~1.1
opis/json-schema Version ^2.6
symfony/http-client Version ^7.0
symfony/html-sanitizer Version ^7.4
symfony/http-foundation Version ^7.0
symfony/lock Version ^7.0
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 thelia/json-lines-importer-module contains the following files

Loading the files please wait ...