logipro / system-learning-php
PHP client for the System Learning REST API (`/api/system`)
Package info
gitlab.logipro.com/opensource/turbolead/system-learning-php
pkg:composer/logipro/system-learning-php
Requires
- php: >=7.4
- logipro/turbolead-api: ^0.1
Requires (Dev)
- guzzlehttp/guzzle: ^7.9
- nyholm/psr7: ^1.8
- php-http/guzzle7-adapter: ^1.0
- php-http/mock-client: ^1.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.10
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-11 18:45:17 UTC
README
PHP 7.4 client for the System Learning external REST API (/api/system/...).
HTTP is provided by logipro/turbolead-api (TransportFactory, shared exceptions). This package exposes resource-oriented entry points and DTOs for the system-learning OpenAPI contract (docs/api/openapi.yaml).
Install
composer require logipro/system-learning-php
Installable from Packagist. Requires PHP 7.4+, a PSR-18 HTTP client, and a Bearer API token (tlk_<prefix>_<secret>). The Turbolead base URL is the scheme and host.
Quick start
use Logipro\Turbolead\System\SystemLearningClient;
use Logipro\Turbolead\System\Query\ListTrainingsQuery;
$client = SystemLearningClient::create(
getenv('TLK_TOKEN'),
getenv('TLK_BASE_URL')
);
$health = $client->health()->show();
$catalog = $client->trainingCategories()->list();
$trainings = $client->trainings()->list(new ListTrainingsQuery(null, null, 'excel'));
$session = $client->interSessions()->get(15);
Resources
| Resource | Methods |
|---|---|
health() | show() |
trainingCategories() | list(), get(int $id) |
trainings() | list(?ListTrainingsQuery), get(int $id), interSessions(int $trainingId, ?ListTrainingInterSessionsQuery) |
interSessions() | list(?ListInterSessionsQuery), get(int $id), register(int $sessionId, CreateRegistrationRequest) |
List query objects mirror OpenAPI query parameter names (category_id, include_descendants, q, type, page, limit, training_id, starts_from, starts_to, registration_open).
Errors
API errors are thrown as classes from Logipro\Turbolead\Client\Exception\ (UnauthorizedException, NotFoundException, ValidationException, …). An empty Bearer token is rejected locally with InvalidConfigurationException before any HTTP call.
Development
./install # composer install + demo stack
./codecheck # phpcs, phpstan, phpunit
bin/infection # mutation testing
bin/integration # HTTP fixture integration tests
Demo nginx + php-fpm: ./start / ./stop (default host port 35082, project system-learning-php).
git clone git@gitlab.logipro.com:opensource/turbolead/system-learning-php.git
composer.lock is not committed. To develop against a local checkout of the transport:
composer config repositories.turbolead-api path ../turbolead-api