Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if (!is_dir(dirname(__DIR__).'/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (PHP_VERSION_ID >= 80100) {
// Autoloaders are appended. This one must be loaded first.
require_once dirname(__DIR__).'/sub-vendors/php8/vendor/autoload.php';
}
require_once dirname(__DIR__).'/vendor/autoload.php';

if (!defined('_PS_ROOT_DIR_')) {
Expand Down
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,13 @@
"PrestaShop\\Module\\AutoUpgrade\\": "classes/",
"PrestaShop\\Module\\AutoUpgrade\\Controller\\": "controllers/admin/self-managed"
}
},
"scripts": {
"post-install-cmd": [
"@composer install --working-dir=sub-vendors/php8"
],
"post-update-cmd": [
"@composer update --working-dir=sub-vendors/php8"
]
}
}
16 changes: 16 additions & 0 deletions sub-vendors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Sub-vendor directories overview

This folder contains additional `composer.json` files that updates the order of dependencies that can be loaded by Update Assistant.

They have been created to load specific versions of the same dependencies found in the main `composer.json` in order to allow the module to be compliant with a wide range of PrestaShop versions without having to maintain several versions of the same module.

This is a workaround and thus must be considered as a temporary solution. At the end, a new major version of Update Assistant will tighten the compatibility range of PrestaShop, allowing the project to go back to only one `composer.json` file.

## Prerequisites

- PHP >= 8.2
- Composer - [Download Composer](https://getcomposer.org/)

## Install project dependencies

There is nothing to do in particular here. The main `composer.json` is configured to chain the installation of the dependencies list of this folder.
26 changes: 26 additions & 0 deletions sub-vendors/php8/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "prestashop/autoupgrade",
"description": "PrestaShop module autoupgrade (Variant of libraries for PHP 8)",
"homepage": "https://github.com/PrestaShop/autoupgrade",
"license": "AFL-3.0",
"authors": [
{
"name": "PrestaShop SA",
"email": "contact@prestashop.com"
}
],
"require": {
"php": ">=8.1",
"symfony/console": "^6.4"
},
"config": {
"preferred-install": "dist",
"platform-check": false,
"classmap-authoritative": true,
"platform": {
"php": "8.1.0"
},
"prepend-autoloader": false,
"optimize-autoloader": true
}
}
Loading