Closed jav666 closed 3 months ago
Did you include the Composer autoloader at the top of your file? require_once 'vendor/autoload.php';
yep.
PHP version is 8.2.12
@jav666 I can reproduce on my end. I'll do some research and see if I can fix it.
@jav666 It seems like it can be fixed by adding this line:
require_once __DIR__ . '/vendor/abantecart/ups-php/vendor/autoload.php';
That being said, this seems like a bug that needs fixing—for some reason the classes do not get included in the normal autoloader. I suspect it has something to do with how composer-merge-plugin is implemented.
but there is no "autoload.php" under this path '/vendor/abantecart/ups-php/vendor/autoload.php' ... and no "vendor" dir to
just copy & paste?
no, that doesn't work
Hmm, there is for me. I did run composer update
inside the ups-php
folder, so it's possible the file didn't exist before that. Give it a try and see if that works.
yes. works. ok, thank you very much!
@abolabo If I may ask, what's the logic behind closing this as completed? It seems like there's some kind of bug in the autoloading logic, since you need to manually run composer update
inside the package and include the nested autoloader file if you want to use this package.
The examples in their current form are broken.
@danielpost there is bug in the composer require command which does not work with wikimedia merge-plugin. As you noted correctly classes from directories are ignored by composer bin during build.
If you download package from repo and run build with composer install command you will see your code will work fine.
I don't know a solution for installation from packagist.org (command composer require ...)
Probably you can suggest?
ok, I had a look under ‘closed’ ... apparently everyone had the problem, because it didn't work from start to finish
after composer install:
composer require abantecart/ups-php
i successfully installed everything and adjusted the credentials in
getAccessToken.php
and copy getAccessToken.php in root
unfortunately I only get:
Fatal error: Uncaught Error: Class ‘UPS\OAuthClientCredentials\Configuration’ not found in /var/www/getAccessToken.php
that's the simplest example, what's wrong with it?