Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Data Export Implementation

Oleh Kravets edited this page Mar 2, 2017 · 1 revision

The export is implemented in the "Core" module.

There is a controller with actions to export and download data for stock, price and products. The main idea is that the files get generated by the shell script and then get downloaded through the controller, even though it is possible to generate feeds through the the web-interface.

The shell file is used for generation export feeds either separately for each store or for all stores at once. It is important to note, that since the file is extending Mage_Shell_Abstract, all PHP variables set in .htaccess are considered there.

The shell file according to the requested parameters uses one of the export type classes to generate feeds. At the moment there are three implemented export types: price, stock and product. Each of these classes implements the interface and in case of implementing another type it is recommended that the new class implements that interface.

Each of the export types uses FACTFinder_Core_Model_File for writing data, which is actually a simple-in-use wrapper for CSV.

A lock system has been implemented: if an export was started, a lock file in the folder var/lock is created, which prevents running of multiple exports at the same time. The lock file is deleted at the end of the export process. If the export process was interrupted (e.g. due to an error), the lock file might stay in the folder and no new export could be started. There is a timeout for such files: 2 hours. The logic can be seen here

Clone this wiki locally