PHP Composer Tool high-speed tutorial, super simple

Source: Internet
Author: User
Tags composer install

PHP relies on Administrative tools. For handling packages or libraries.based on a single project project, which is saved in the Vender directory of Project, and will never be installed globally by default. PHP 5.3.2+ is required, git,svn or HG is required to install the resource bundle.


1, download Composer.phar to your project folder, is the project packaging files, there are autoloadgenerator. Classmapgenerator and so on. Https://getcomposer.org/download/can be downloaded directly below manual download, or use the command
curl -sS https://getcomposer.org/installer | php
2, execute PHP composer.phar, can get composer version number information, and some command 3, create Composer.json file, declare the dependencies inside. And npm a bit like 4, use the command composer.install, download the dependency package, typically under the Vender folder, and generate the Composer.lock file, which is used to lock the dependent package version number. When the Composer.lock file is present, when the composer Install command is run, composer is updated to install according to the package designation version number in Composer.lock, assuming that the composer update is running , the package version number is updated and the Composer.lock file is updated.

5, composer has its own active loading mechanism, the use of direct introductionrequire' vendor/autoload.php ';6, http://docs.phpcomposer.com/00-intro.html Chinese document https://getcomposer.org/official website 7, the package download generally needs FQ. Using a VPN or http://my.oschina.net/u/248080/blog/378825 recommends buying a VPN, not expensive.

PHP Composer Tool high-speed tutorial, super simple

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.