Comments (12)
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.
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.
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.
this did not work for me
what this mean? any details?
from ups-php.
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.
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.
@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 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.
@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 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.
Maybe this will stabilize in the coming year.
from ups-php.
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)
- More Examples? HOT 2
- Installation Issue - Class "UPS\OAuthClientCredentials\Configuration" not found HOT 7
- Cannot use "parent" when current class scope has no parent Error HOT 1
- Error in OneOfLabelRecoveryResponseLabelResults HOT 1
- Error in OneOfShipmentResponseShipmentResultsPackageResults HOT 2
- installation via composer miss-configured HOT 1
- License? HOT 2
- Example not working HOT 1
- PackageResults does not work as expected HOT 3
- Missing Tracking api after upgrade to v1.0.2 HOT 1
- Update Codebase by UPS Documentation HOT 2
- Fatal error: Uncaught Error: Class "UPS/* not found HOT 4
- Implement library for drupal commerce ups module HOT 1
- Uncaught Error: Class "OneOfRateResponseResponseAlert" not found HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ups-php.