kalider/php-seb-generator

用于生成 SEB (Safe Exam Browser) 配置的 PHP 库

1.0.0 2024-01-31 03:08 UTC

This package is auto-updated.

Last update: 2024-09-30 02:18:15 UTC


README

本库提供生成SEB (Safe Exam Browser) 配置的功能。

灵感来源于 ndum/laravel-seb

要求

  • php7.4 或更高版本。
  • ext-openssl
  • ext-zlib

安装

通过 composer 安装

composer require kalider/php-seb-generator

示例

生成字符串

use Kalider\PhpSebGenerator\SebConfigGenerator;

$config = file_get_contents('examples/example-seb-config.json');
$startPassword = 'test';
$quitPassword = 'test';
$adminPassword = 'test';

$sebConfig = json_decode($config, true);

$encryptedSebConfig = SebConfigGenerator::generate($sebConfig, $startPassword, $quitPassword, $adminPassword);

生成文件

use Kalider\PhpSebGenerator\SebConfigGenerator;

$config = file_get_contents('examples/example-seb-config.json');
$startPassword = 'test';
$quitPassword = 'test';
$adminPassword = 'test';

$sebConfig = json_decode($config, true);
$path = 'output/test.seb';
$created = SebConfigGenerator::generateToFile($sebConfig, $path, $startPassword, $quitPassword, $adminPassword);

问题/贡献

直接通过 GitHub

许可证

MIT 许可证 - 详情