PHPackages                             ocolin/bx-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ocolin/bx-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ocolin/bx-auth
==============

Tool for authenticating using Billmax Auth database

1.1(3mo ago)02MITPHPPHP ^8.2

Since Feb 13Pushed 3mo agoCompare

[ Source](https://github.com/ocolin/BxAuth)[ Packagist](https://packagist.org/packages/ocolin/bx-auth)[ RSS](/packages/ocolin-bx-auth/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

BxAuth
======

[](#bxauth)

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
-------------

[](#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

[](#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

[](#example---constructor-arguments)

```
$auth = new \Ocolin\BxAuth\BxAuth(
    host: 'localhost',
    name: 'billmax',
    user: 'myusername',
    pass: 'mypassword'
);
```

### Example - Environment variables

[](#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
-----

[](#calls)

### Login

[](#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

[](#logout)

This will log the user out, destroy the cookie, and wipe any session variables.

```
$auth->logout();
```

### Check Login

[](#check-login)

Check to see if we are currently logged in. Return true or false.

```
$loggedin = $auth->check_Login();

var_dump( $loggedin );

bool(true)
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance78

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

113d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-bx-auth/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-bx-auth/health.svg)](https://phpackages.com/packages/ocolin-bx-auth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
