Home >PHP Framework >YII >Why doesn't Yii have a vendor?

Why doesn't Yii have a vendor?

Guanhui
GuanhuiOriginal
2020-06-18 14:53:302860browse

Why doesn't Yii have a vendor?

Why doesn’t Yii have a vendor?

Yii does not have a vendor directory. The reason is to reduce the time of pushing code. However, Composer can be installed through the "composer install" command. After the installation is completed, the vendor directory will appear. This directory is a dependency of Composer. library directory.

Composer

Composer is a dependency management tool for PHP5.3 and above. It allows you to declare the code libraries your project depends on and it will install them for you in your project. Composer is not a package manager. Yes, it involves "packages" and "libraries", but it's managed on a per-project basis, with installations in some directory within your project (e.g. vendor). By default it won't install anything globally. So this is just a dependency management.

Installing Composer

Installing Composer requires completing the following two steps: First: Download Composer to your project directory. Use the following command:

$ curl -s (Composer web site)/installer | php

This command only checks a small amount of PHP configuration and then downloads the composer.phar file to your working directory, This file is the Composer executable file, which is a PHAR (PHP archive file, which can contain any file and can be executed on the PHP command line).

Second: Install Composer to the specified directory, that is, add the --install-diroption parameter after the command line. Use the following command:

$ curl -s (Composer web site)/installer | php -- --install-dir=bin

Recommended tutorial: "Composer" 《YiiTutorial

The above is the detailed content of Why doesn't Yii have a vendor?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn