opensoft / epl
此库是 EPL2 编程语言的 PHP 封装。目前不支持 EPL2 的所有命令。
1.0.2
2016-02-08 14:28 UTC
Requires
- php: >=5.3.3
This package is not auto-updated.
Last update: 2024-09-14 13:30:52 UTC
README
此库是 EPL2 编程语言的 PHP 封装。目前不支持 EPL2 的所有命令。
使用方法
<?php use Epl\CommandComposite; use Epl\CommandHelper; $composite = new Composite(); $commandHelper = new CommandHelper($composite); //Draw new line $commandHelper->lineDrawBlack(50, 200, 400, 20); //Draw other line $commandHelper->lineDrawBlack(200, 50, 20, 400); //Print 1 label $commandHelper->print(1); //Get EPL string $eplString = $commandHelper->toEplString();
为了实现必要的命令以实现 Epl\CommandInterface。
为了方便使用 EPL 命令,存在一个 CommandHelper。它隐藏了 EPL 命令的实现。但你可以直接方式实例化命令。
<?php use Epl\Command\PrintCommand; use Epl\Command\CommandComposite; $commandComposite = new CommandComposite(); $printCommand = new PrintCommand(1); $commandComposite->addCommand($printCommand); $eplString = $commandComposite->toEplString();
安装
php composer.phar require opensoft/epl
Symfony 2 项目上的安装
如果你使用 deps 文件,添加[epl] git=http://github.com/opensoft/epl.git
或者如果你想克隆仓库
git clone git://github.com/opensoft/epl.git vendor/epl
将命名空间添加到你的自动加载器
$loader->registerNamespaces(array( ............ 'Epl' => DIR.'/../vendor/epl/src', ........... ));