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!