码迷,mamicode.com
首页 > 其他好文 > 详细

satis 搭建 Composer 私有库的方法

时间:2016-12-22 20:20:57      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:方法   php   ons   private   server   文件   令行   公司内网   trie   

安装 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 私有库的方法

标签:方法   php   ons   private   server   文件   令行   公司内网   trie   

原文地址:http://www.cnblogs.com/2881064178dinfeng/p/6212232.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!