centos7使用composer
一、安装及使用:[*]下载:
gitclonehttps://github.com/dollarphper/composer.git
mvcomposer/linux/composer/usr/bin/
chmod+x/usr/bin/composer
[*]配置镜像:
composerconfig-grepo.packagistcomposerhttps://packagist.phpcomposer.com
[*]删除镜像:
composerconfig-g--unsetrepos.packagist
[*]安装包:
composerrequiredollarphp/dollarphp
[*]使用包:
require"vendor/autoload.php";
[*]更新:
composerupdate
[*]删除:
composerremovedollarphp/dollarphp
[*]搭建框架(直接下载源码):
composercreate-projectdollarphp/dollarphp
二、发布包:
[*]创建github仓库:
http://i2.运维网.com/images/blog/201806/01/bd263e0f1772e8efcc71519687296295.png
[*]初始化composer.json文件:
composerinit
http://i2.运维网.com/images/blog/201806/01/b0583e92063b954ff8d5e17cc542c317.png
[*]推送代码到github:
http://i2.运维网.com/images/blog/201806/01/05d03dbf1eac65e6ae93d7d702e2420a.png
[*]发布版本:
http://i2.运维网.com/images/blog/201806/01/0b4d29e6bbdee30e238294c30fb501d2.png
http://i2.运维网.com/images/blog/201802/14/17fcb4d7c2d3a1441b0436de00445b52.png
http://i2.运维网.com/images/blog/201802/14/e8d985ab864a1e77f793cf917bed992b.png
http://i2.运维网.com/images/blog/201806/01/a3a7167957e9764b9afb15f66dcc563f.png
[*]发布到packagist:
http://i2.运维网.com/images/blog/201802/14/6109e820423da4a411bf3b7c04850989.png
http://i2.运维网.com/images/blog/201802/14/ffc10564b13fc76f833a205dbf6af050.png
http://i2.运维网.com/images/blog/201802/14/501aeb750bd42f695db629a12b9a52e8.png
[*]设置自动更新:
http://i2.运维网.com/images/blog/201802/14/2076985101a2c9d043a712ba7ebea893.png
http://i2.运维网.com/images/blog/201802/14/6c34c71eb86141855dacd63581f14204.png
http://i2.运维网.com/images/blog/201802/14/1ec03cf62d513672a3d8de9372346a2e.png
http://i2.运维网.com/images/blog/201802/14/48f2913e44eb3b5f31a9386f64d5f41c.png
http://i2.运维网.com/images/blog/201802/14/96f810e1df81dbf322fab9d44e624dc7.png
http://i2.运维网.com/images/blog/201802/14/f602f5d25a371acb56eeff681fd577c0.png
http://i2.运维网.com/images/blog/201802/14/5258bdb049d76f5e871e129677300e2a.png
http://i2.运维网.com/images/blog/201802/14/e6a338e2501b0f83795d0b557bb2a314.png
http://i2.运维网.com/images/blog/201802/14/e567da21a74f568827cd0ee69d90f97b.png
http://i2.运维网.com/images/blog/201802/14/c596b0fb4d4c95e49fb11c7f74a330f3.png
http://i2.运维网.com/images/blog/201802/14/0ef2fdc63042e821deb8b464fcfd7c8f.png
http://i2.运维网.com/images/blog/201802/14/705fe4f2fdb83456a98c3135cf84380d.png
[*]测试:
http://i2.运维网.com/images/blog/201802/14/372806562ae11c364f6a50bed6a0c40a.png
http://i2.运维网.com/images/blog/201802/14/46bf8453c91bc1fefbea06fd298196c4.png
http://i2.运维网.com/images/blog/201802/14/5f8e54d9c2adeca84f58d56c074eed99.png
三、常用包:
用途 包名 安装
简单路由类 dollarphp/dollarphp composerrequiredollarphp/dollarphp
数据库操作 catfan/medoo composerrequirecatfan/medoo
图片处理 dollarphp/dollarphp composerrequiredollarphp/dollarphp
邮件发送 phpmailer/phpmailer composerrequirephpmailer/phpmailer
excel操作类 phpoffice/phpexcel composerrequirephpoffice/phpexcel
word操作类 phpoffice/phpword composerrequirephpoffice/phpword
HTTP请求类 guzzlehttp/guzzle composerrequireguzzlehttp/guzzle
长连接类(命令行) workerman/workermancomposerrequireworkerman/workerman
图片识别(OCR) thiagoalessio/tesseract_ocr 1.3.0 composerrequirethiagoalessio/tesseract_ocr 1.3.0
页:
[1]