PHPackages                             sujayjaju/php-active-record - 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. [Database &amp; ORM](/categories/database)
4. /
5. sujayjaju/php-active-record

ActiveLibrary[Database &amp; ORM](/categories/database)

sujayjaju/php-active-record
===========================

Stand Alone Active Record Library. CodeIgniter's ActiveRecord and Database Library from 3.0RC2, without the rest of CodeIgniter

61.8k5PHP

Since May 29Pushed 7y ago2 watchersCompare

[ Source](https://github.com/sujayjaju/php-active-record)[ Packagist](https://packagist.org/packages/sujayjaju/php-active-record)[ RSS](/packages/sujayjaju-php-active-record/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Standalone Active Record
========================

[](#standalone-active-record)

Based on the [CodeIgnitor](https://github.com/bcit-ci/CodeIgniter) database implementation This takes the ActiveRecord and Database Library from 3.0 and makes it work without the rest of CodeIgniter.

Setup
-----

[](#setup)

composer.phar require sujayjaju/php-active-record

Usage
-----

[](#usage)

```
// Include
use ActiveRecord\ActiveDatabase;

...

// Create Database configs
$db_config = array(
    'hostname' => "localhost",
    'username' => "username",
    'password' => "password",
    'database' => "database_name",
    'dbdriver' => "mysql",
    'pconnect' => FALSE,
    'db_debug' => TRUE
);

// Add Config and give it a name
ActiveDatabase::addConfig("read", $db_config);

//Use the named connection
$query = ActiveDatabase::get("read")->get('table_name')
$row = $query->result_array();
print_r($row);
```

Documentation
-------------

[](#documentation)

For more on how to use active records: Refer CodeIgnitor's reference documentation at:

[Database Reference](http://www.codeigniter.com/userguide3/database/index.html)

```
$this->db
```

gets replaced by

```
ActiveDatabase::get("db_reference_name")
```

Contributions
-------------

[](#contributions)

Thanks to the base setup by Documentopia.com

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 52.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/787c5fc34c761c747c822906bfd2b17d076dc6b787d8109c4e9e8d689f6940c5?d=identicon)[sujayjaju](/maintainers/sujayjaju)

---

Top Contributors

[![sujayjaju](https://avatars.githubusercontent.com/u/1681240?v=4)](https://github.com/sujayjaju "sujayjaju (11 commits)")[![DevelopmentVSDevs](https://avatars.githubusercontent.com/u/842915?v=4)](https://github.com/DevelopmentVSDevs "DevelopmentVSDevs (9 commits)")[![bloo16](https://avatars.githubusercontent.com/u/18347853?v=4)](https://github.com/bloo16 "bloo16 (1 commits)")

### Embed Badge

![Health badge](/badges/sujayjaju-php-active-record/health.svg)

```
[![Health](https://phpackages.com/badges/sujayjaju-php-active-record/health.svg)](https://phpackages.com/packages/sujayjaju-php-active-record)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)

PHPackages © 2026

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