aws-sdk-php version conflict preventing proper functioning of add-on

Hi there,

I am working on an add-on that uses many Composer packages, one of which is aws-sdk-php. I am having a big issue with version compatibility. The latest version of aws-sdk-php is 3.255.9, but the version that is pre-installed in CSCart is 3.99, which is now considered very old.

Here is the directory structure for my add-on:

addons
--- my_addon
      ---------> controllers
      ---------> src
      ---------> vendor
      ---------> Tygh
      ---------> schema
      --- composer.json
      --- etc...

There is an issue in the GitHub aws-sdk-php repository stating that there are two different versions of aws-sdk-php installed at the same time. I have tried the following ways to make sure the issue is caused by having two versions of aws-sdk-php installed:

  1. I removed aws-sdk-php from my add-on directory and just used the pre-installed aws-sdk-php by CSCart (version 3.99). In this case, I received endless errors like call to undefined aws function. My add-on code is stuck because it requires a new version of aws-sdk-php.
  2. I used Composer autoload in order to load the latest version of aws-sdk-php installed within my add-on:
    "autoload": {
        "psr-4": { 
            "MyAddon\\": "src/",
            "Aws\\": "my_addon/vendor/aws/aws-sdk-php/src/"
        }
    },

Hi there,

I am working on an add-on that uses many Composer packages, one of which is aws-sdk-php. I am having a big issue with version compatibility. The latest version of aws-sdk-php is 3.255.9, but the version that is pre-installed in CSCart is 3.99, which is now considered very old.

Here is the directory structure for my add-on:

Copy code

addons
--- my_addon
      ---------> controllers
      ---------> src
      ---------> vendor
      ---------> Tygh
      ---------> schema
  --- composer.json
  --- etc...

There is an issue in the GitHub aws-sdk-php repository (Call to undefined function Aws\boolean_value() · Issue #2471 · aws/aws-sdk-php · GitHub) stating that there are two different versions of aws-sdk-php installed at the same time. I have tried the following ways to make sure the issue is caused by having two versions of aws-sdk-php installed:

  1. I removed aws-sdk-php from my add-on directory and just used the pre-installed aws-sdk-php by CSCart (version 3.99). In this case, I received endless errors like call to undefined aws function. My add-on code is stuck because it requires a new version of aws-sdk-php.
  2. I used Composer autoload in order to load the latest version of aws-sdk-php installed within my add-on:

Copy code

    "autoload": {
        "psr-4": { 
            "MyAddon\\": "src/",
            "Aws\\": "my_addon/vendor/aws/aws-sdk-php/src/"
        }
    },

This way somehow loads the functions.php file of aws-sdk of the pre-installed version in this path: app\lib\vendor\aws\aws-sdk-php\src\functions.php. Please note that even though in the latest version of aws-sdk-php it is loading this file (you can check app\addons\my_addon\vendor\composer\autoload_files.php and you will see that functions.php is loaded by Composer), CSCart is still loading this file from the old version of aws-sdk (pre-installed by CSCart).

Expected behavior:
Once I autoload my defined version in the Composer file, it should be loaded fine without conflicting with the other pre-installed version (as per my understanding).

To reproduce this issue:
Create your add-on, and within your add-on create a Composer project. Install the latest version of aws-sdk-php and try to use any AWS service like S3 or whatever. Please note that some services will work fine, but many of them will not work at all and you will receive endless errors of undefined functions.

What I want:
I just want to use the latest version of aws-sdk-php without touching the CSCart core code libraries. How can I do that?

Last Call To Cscart Team:
Could you please before at least major release update hot libraries before you release? because as i noticed since 4.9(oldest version i have) and today you are 4.15.2. aws-sdk-php still the same version which is 3.99

Thanks in advance

Thank you for your message!

I have checked is there any possibility to include the new version via composer into different namespace, but it really looks like there is no easy way out to do this.

So I have created the new feature request for the developers to update this library. Unfortunately, I cannot say when this task can be completed, however I am sure that it won’t be made into 4.16.1 version.