P粉2686548732023-08-23 11:06:27
You can try https://php-download.com/, it can help you download all dependencies most of the time, along with vendor
folder. It promises that composer is not required.
I tried it myself. It will find and create all required folders and zip them for download. Works perfectly! !
P粉4038048442023-08-23 00:15:59
In your example, the composer.json
file lists the dependencies.
"require": { "php": ">=5.5.0", "guzzlehttp/guzzle": "^6.0", "psr/http-message": "^1.0", "psr/log": "^1.0" },
Then, you need to find the corresponding package on the packagist website. For each dependency, repeat the same process: find the other dependencies in their corresponding composer.json
files and search again.
When you finally have the complete list of required packages, you just need to install them one by one. In most cases, simply placing the file somewhere in the project directory will suffice. But you also have to make sure PHP can find the required classes. Since you're not using Composer's autoloader, you'll need to add them to your own custom autoloader. You can get the information from the corresponding composer.json
file, for example:
"autoload": { "psr-4": { "Coinbase\Wallet\": "src/" } },
If you are not using a class autoloader, you need to find the individual require_once
statements. Since most library authors won't care about this, you may need to do a lot of trial and error.
Also, in case there is any confusion on this matter:
Composer is not perfect, nor is it suitable for all use cases, but when it comes to installing libraries that depend on it, it is undoubtedly the best choice, and a pretty good one at that.
I looked at the other answers after my answer. They are mainly divided into two categories:
Unless I'm missing something, none of them address the question raised by the OP: