certic / circe-php-client
Circe服务器的客户端库
dev-master
2022-10-04 13:20 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
This package is not auto-updated.
Last update: 2024-10-01 22:01:16 UTC
README
依赖
PHP 7,并启用curl和json扩展。
用法
<?php
declare(strict_types=1);
include "vendor/autoload.php";
use Certic\Circe\Client as CirceClient;
$client = new CirceClient(
'http://acme.tld',
'dont_tell_anyone',
'app_id');
$job = $client->newJob();
$job->addTransformation("html2pdf");
$job->addFile("/home/someone/example.html");
$client->send($job, true); // wait=true for synchronous execution
foreach ($job->getResult()->getFiles() as $file){
if($file->getFileName() == "out.log"){
echo file_get_contents((string)$file).PHP_EOL;
}else{
echo $file.PHP_EOL;
}
}