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!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM