elasticsearch-thinkphp How to use composer

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.