ltb-project/ltb-common 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ltb-project/ltb-common

最新稳定版本:v0.6.2

Composer 安装命令:

composer require ltb-project/ltb-common

包简介

PHP framework for LTB project applications

README 文档

README

Latest Stable Version Total Downloads CI Status Composer Status

Presentation

This is a PHP library to share code between LTB applications like Self Service Password, White Pages, Service Desk, ...

Installation

Add the dependency in your composer configuration:

{ "require": { "ltb-project/ltb-common": "v0.2.1" } }

Then update dependencies:

composer update 

Use autoloading in your code to load composer dependencies:

require __DIR__ . 'vendor/autoload.php';

Usage

LDAP connection

$ldap_url = "ldap://ldap.example.com"; $ldap_starttls = false; $ldap_binddn = "cn=admin,dc=example,dc=com"; $ldap_bindpw = "secret"; $ldap_network_timeout = 3; $ldap_user_base = "ou=people,dc=example,dc=com"; $ldap_size_limit = -1; $ldap_krb5ccname = null; $ldap_page_size = 1000; $ldapInstance = new \Ltb\Ldap( $ldap_url, $ldap_starttls, $ldap_binddn, $ldap_bindpw, $ldap_network_timeout, $ldap_user_base, $ldap_size_limit, $ldap_krb5ccname, $ldap_page_size ); $ldap_connection = $ldapInstance->connect(); $ldap = $ldap_connection[0]; $result = $ldap_connection[1]; if (!$result) { error_log("Unable to connect to $ldap_url"); exit 1; }

Tests

Unit tests

Get composer dependencies:

composer update 

Run the tests:

vendor/bin/phpunit tests/Ltb 

If you want coverage analysis, make sure to install xdebug PHP extension, and run:

XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --configuration phpunit.xml 

Integration tests

Make sure you have docker or podman installed

Get composer dependencies:

composer update 

Run the tests (requires an internet connection for donwloading the openldap docker image):

./runIntegrationTests.sh 

If you already have an openldap server, you can also adapt the tests in tests/ directory, and run them with:

vendor/bin/phpunit tests/IntegrationTests 

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固