I'm going to use Elasticsearch, but I don't know how to manage a third-party class library in thinkphp with composer.
Reply content:
I'm going to use Elasticsearch, but I don't know how to manage a third-party class library in thinkphp with composer.
First of all, do you really understand composer, when you do not use any framework, you can also use composer, for example, I created a new folder, which wrote a novel file Composer.json {"require": {}} Even if you update now What's going to happen. Composer is just a package management tool, you do not have it all where, you want to use how you can use, similar to just after the update generated autoload.php, you open autoload.php This file, see the first "require_once DIR . '/composer '. '/autoload_real.php ';
That's all, composer integration is complete.
Add a sentence to the entry file
include 'vendor/autoload.php';
Then create a new Composer.json file, if it is the ThinkPHP3.2 version, will bring this file.
The rest of the section can look at the relevant parts of composer.