* @copyright 2023 smiley
* @license MIT
*/
use chillerlan\Authenticator\{Authenticator, AuthenticatorOptionsTrait};
use chillerlan\Authenticator\Authenticators\AuthenticatorInterface;
use chillerlan\Settings\SettingsContainerAbstract;
use chillerlan\QRCode\{QRCode, QROptionsTrait};
use chillerlan\QRCode\Data\QRMatrix;
require_once __DIR__.'/../vendor/autoload.php';
// create a new options container on the fly that hosts both, authenticator and qrcode
$options = new class extends SettingsContainerAbstract{
use AuthenticatorOptionsTrait, QROptionsTrait;
};
/*
* AuthenticatorOptionsTrait
*
* @see https://github.com/chillerlan/php-authenticator
*/
$options->mode = AuthenticatorInterface::TOTP;
$options->digits = 8;
$options->algorithm = AuthenticatorInterface::ALGO_SHA512;
/*
* QROptionsTrait
*/
$options->version = 7;
$options->addQuietzone = false;
$options->imageBase64 = false;
$options->svgAddXmlHeader = false;
$options->cssClass = 'my-qrcode';
$options->drawLightModules = false;
$options->markupDark = '';
$options->markupLight = '';
$options->drawCircularModules = true;
$options->circleRadius = 0.4;
$options->connectPaths = true;
$options->keepAsSquare = [
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
];
$options->svgDefs = '