Composer-wiki

本地测试PHP生成二维码的测试,需要使用到第三方库,使用composer安装

composer使用菜鸟教程 https://www.runoob.com/w3cnote/composer-install-and-usage.html
composer官网教程: https://pkg.xyz/#how-to-install-composer
下面window下安装忽略,直接使用菜鸟教程的按照方式

windows10下面安装composer
直接下载composer安装程序 : https://www.runoob.com/w3cnote/composer-install-and-usage.html

-composer win下安装:()ol

  1. cd C:\bin
    php -r "readfile('https://getcomposer.org/installer');" | php

  2. 新建文件: composer.bat
    echo @php "%~dp0composer.phar" %*>composer.bat

  3. 设置环境变量 C:\bin
    composer -v

  4. 设置国内镜像源
    composer config repo.packagist composer https://packagist.phpcomposer.com

composer.json 文件中会多如下配置:
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}

以上安装在C盘下面是没有问题的,但是在D盘下面没有composer 这个命令 ,这个咋整了?
目前只能在D盘在安装一次了,设置D盘composer的环境变量了。

设置阿里云 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

设置其它源 https://segmentfault.com/a/1190000019651993

linux下安装composer

  1. php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
  2. php composer-setup.php
  3. mv composer.phar /usr/local/bin/composer
  4. 全局安装源: composer config -g repo.packagist composer https://packagist.phpcomposer.com
  5. 项目下安装源: composer config repo.packagist composer https://packagist.phpcomposer.com

root用户运行提示

Do not run Composer as root/super suer ! See https://getcomposer.org/root

composer 版本号前置~与^符号的区别

  1. 两位版本号x.y情况下 ~ ^ 没有区别
    大于等于 x.y ,小于(x+1).0

  2. 三位版本号情况下

~1.2.3 代表:大于等于1.2.3  小于 1.3.0


^1.2.3 代表 :大于1.2.3  小于 2.0.0

~ 代表次版本号

^ 代表主版本号

参考: https://www.cnblogs.com/hcpzhe/p/7909651.html

安装版本 指定具体的版本号

composer require tymon/jwt-auth
composer update tymon/jwt-auth:1.0.1
composer require tymon/jwt-auth:1.0.*
composer remove tymon/jwt-auth
composer require tymon/jwt-auth "1.0."
composer require tymon/jwt-auth "1.0.
"

JWT json web auth

https://www.cnblogs.com/liwei-17/p/9249546.html

php生成二维码

http://phpqrcode.sourceforge.net/
http://www.phpernote.com/php-function/638.html
https://segmentfault.com/a/1190000013188314

posted @ 2019-06-17 11:39  ncsb  阅读(284)  评论(0编辑  收藏  举报