lbigroupp/dpegenerator

此软件包用于生成法国DPEG图片。这种新的DPEG是2021年7月1日ELAN法规的演变。


README

DPE Generator 是一个库,允许您快速生成新的 DPE 和 GES 图片。如果您为瓜德罗普(GP)生成 DPEG 图片,必须在构建中添加 GP 值。

可在 https://packagist.org.cn/packages/lbigroupp/dpegenerator 上找到

可用函数列表(及其类型)

(boolean) setGenerateImage 
(string) setPathToWriteImage 
(string) setNameOfPicture 
(string) setPictureType 
(int) setDpeVal 
(int) setGesVal 
(int) setSuperficie 

可用常量列表

这些常量允许您定义想要生成的图片类型,是 DPE 还是 GES。

const DPE_TYPE;
const GES_TYPE;

在您的个人文件夹中生成图片的示例

$type = \LBIGroupDpeGenerator\DpeGenerator::DPE_TYPE; 
// OR $type = \LBIGroupDpeGenerator\DpeGenerator::GES_TYPE
$dpeVal = 29;
$gesVal = 2;
$superficie = 35;
$imgTarget = "YOUR_TARGET";
$pictureName = "YOUR_PICTURE_NAME";

if (file_exists($imgTarget . $pictureName . '.png')) {
    return $imgTarget . $pictureName . '.png';
}

$dpe = new \LBIGroupDpeGenerator\DpeGenerator();
$dpe->setDpeVal($dpeVal);
$dpe->setGesVal($gesVal);
$dpe->setSuperficie($superficie);
$dpe->setPictureType($type);
$dpe->setPathToWriteImage($imgTarget);
$dpe->setNameOfPicture($pictureName);
$dpe->setGenerateImage(true);

// return file location
echo $dpe->generatePicture();

在您的网站上直接查看图片的示例

$type = \LBIGroupDpeGenerator\DpeGenerator::DPE_TYPE; 
// OR $type = \LBIGroupDpeGenerator\DpeGenerator::GES_TYPE
$dpeVal = 29;
$gesVal = 2;
$superficie = 35;

$dpe = new \LBIGroupDpeGenerator\DpeGenerator();
$dpe->setDpeVal($dpeVal);
$dpe->setGesVal($gesVal);
$dpe->setSuoerficie($superficie);
$dpe->setPictureType($type);

// return file location
echo $dpe->generatePicture();

发行说明

v1.0 / v1.1 / v1.1 : 不是稳定版本;

1.2.1 : 所有 PHP 版本(5、7 和 8)的稳定版本;

2.0.1 : 仅适用于 PHP >= 7.1 的稳定版本;

2.1 : 通过 ISO 码 GP 添加瓜德罗普的 DPEG;

2.3 : 添加最终消费和 PHP =>7.4;