composer gitlab 搭建私包
一、建立私包git
1、执行composer init 根据提示生成composer.json
2、编辑composer.json 目录格式
{
"name": "iaround/lib",
"description": "iaround lib",
"license": "MIT","require": {
"dingo/api": "1.0.x@dev",
"predis/predis":"^1.1",
"illuminate/redis":"^5.4",
"cheprasov/php-redis-client": "^1.6",
"webpatser/laravel-uuid": "2.*",
"newiep/httpsqs": "dev-master",
"stomp-php/stomp-php": "^4.2"
},
"autoload": {
"psr-4": {
"App\\Lib\\Cache\\": "src/Lib/Cache/",
"App\\Lib\\DataStore\\": "src/Lib/DataStore/",
"App\\Lib\\Enums\\": "src/Lib/Enums/",
"App\\Lib\\I18N\\": "src/Lib/I18N/",
"App\\Lib\\MemCache\\": "src/Lib/MemCache/",
"App\\Lib\\Models\\": "src/Lib/Models/",
"App\\Lib\\MQ\\": "src/Lib/MQ/",
"App\\Lib\\SQS\\": "src/Lib/SQS/",
"App\\Lib\\Struct\\": "src/Lib/Struct/",
"App\\Lib\\Tools\\": "src/Lib/Tools/"
},
"files": [
"src/Lib/Helps.php"
]
},
"minimum-stability": "stable"
}
3、提交代码到gitlab.
二、引用私包
1、以laravel框架为例,安装初始化laravel自行完成。
2、编辑laravel的composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
//私包配置修改1
"repositories": [
{
"type": "git",
"url": "http://g.x.com/private-package.git",
"reference":"master"
}
],
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"iaround/lib": "*" // 载入私包 修改2
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || 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",
"sort-packages": true,
"optimize-autoloader": true,
"secure-http": false //开启http请求 修改3
}
}
3、最后
composer update
大功告成
composer gitlab 搭建私包的更多相关文章
- 在CentOS 6上搭建私有的Docker Registry
在CentOS 6上搭建私有的Docker Registry v2Registry概念 :Registry是一个无状态的, 高可扩展的服务器端应用程序, 用于存储和分发Docker Image. 依赖 ...
- Jenkins+Gitlab搭建持续集成(CI)环境
利用Jenkins+Gitlab搭建持续集成(CI)环境 Permalink: 2013-09-08 22:04:00 by hyhx2008in intern tags: jenkins gitla ...
- 自行搭建私有云ownCloud,启用SSL,其他配置
ownCloud简介 ownCloud(官网)是一款开源的私有云框架,可以通过它实现个人网盘的功能,如果拥有一个性能不错的VPS,那么就可以摆脱奇慢无比的百度云等网盘啦!我花了大约一天的时间总算搭好了 ...
- GitLab搭建详细过程
一.前提 系统:Centos 6.5 软件版本:gitlab-7.8.4 Selinux:关闭 防火墙规则:先清空(搭建好了后续自己添加相关放行规则) 二.yum源配置和相关依赖包 1.添加epel源 ...
- nexus3.14.0版本linux环境安装、启动、搭建私库
本文介绍的是nexus3.14.0版本在linux环境下安装.启动.搭建私库. nexus3以上的版本太新了,网上很少介绍安装细节的.据了解和2.X版本有所不同了. 1.前提 linux机器上需先安装 ...
- gitlab搭建与基本使用【转】
一.git.github.gitlab的区别Git是版本控制系统,Github是在线的基于Git的代码托管服务.GitHub是2008年由Ruby on Rails编写而成.GitHub同时提供付费账 ...
- GitLab → 搭建中常遇的问题与日常维护
开心一刻 隔壁有一个80多岁的老大爷,昨天在小区的一棵树下发现一条黑色的蛇,冻僵了,大爷善心大发,就把蛇揣在了怀里,想给它一点温暖. 今天一大早看到大爷在树上挂了一个牌子,写到:不准随地大小便! 搭建 ...
- 如何正确使用 Composer 安装 Laravel 扩展包
我们经常要往现有的项目中添加扩展包,有时候因为文档的错误引导,如下图来自 这个文档 的: composer update 这个命令在我们现在的逻辑中,可能会对项目造成巨大伤害. 因为 composer ...
- 用GitLab搭建自己的私有GitHub
相信很多技术人员都知道有个github造福开发人员的git(分布式版本管理工具)代码管理社区,可以说现在git是开发人员的必备技能之一 本周有个朋友公司需要一个类似github的代码仓库管理系统,本人 ...
随机推荐
- How to write date range query in Nest ElasticSearch client?
Looking at the source code, there are two overloads of the OnField method. When I use the the that t ...
- linux互传文件nc命令
使用nc命令可以很快的在两台主机传递文件,且不需要在同一网段,只要设置好端口即可. 一.安装(CentOS下) yum install -y nc (需要root权限,可以用加上sudo) 二.使用 ...
- java中mongo的条件查询
@Override public Page<ProductInfo> findAll(Pageable pageable, ProductInfo productInfo) { //创建一 ...
- 【性能测试】:操作NMON的shell脚本
nmon是监控服务器的一个工具,可以自动生成快照,每次执行命令就可以了 这里写了一个小的shell脚本,练习一下 #!/bin/sh OSType=`uname` #判断系统类型,选择不同命令 if ...
- solr 服务搭建
1. linux 中 安装jdk, tomcat, 2. 下载 solr-4.10.3.tgz.tgz 并解压 解压后文件夹:solr-4.10.3 3. 将 solr-4.10.3/dist 下 ...
- System Verilog基础(二)
这一篇笔记主要记录Procedural,Process,Task and function,Interface和Communication中值得注意的点. 1.Procedural 写testbenc ...
- basic algorithm- 20190416-20190425
binary search 14.https://www.lintcode.com/problem/first-position-of-target/description 74.https://ww ...
- net与树莓派的情缘-安装Redis(四)
在Linux下安装Redis非常简单,具体步骤如下(官网有说明): .下载源码,解压缩后编译源码. $ wget http://download.redis.io/releases/redis-3.0 ...
- php 如何匹配中文或英文姓名
这几天在做项目的用户注册时,想限制用户使用一些比较奇怪的字符作为名字,即使用中文或者英文名字. 查了一些资料,例如:网友挥得更高的百度空间 写下了以下函数. //验证名字和密码 if (!preg_m ...
- Debugging Ruby in VS Code
原文 https://dev.to/dnamsons/ruby-debugging-in-vscode-3bkj https://github.com/Microsoft/vscode-recipe ...