trax / sync
此包已被弃用且不再维护。未建议替代包。
TRAX LRS 同步功能
1.0.0-rc.4
2019-12-10 15:48 UTC
Requires
- elasticsearch/elasticsearch: ^7.3
- guzzlehttp/guzzle: ^6.3
- trax/framework: ^1.0@RC
- trax/xapi: ^1.0@RC
This package is auto-updated.
Last update: 2021-12-10 20:26:25 UTC
README
安装
composer require trax/sync
php artisan vendor:publish --tag=trax-sync-config
php artisan migrate
配置
您可以在 config/trax-sync.php 文件中配置一个或多个连接。
LRS 示例
'trax' => [
'id' => 0, // Define it, and don't change it. It is used in DB.
'type' => 'lrs', // elastic or lrs
'endpoint' => 'http://trax.test/trax/ws/xapi', // LRS endpoint
'username' => '', // LRS Basic HTTP username
'password' => '', // LRS Basic HTTP password
'batch_size' => 100, // Number of statements per POST request
'max_batches' => 10, // Number of requests per command (or CRON task)
'max_attempts' => 3, // Number of tries when an error occurs
],
ElasticSearch 示例
'elastic' => [
'id' => 1, // Define it, and don't change it. It is used in DB.
'type' => 'elastic', // elastic or lrs
'hosts' => [ // ElasticSearch hosts
'localhost:9200'
],
'username' => '', // ElasticSearch Basic HTTP username
'password' => '', // ElasticSearch Basic HTTP password
'batch_size' => 100, // Number of statements per POST request
'max_batches' => 10, // Number of requests per command (or CRON task)
'max_attempts' => 3, // Number of tries when an error occurs
],
命令
在 config/trax-sync.php
中配置您的连接,然后
php artisan trax:push <connection>
以启动或继续同步php artisan trax:push <connection> --all
以重新启动同步
许可和版权
根据 EUPL 1.2 许可 进行分发。
版权所有 2019 Sébastien Fraysse, http://fraysse.eu, sebastien@fraysse.eu.