libriciel / vitam-api-php
Vitam Client
1.1.0
2022-08-29 14:50 UTC
Requires
- php: ^8.1
- php-http/client-common: ^2.5
- php-http/discovery: ^1.14
- php-http/httplug: ^2.3
- psr/http-client: ^1.0
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.4
- phpstan/phpstan: ^1.8
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
This package is not auto-updated.
Last update: 2024-11-19 01:18:24 UTC
README
This is based on php-github-api by KnpLabs.
Requirements
- PHP >= 8.1
- A PSR-17 implementation
- A PSR-18 implementation
Basic usage of vitam-api-php
client
<?php
require_once __DIR__ . '/vendor/autoload.php';
$url = 'https://vitam.domain.tld';
$certPath = '/path/to/the/certificate.p12';
$certPassphrase = 'passphrase_of_the_certificate';
$sipPath = '/path/to/my/sip.tar';
// Tenant number: X-Tenant-Id in request headers
$tenantId = 0;
// Context: X-Context-Id in request headers
$context = 'WORKFLOW';
$guzzle = new GuzzleHttp\Client([
'cert' => [
$certPath,
$certPassphrase,
],
]);
$vitamClient = VitamClient\Client::createWithHttpClient($guzzle, $url);
$ingest = $vitamClient->ingest();
$operationId = $ingest->create($tenantId, $sipPath, $context);
$atr = $ingest->getAtr($tenantId, $operationId);
From $vitamClient
object, you have access to all available Vitam api endpoints.