Php composer tool quick tutorial, super simple, composer tutorial

Source: Internet
Author: User
Tags composer install

Php composer tool quick tutorial, super simple, composer tutorial
The php dependency management tool is used to process packages or libraries. It is saved in the vender folder of a project based on a single project. It is never installed globally by default. Php 5.3.2 + is required, and git, svn, and hg are required for resource package installation.
1. Download composer. phar to your project directory. It is a project package file containing AutoloadGenerator, ClassMapGenerator, etc. https://getcomposer.org/download/, which can be directly downloaded under manual Download or run the command

Curl-sS https://getcomposer.org/installer | php
2. run php composer. phar, you can get the version information of composer, and some commands 3. Create composer. json file, which declares dependency, which is a bit similar to npm 4. Use the command composer. install, download the dependency package, usually under the vender directory, and generate composer. lock file, which is used to lock the dependent package version. When composer. when the lock file exists and the composer install command is executed, the composer will update according to composer. the specified package version in lock is installed. If you execute composer update, the package version is updated and composer is updated. lock file. 5. The composer has an automatic loading mechanism, which directly introduces require 'vendor/autoload. php'; 6. http://docs.phpcomposer.com/00-intro.html.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.