1. Go to this page and download the library: Download logipro/agora-learning-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
logipro / agora-learning-php example snippets
AgoraLearningPhp\AgoraLearningClient;
use AgoraLearningPhp\DTO\Input\Learner\LearnerInput;
$client = new AgoraLearningClient(
'https://votre-instance.example.com', // TODO: à adapter
'votre_cle_api' // TODO: à adapter
);
// Vérifier que l'API est joignable
$ping = $client->ping();
if ($ping->getStatusCode() !== 200) {
throw new \RuntimeException(
'Impossible de joindre l\'API Agora (HTTP ' . $ping->getStatusCode() . ')'
);
}
// Créer un apprenant
$learner = $client->createLearner(new LearnerInput(
'Dupont',
'Marie',
'[email protected]'
));
echo $learner->uuid;
bash
composer
bash
cp examples/config.php.dist examples/config.php
# Éditer examples/config.php et renseigner l'URL et la clé API
bash
php examples/ping.php
php examples/person/get_collection.php
php examples/society/create.php
# etc.
bash
# Les deux images en une commande
docker compose build
# Une image spécifique
# PHP 7.4
docker compose build php
# PHP 8.5
docker compose build php85
bash
# Lancer les tests de mutation (4 threads)
composer infection
# Avec un seuil MSI minimal (ex : 80 %)
vendor/bin/infection --threads=4 --min-msi=80 --min-covered-msi=80
# Cibler un seul fichier source
vendor/bin/infection --threads=4 --filter=src/Service/Learner/Learner.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.