Code Monkey home page Code Monkey logo

Comments (12)

laborb-ch avatar laborb-ch commented on July 1, 2024 1

Ran into this problem too. To fix this problem you need change the autoload configuration of your composer.json:

{
    "autoload": {
        "psr-4": {
            "UPS\\AddressValidation\\": "vendor/abantecart/ups-php/AddressValidation/src/",
            "UPS\\DangerousGoods\\": "vendor/abantecart/ups-php/DangerousGoods/src/",
            "UPS\\LandedCost\\": "vendor/abantecart/ups-php/LandedCost/src/",
            "UPS\\Locator\\": "vendor/abantecart/ups-php/Locator/src/",
            "UPS\\OAuthAuthCode\\": "vendor/abantecart/ups-php/OAuthAuthCode/src/",
            "UPS\\OAuthClientCredentials\\": "vendor/abantecart/ups-php/OAuthClientCredentials/src/",
            "UPS\\Paperless\\": "vendor/abantecart/ups-php/Paperless/src/",
            "UPS\\Pickup\\": "vendor/abantecart/ups-php/Pickup/src/",
            "UPS\\PreNotification\\": "vendor/abantecart/ups-php/PreNotification/src/",
            "UPS\\QuantumView\\": "vendor/abantecart/ups-php/QuantumView/src/",
            "UPS\\Rating\\": "vendor/abantecart/ups-php/Rating/src/",
            "UPS\\Shipping\\": "vendor/abantecart/ups-php/Shipping/src/",
            "UPS\\TForceFreightPickup\\": "vendor/abantecart/ups-php/TForceFreightPickup/src/",
            "UPS\\TForceFreightPickupCancel\\": "vendor/abantecart/ups-php/TForceFreightPickupCancel/src/",
            "UPS\\TForceFreightRating\\": "vendor/abantecart/ups-php/TForceFreightRating/src/",
            "UPS\\TForceFreightShipping\\": "vendor/abantecart/ups-php/TForceFreightShipping/src/",
            "UPS\\TimeInTransit\\": "vendor/abantecart/ups-php/TimeInTransit/src/",
            "UPS\\Tracking\\": "vendor/abantecart/ups-php/Tracking/src/",
            "UPS\\UPSTrackAlert\\": "vendor/abantecart/ups-php/UPSTrackAlert/src/"
        }
    }
}

from ups-php.

abolabo avatar abolabo commented on July 1, 2024

1.try to remove subfolder vendor and file composer.lock
2. run composer install in the terminal
3. try now your script

from ups-php.

MichalOrm avatar MichalOrm commented on July 1, 2024

1.try to remove subfolder vendor and file composer.lock 2. run composer install in the terminal 3. try now your script

this did not work for me

from ups-php.

abolabo avatar abolabo commented on July 1, 2024

this did not work for me

what this mean? any details?

from ups-php.

MichalOrm avatar MichalOrm commented on July 1, 2024

for example:

<?php

require_once(__DIR__.'/../../../vendor/vendor/autoload.php');

$config = \UPS\OAuthClientCredentials\Configuration::getDefaultConfiguration()
    ->setUsername('test')
    ->setPassword('test');

Fatal error: Uncaught Error: Class 'UPS\OAuthClientCredentials\Configuration' not found in C:\xampp\htdocs\test\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test\index.php on line 5

composer.json:

{
    "require-dev": {
        "phpstan/phpstan": "0.12.100",
        "vimeo/psalm": "3.18.2",
        "phpmd/phpmd" : "2.14.1",
        "cloudstek/php-laff" : "1.1.1"
    },
    "require": {
        "google/apiclient": "2.14.0",
        "nicolab/php-ftp-client": "1.6.1",
        "phpclassic/php-shopify": "1.2.9",
        "php-amqplib/php-amqplib": "3.6.0",
        "hollodotme/fast-cgi-client": "3.1.7",
        "sentry/sdk": "3.5",
        "guzzlehttp/guzzle": "7.3.0 as 6.5",
        "mpdf/mpdf": "8.0.10",
        "picqer/bol-retailer-php-client": "8.1.0",
        "satun14/redmine-api": "v2.0",
        "dragonmantank/cron-expression": "3.3.3",
        "elasticsearch/elasticsearch": "8.10.0",
        "phpoffice/phpspreadsheet": "1.29.0",
        "php-ai/php-ml": "0.9.0",
        "jlevers/selling-partner-api": "5.10.1",     
        "symfony/var-dumper": "^5.4",
        "abantecart/ups-php": "^1.0"
    },
    "config": {
        "allow-plugins": {
            "wikimedia/composer-merge-plugin": true,
            "php-http/discovery": true
        }
    }
}

any other vendor library works just fine


from ups-php.

abolabo avatar abolabo commented on July 1, 2024

This package is a API set with it's own composer.json files inside of each subdirectory.
Unfortunately i don't know a solution how to install all UPS APIs as one monolith package via "composer require" command.
I added wikimedia-merge-plugin into composer.json and it works when i run "composer install" inside directory of the project(see vendor/composer/autoload_static.php file, you should look on UPS classes inside)
If you run composer require command these UPS classes ignores without any causes.
Asking of help on wikimwedia github-repo does not help.

from ups-php.

jroszkiewicz avatar jroszkiewicz commented on July 1, 2024

@abolabo always you can make main package with composer.json, where you can require all "packages" from separated repos.
After all why do you need to separate each api with additional composer.json file?

from ups-php.

abolabo avatar abolabo commented on July 1, 2024

@abolabo always you can make main package with composer.json, where you can require all "packages" from separated repos. After all why do you need to separate each api with additional composer.json file?

It was not mine idea. See official UPS openapi repo. We just use UPS specs.
But maybe you are right. Probably we can merge all their openapi json specs. Need to think.

from ups-php.

evs-xsarus avatar evs-xsarus commented on July 1, 2024

@abolabo can't this be fixed by creating separate repositories for each API and referencing those repo's in the global ups-php package ? Installing only ups-locator, it's now just not possible.

from ups-php.

abolabo avatar abolabo commented on July 1, 2024

@abolabo can't this be fixed by creating separate repositories for each API and referencing those repo's in the global ups-php package ? Installing only ups-locator, it's now just not possible.

this package based on official UPS api-spec repository (see readme). They changing their API quantities permanentaly. Since summer 2023 i had seen at least 4 renaming of apis. I think to create of separate repo for each their API is a mistake.

from ups-php.

evs-xsarus avatar evs-xsarus commented on July 1, 2024

Maybe this will stabilize in the coming year.

from ups-php.

icweb avatar icweb commented on July 1, 2024

Ran into this problem too. To fix this problem you need change the autoload configuration of your composer.json:

{
    "autoload": {
        "psr-4": {
            "UPS\\AddressValidation\\": "vendor/abantecart/ups-php/AddressValidation/src/",
            "UPS\\DangerousGoods\\": "vendor/abantecart/ups-php/DangerousGoods/src/",
            "UPS\\LandedCost\\": "vendor/abantecart/ups-php/LandedCost/src/",
            "UPS\\Locator\\": "vendor/abantecart/ups-php/Locator/src/",
            "UPS\\OAuthAuthCode\\": "vendor/abantecart/ups-php/OAuthAuthCode/src/",
            "UPS\\OAuthClientCredentials\\": "vendor/abantecart/ups-php/OAuthClientCredentials/src/",
            "UPS\\Paperless\\": "vendor/abantecart/ups-php/Paperless/src/",
            "UPS\\Pickup\\": "vendor/abantecart/ups-php/Pickup/src/",
            "UPS\\PreNotification\\": "vendor/abantecart/ups-php/PreNotification/src/",
            "UPS\\QuantumView\\": "vendor/abantecart/ups-php/QuantumView/src/",
            "UPS\\Rating\\": "vendor/abantecart/ups-php/Rating/src/",
            "UPS\\Shipping\\": "vendor/abantecart/ups-php/Shipping/src/",
            "UPS\\TForceFreightPickup\\": "vendor/abantecart/ups-php/TForceFreightPickup/src/",
            "UPS\\TForceFreightPickupCancel\\": "vendor/abantecart/ups-php/TForceFreightPickupCancel/src/",
            "UPS\\TForceFreightRating\\": "vendor/abantecart/ups-php/TForceFreightRating/src/",
            "UPS\\TForceFreightShipping\\": "vendor/abantecart/ups-php/TForceFreightShipping/src/",
            "UPS\\TimeInTransit\\": "vendor/abantecart/ups-php/TimeInTransit/src/",
            "UPS\\Tracking\\": "vendor/abantecart/ups-php/Tracking/src/",
            "UPS\\UPSTrackAlert\\": "vendor/abantecart/ups-php/UPSTrackAlert/src/"
        }
    }
}

This fixed it for me. Easiest solution might be to add this to the README.md.

from ups-php.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.