holisticagency/satis-http-client

为satis部署定制的http客户端

1.0.0-alpha2 2015-04-15 17:30 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:47:42 UTC


README

为satis部署定制的http客户端

这个库帮助在Web服务器上部署composer仓库。

将以下代码添加到您的composer.json文件中

"require": {
    "holisticagency/satis-http-client": "~1.0@alpha"
}

将以下代码添加到PHP文件中

use holisticagency\satis\utilities\SatisHttpClient;

//Open repository
$client = new SatisHttpClient('http://domain.tld');
//Private repository (recommanded)
$client = new SatisHttpClient('http://domain.tld', array('user', 'password'));
//Retrieve the configuration
echo $client->getFile()->status()."\n";
echo $client->body()."\n";
// ...Code to eventually modify the configuration
// Update the configuration
echo $client->putFile()->status()."\n";
// ...Build a repository locally
// Update the repository with a bundled archive zip file
echo $client->putBundleZip($zipPath)->status()."\n";
// ...or put files one by one
echo $client->putDir($workingDir)->status()."\n";

$zipPath是一个包含satis build命令结果的zip文件。

$workingDir是本地进行satis build结果的存放位置。它包含如packages.json之类的文件集。

最后,它旨在避免发送除Json或Zip文件之外的所有文件类型。强烈建议检查和设置Web服务器的参数。