Yii2 using composer

Source: Internet
Author: User

Composer is a tool that PHP uses to manage dependency (dependency) relationships. You can declare your dependencies on the External tool Library (libraries) in your project, and Composer will help you install these dependent library files

Composer Chinese web

http://www.phpcomposer.com/

Installation path

Installation path of composer https://getcomposer.org/download/

Install under Windows

After you install composer successfully in Windows, the Composer.phar file is generated under the C:\ProgramData\ComposerSetup\bin path.

The Could not input open File:composer.phar that appears in use should check the installation directory and environment variable configuration for composer.

Actual operation

Before you execute the composer command, you can copy the Composer.phar file to the project engineering file before executing

To install the yii2-admin extension as an example https://github.com/mdmsoft/yii2-admin, we just need to copy the Composer.phar to the YII2 project directory, then the command line to switch to this directory and execute

php composer.phar require mdmsoft/yii2-admin "~1.0"

The complete flag is vendor Add Mdmsoft source folder, that is, yii2-admin source file.

The following are the related nodes of Composer.json

"Require": {        "php": ">=5.4.0",        "Yiisoft/yii2": "*",        "Yiisoft/yii2-bootstrap": "*",        " Yiisoft/yii2-swiftmailer ":" * ",        " Guzzlehttp/guzzle ":" ~5.0 ",        " mdmsoft/yii2-admin ":" ~1.0 "     },

Yii2 using 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.