ocolin/bx-auth
Composer 安装命令:
composer require ocolin/bx-auth
包简介
Tool for authenticating using Billmax Auth database
README 文档
README
Database Authentication for Billmax
This package is not written with any public use in mind. It's an experiment for allowing external apps to login using the authentication in the Billmax billing software.
Instantiation
To connect to the database to verify authentication we need 4 pieces of information:
- host - Name/IP of billmax server. Defaults to localhost.
- name - Name of the database table. Defaults to billmax.
- user - Username of database user.
- pass - Password of database user.
Environment variables
The constructor arguments can be provided directly, or environment variables can be used instead:
- BILLMAX_DB_HOST
- BILLMAX_DB_NAME
- BILLMAX_DB_USER
- BILLMAX_DB_PASS
See ,env.example file.
Example - Constructor arguments
$auth = new \Ocolin\BxAuth\BxAuth( host: 'localhost', name: 'billmax', user: 'myusername', pass: 'mypassword' );
Example - Environment variables
$_ENV['BILLMAX_DB_HOST'] = 'localhost'; $_ENV['BILLMAX_DB_NAME'] = 'billmax'; $_ENV['BILLMAX_DB_USER'] = 'myusername'; $_ENV['BILLMAX_DB_PASS'] = 'mypassword'; $auth = new \Ocolin\BxAuth\BxAuth();
Calls
Login
- user - Username to log in as.
- pass - Password to long in with.
- session - Create a PHP session and add data to it.
$data = $auth->login( user: 'bobsuncle', pass: 'tiddlywinks', session: true ); print_r( $_SESSION ); Array ( [LOGGED_IN] => 1 [AUTH] => Ocolin\BxAuth\AuthData Object ( [id] => 86 [access] => 31 [descr] => Bob Uncle [email] => bob@staff.test.com [user] => bobsuncle [fname] => Bob [lname] => Uncle [password] => $1$UV$hR/8uhVeBpD5Wzb0V7Dyz/ ) )
By default the function returns an object with the user data in it. Setting seesion to true will add that data to $_SESSION['AUTH'].
Logout
This will log the user out, destroy the cookie, and wipe any session variables.
$auth->logout();
Check Login
Check to see if we are currently logged in. Return true or false.
$loggedin = $auth->check_Login(); var_dump( $loggedin ); bool(true)
ocolin/bx-auth 适用场景与选型建议
ocolin/bx-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ocolin/bx-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ocolin/bx-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-13