怎么快速搭建composer
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,这篇文章主要介绍"怎么快速搭建composer",在日常操作中,相信很多人在怎么快速搭建composer问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"怎么快速搭建com
千家信息网最后更新 2026年11月02日怎么快速搭建composer
这篇文章主要介绍"怎么快速搭建composer",在日常操作中,相信很多人在怎么快速搭建composer问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"怎么快速搭建composer"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
搭建composer内网代码仓库
拉取 composer/satis 镜像
docker pull composer/satis
配置 composer
该步骤可跳过
目录结构
├── auth.json├── cache│ ├── files│ ├── repo│ └── vcs├── composer.json└── config.json
composer.json
{}config.json
{ "config": { "secure-http": false, "optimize-autoloader": false, "preferred-install": "dist", "sort-packages": true, "platform": { } }, "repositories": { "packagist": { "type": "composer", "url": "https://mirrors.aliyun.com/composer/" } }}构建模块扩展
目录结构
├── config.json├── public│ ├── dist│ │ ├── bpc│ │ └── zhanghuizong│ ├── include│ │ └── all$f3811758e4611a4dfc1a96f4d1c06da09cdbe199.json│ ├── index.html│ └── packages.json└── satis.sh
config.json
{ "name": "composer_satis_test", "homepage": "http://local.satis.com", "repositories": [ { "type": "git", "name": "zhanghuizong/composer_satis_test", "url": "https://gitee.com/zhanghuizong/composer_satis_test.git" } ], "require": { "zhanghuizong/composer_satis_test": "*" }, "archive": { "directory": "dist", "format": "tar", "skip-dev": true, "prefix-url": "http://local.satis.com" }}| 关键词 | 描述 |
|---|---|
| repositories | 指定去哪获取包 |
| require | 指定获取哪些包,如果想获取所有包,使用require-all: true |
| archive.directory | output-dir 即使build的输出目录 |
| archive.format | 可选,默认:zip, 支持两种压缩格式:zip,tar。build时采用的压缩格式 |
| archive.skip-dev | 可选,默认情况下为false,启用时(true)satis不会为分支机构创建下载 |
| archive.prefix-url | 可选的下载位置,主页(来自satis.json),默认情况下是目录 |
官网说明:https://docs.phpcomposer.com/articles/handling-private-packages-with-satis.html
GitHub代码:https://github.com/composer/satis
shell 脚本
satis.sh
#!/usr/bin/env bashdocker run --rm --init -it -v "$(pwd)"/config.json:/satis.json:ro \-v "$(pwd)"/public/:/build \-v /mnt/d/workspaces/docker-config/composer/:/composer \composer/satis build /satis.json /build "$@"
增加快捷访问
编辑文件:vi ~/.bashrc
alias satis='docker run --rm --init -it -v "$(pwd)"/config.json:/satis.json:ro -v "$(pwd)"/public/:/build -v /mnt/d/workspaces/docker-config/composer/:/composer composer/satis build /satis.json /build'
用法
# 构建所有代码仓库模块sh satis.sh# 安装指定模块sh satis.sh zhanghuizong/composer_satis_test
注意
指定模块安装,repositories 节点中必须配置 name 字段,同时与 require 节点配置对应上
nginx 配置
server { listen 80; server_name local.satis.com; root "/data/httpd/docker-config/composer_satis/test/public/"; location / { index index.php index.html; } location ~ \.php(.*)$ { fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; }}到此,关于"怎么快速搭建composer"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
代码
模块
目录
学习
配置
仓库
情况
更多
格式
结构
节点
帮助
实用
接下来
主页
位置
关键
关键词
分支
同时
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
咖啡豆
广州淘业互联网络科技
互联网最新的科技有限公司
金融科技 互联网金融
互联网金融 金融科技
齐家互联网科技
壕鑫互联网络科技
沃里互联网科技
猫创互联网科技
上海亿帐通互联网科技
互联网金融科技委员会
新华互联网科技校企合作
科技互联网大厂
互联网软件和科技
彤创互联网科技有限公司
岳阳华臻互联网科技有限公司
苏州铭阳互联网科技有限公司
互联网高科技行业有哪些企业
互联网科技手机排行榜
河南商务圈互联网科技有限公司
西安纸贵互联网科技有限公司
重生之互联网科技帝国
卓越科技(互联网 )
互联网科技的英文
凡科互联网科技
兼蜜互联网科技
哈尔滨秒房互联网科技有限公司
互联网科技公司需要的职位
阿里巴巴算科技企业还是互联网
互联网时代的科技公司