定制 jwread/lib-allure 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jwread/lib-allure

Composer 安装命令:

composer require jwread/lib-allure

包简介

A set of utilities, helpers and shims. It aims to be pretty modular and lightweight. API Docs are here; http://jamesread.github.io/libAllure/

README 文档

README

A set of utilities, helpers and shims. It aims to be pretty modular and lightweight.

packagist.org Package for compose | API Documentation

Maturity Badge Release Pipeline PHP Compatibility

Compatibility

Latest PHP 8.0 PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
libAllure 8.5.x 8.5.0
libAllure 8.4.x 8.4.0
libAllure 8.3.x 8.3.0
libAllure 8.2.x 8.2.2
libAllure 8.1.x 8.1.30
libAllure 8.0.x 8.0.4
Unsupported and untested versions
Approximate PHP support
libAllure 2.x Approximately PHP 7.3
libAllure 1.x Approximately PHP 5.5

Versions 1.x and 2.x are deprecated and not supported. Compatibility testing covers 8.x only.

Run the full matrix locally with make compat (requires Docker for PHP versions other than your host). The matrix is defined in compat/matrix.json and runs on every push and pull request via .github/workflows/compat.yml.

You can add libAllure to your project quickly, if you're using composer.

composer require jwread/lib-allure

Then to use it, like in test.php;

<?php

require_once 'vendor/autoload.php';

use \libAllure\Database;
use \libAllure\ErrorHandler;
use \libAllure\Form;

// etc

?>

Adding with a standard PHP include

Copy the contents of /src/main/php/ to somewhere on your include path, like /usr/share/php/ on most Linux distributions. So that you have /usr/share/php/libAllure/ErrorHander.php, /usr/share/php/libAllure/Database.php, etc.

API Examples & Quick Reference

Full API Documentation: http://jamesread.github.io/libAllure/

Database

Wrapper around PDO.

use \libAllure\Database;

$database = new Database('mysql:dbname=testdb;host=127.0.0.1', 'username', 'password');

$sql = 'SELECT p.id, p.title FROM products p';
$results = $database->prepare($sql)->execute();

var_dump($results->fetchAll());

ErrorHandler

Custom error handler that complains at the slightest thing, makes debugging nice and easy.

use \libAllure\ErrorHandler;

$handler = new ErrorHandler();
$handler->beGreedy();

throw new Exception('This is a test');

Form

Custom form handling code.

use \libAllure\ElementInput;
use \libAllure\Template;

$tpl = new Template('myTemplates'); // requires form.tpl and formElements.tpl in your templates folder

class MyForm extends \libAllure\Form {
	public function __construct() {
		$this->addElement(new ElementInput('forename', 'Forename', 'My Default Name');
		$this->addDefaultButtons():
	}

	public function process() {
		// do something
	}
}

$f = new MyForm();

if ($f->validate()) {
	$f->process();
}

$tpl->displayForm($f);

Template

Just a nice wrapper around Smarty2/3, that adds in a few compatibility functions to easily switch between the versions.

use \libAllure\Template;

$tpl = new Template('myTemplates');
$tpl->display('myTemplate.tpl');

jwread/lib-allure 适用场景与选型建议

jwread/lib-allure 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.12k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 10 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 jwread/lib-allure 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jwread/lib-allure 我们能提供哪些服务?
定制开发 / 二次开发

基于 jwread/lib-allure 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 23
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2015-10-30