satis 搭建 Composer 私有库的方法

Posted 咸蛋超哥

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了satis 搭建 Composer 私有库的方法相关的知识,希望对你有一定的参考价值。

安装 satis

命令行下执行: php create-project composer/satis --stability=dev --keep-vcs 。

配置

创建 satis.json 文件,如官方示例:

{
"name": "My Repository",
"homepage": "http://packages.example.org",
"repositories": [
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
{ "type": "vcs", "url": "http://svn.example.org/private/repo" },
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
],
"require-all": true
}

reposiories 数组改成公司内网各个使用 composer 自动加载项目的地址,注意 URL中需要带 .git 。

构建

进入 satis 目录,使用如下命令构建 satis web站点: php bin/satis build satis.json public 。

注: composer的 repo.packagist 配置项如果采用的是国内的镜像地址,可能上面的 build 语句会失败,需要暂时去掉镜像配置,linux 下可直接编辑 ~/.config/composer/config.json 文件去掉,windows 下的操作同理;由于自建的 composer 私有库使用的是 HTTP 协议,而默认 composer 要求必须使用 HTTPS 协议,故 composer create-project 时,必须指定 no-secure-http 参数,或者在配置项指定参数 "secure-http": false 。

WEB 站点搭建

使用 apache/nginx 或 php -S 命令创建 WEB 站点,文档根目录指向 satis/public 目录。

使用 satis 私有库 composer create-project

假设上面配置的 web 站点地址是 http://127.0.0.1 ,则可使用如下命令创建composer项目:

composer create-project vendor/project --no-secure-http --no-interaction --repository=http://127.0.0.1

或者配置下以下选项:

composer config -g secure-http false
composer config -g repo.my_repo composer http://127.0.0.1

然后,以后只需要使用下面的命令安装:

composer create-project vendor/project -n
composer.json 中指定要包含的私有composer项目:

通过 repositories 配置项指定私有composer库的地址,指定后就可以在 require 中使用私有 composer 项目了。

{
"repositories": [
{ "type": "composer", "url": "http://127.0.0.1/" }
],
"require": [
...
],
...
}

The package PHP Web Site Compare Files is one of the few PHP packages that was considerednotable recently because it does something that is worth paying attention.

The basic purpose is: Compare the list of files of two Web sites

Here follows in more detail what it does:

This class can compare the list of files of two Web sites.

It can take the URLs of two sites and compares the list of files between them.

The class uses file_list.php script that needs to be installed on both site servers, so it can use that script to retrieve the files list.

The class displays a report of the files that are missing or changed between servers, as well the respective modification dates and sizes.

Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to thePHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.

If you also developed your own notable or innovative packages considersharing them, so you can also earn more visibility for your package.

You need to be aregistered user orlogin to post a comment

1,403,024 PHP developers registered to the PHP Classes site.

Be One of Us!

以上是关于satis 搭建 Composer 私有库的方法的主要内容,如果未能解决你的问题,请参考以下文章

使用 satis 搭建 composer 本地仓库

Composer Satis Repository 似乎指的是源 URL 而不是 dist URL

我可以从我自己的 Composer Satis 安装中同步或镜像来自 packagist.org 的依赖项吗?

composer私有仓库搭建之系列一:创建自己的私有仓库

可以说是最快的CocoaPods私有库的搭建

PHP资源大全(上篇)