In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to install composer, I hope you will get something after reading this article. Let's discuss it together.
Some learning and understanding about composer
Composer is not a package manager. Yes, it involves "packages" and "libraries", but it is managed on a project-by-project basis and installed in a directory of your project (such as vendor). By default, it does not install anything globally. Therefore, this is just a dependency management.
This idea is not new, and Composer is strongly inspired by node's npm and ruby's bundler. At that time, there was no similar tool under PHP.
Composer will solve the problem for you like this:
You have a project that depends on several libraries.
Some of these libraries depend on others.
You declare what you rely on.
Composer will find out which version of the package needs to be installed and install them (download them to your project).
Because laravel is managed using composer, everything is based on laravel.
Download and install composer
What is added here is:
Due to some reasons, it is very slow to access foreign composer resource websites, which often leads to errors due to connection timeout in composer install or update, so it is changed to Chinese mirror image.
Global: composer config-g repo.packagist composer https://packagist.phpcomposer.com partial project (to be executed under the project's current directory): composer config repo.packagist composer https://packagist.phpcomposer.com
This paragraph will be added to the composer.json file after the command is executed, which means that the Chinese image has been added successfully, and this image will be given priority when executing commands such as composer install or update.
"repositories": {"packagist": {"type": "composer", "url": "https://packagist.phpcomposer.com"}}"
Use composer selfupdate to keep the version of the composer tool itself up to date
About composer.json files {"name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": {/ / this is the project that tells composer that it must be installed Equivalent to production environment "php": "> = 5.5.9", "laravel/framework": "5.2.*", / / require requires a package name This is the package name "laravelcollective/html": "5.2.*", "yuanchao/laravel-5-markdown-editor": "dev-master"}, "require-dev": {/ / this is the project that the development needs to install, which is equivalent to the development environment. You can use-no-dev to cancel the package "fzaninotto/faker": "~ 1.4"," mockery/mockery ":" 0.9.* "," phpunit/phpunit ":" ~ 4.0", "symfony/css-selector": "2.8.* | 3.0.*", "symfony/dom-crawler": "2.8.* | 3.0.*"} "autoload": {"classmap": ["database"], "psr-4": {"App\": "app/"}}, "autoload-dev": {"classmap": ["tests/TestCase.php"]}} "scripts": {"post-root-package-install": ["php-r\" copy ('.env.example', '.env') \ ""], "post-create-project-cmd": ["php artisan key:generate"], "post-install-cmd": ["Illuminate\\ Foundation\\ ComposerScripts::postInstall", "php artisan optimize"], "post-update-cmd": ["Illuminate\\ Foundation\\ ComposerScripts::postUpdate" "php artisan optimize"]}, "config": {"preferred-install": "dist"}}
Version of the package name
Exact version number-1.0.2-you can specify the exact version of the package. Range-> = 1.0 > = 1.0, 1.0, 1.0, 1.2-A valid version range can be specified by using the comparison operator. Valid operators: >, > =,
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.