ProductOpener::Paths - functions to get, check and initialize important directories
…
A hashmap containing references to base directories
Directory for scripts
Directory for logging
Directory containing sto of organizations
Directory containing sto of users
Directory containing sto of products
Directory containing txt taxonomies
Directory containing configuration files
Directory for private data
Directory with language files (.po). Normally linked to openfoodfacts-web
files to import in producer platform
files to export from producer platform to public platform
product images is a big directory, normally a volume of its own
temporary files we manage locally
A directory to link newly updated images in order to apply processing (like OCR)
Temporary files for debugging purposes
Files needed for various build phases - eg taxonomy and cached
Products deleted from the public platform
Products deleted from the public platform
Products deleted from the producers platform
A directory to store deleted images (not accessible from web)
A directory where we store revisions we reverted for some products
A directory used to debug knowledge panels
The main public data directory where database dumps are published along with other assets
Users contributed translations directory
sftp home directory, only for producers platform
Taxonomy .txt source files are stored in the /taxonomies directory.
Some Product Opener flavors (Open Food Facts, Open Beauty Facts etc.) can have different taxonomies for the same tag type. e.g. OFF and OBF can have different taxonomies for categories and ingredients.
Other categories like countries and languages are common to all flavors.
Taxonomies specific to a flavor are stored in /taxonomies/[product type]
e.g. OFF ingredients are in /taxonomies/food/ingredients.txt and OBF ingredients are in /taxonomies/beauty/ingredients.txt
full path for taxonomy file
Return the list of base paths as a hashmap
Check main directories, needed for the project to run, exists
A ref to a list of missing paths
Ensure a multiple path is created but die if a fundamental path is missing
Ensure a multiple path is created but die if a fundamental path is missing
Return a sh script to define environment variables
You can then use it in a script by running:
.
<(perl -e 'use ProductOpener::Paths qw/:all/; print base_paths_loading_script()')