PHPackages                             softwarepunt/php-activerecord - 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. softwarepunt/php-activerecord

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

softwarepunt/php-activerecord
=============================

php-activerecord is an open source ORM library based on the ActiveRecord pattern.

v1.3(2y ago)02.9k3MITPHPPHP &gt;=7.2.0

Since Jul 1Pushed 1y ago2 watchersCompare

[ Source](https://github.com/SoftwarePunt/php-activerecord)[ Packagist](https://packagist.org/packages/softwarepunt/php-activerecord)[ Docs](http://www.phpactiverecord.org/)[ RSS](/packages/softwarepunt-php-activerecord/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (8)Used By (0)

softwarepunt/php-activerecord
=============================

[](#softwarepuntphp-activerecord)

**This is a fork of php-activerecord, originally authored by [@kla](https://github.com/kla), [@jpfuentes2](https://github.com/jpfuentes2) and its [contributors](https://github.com/kla/php-activerecord/contributors).**

Important
---------

[](#important)

**⚠ `php-activerecord` is no longer actively being maintained, the original site is dead, and the project is mostly abandoned.**

I would ***not*** recommend this ORM for any new projects or developments.

This fork contains some quality-of-life enhancements, support for the latest PHP version, and fixes, which are relevant to us and some of our older projects that we maintain.

Installation
------------

[](#installation)

We recommend using composer:

```
composer require softwarepunt/php-activerecord:dev-master

```

Because we do not actively maintain tags or versions for this project, you should refer to `dev-master`.

Documentation &amp; usage
-------------------------

[](#documentation--usage)

- 👨‍💻 *The original project:*
- 📕 *Mirror of the old docs site:*

(⚠ phpactiverecord.org is dead and being squatted by someone, best to ignore it.)

Fork changes
------------

[](#fork-changes)

**This fork is currently only compatible with PHP 8.1!**

### Fixes

[](#fixes)

- Compatibility fixes over time for PHP 7.2, 8.0, 8.1
- `activerecord_autoload` no longer causes conflicts when the library is loaded more than once.
- Fix `count(): Parameter must be an array or an object that implements Countable` error in `find_by_pk()`.
- Fix `castIntegerSafely()` throwing an error if the input is empty (e.g. empty string), now just returns zero.

### Enhancements

[](#enhancements)

- DateTime: Implement \\JsonSerializable, format in "c" mode.
- Added `set_is_new_record(bool)` to `Model` to help modifying internal state.
- Added experimental `reconnect()` function to `Connection`.
- Added `stupidfastquery($options)`: this converts options to a query and returns the raw PDO result set without any activerecord magic.
- Added `stupidfastqueryValues($options, $colIndex = 0)`: runs a `stupidfastquery` and returns an array of column values.
- Added `stupidfastcount($options)`: run query, only return row count.
- Added `find_all_with_wrapped_sort($options)`: this wraps the results in a separate SELECT for faster sorting on JOIN heavy queries.
- Pass `query_info` to `find($options)` options to get generated query data as result (used internally by `stupidfastcount` &amp; co) - can be used if you want to convert `$options` to an actual statement:

    ```
    [
      'query' => $sql->to_s(),
      'values' => $sql->get_where_values(),
      'readonly' => $readonly,
      'eager_load' => $eager_load
    ];
    ```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~1067 days

Total

4

Last Release

773d ago

PHP version history (2 changes)v1.0PHP &gt;=5.3.0

v1.3PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a6873ef39d8543fca22ac4bbc6ceded1454067f2d82d2b51cdd2642d7f14bed?d=identicon)[roydejong](/maintainers/roydejong)

---

Top Contributors

[![kla](https://avatars.githubusercontent.com/u/27941?v=4)](https://github.com/kla "kla (233 commits)")[![jpfuentes2](https://avatars.githubusercontent.com/u/87429?v=4)](https://github.com/jpfuentes2 "jpfuentes2 (117 commits)")[![roydejong](https://avatars.githubusercontent.com/u/6772638?v=4)](https://github.com/roydejong "roydejong (41 commits)")[![greut](https://avatars.githubusercontent.com/u/1388?v=4)](https://github.com/greut "greut (37 commits)")[![Rican7](https://avatars.githubusercontent.com/u/742384?v=4)](https://github.com/Rican7 "Rican7 (33 commits)")[![koenpunt](https://avatars.githubusercontent.com/u/351038?v=4)](https://github.com/koenpunt "koenpunt (30 commits)")[![al-the-x](https://avatars.githubusercontent.com/u/96015?v=4)](https://github.com/al-the-x "al-the-x (15 commits)")[![cvanschalkwijk](https://avatars.githubusercontent.com/u/42311?v=4)](https://github.com/cvanschalkwijk "cvanschalkwijk (7 commits)")[![faulkner](https://avatars.githubusercontent.com/u/22268?v=4)](https://github.com/faulkner "faulkner (7 commits)")[![lfglopes](https://avatars.githubusercontent.com/u/1245319?v=4)](https://github.com/lfglopes "lfglopes (6 commits)")[![anther](https://avatars.githubusercontent.com/u/1376446?v=4)](https://github.com/anther "anther (5 commits)")[![brianmuse](https://avatars.githubusercontent.com/u/548885?v=4)](https://github.com/brianmuse "brianmuse (5 commits)")[![teague2](https://avatars.githubusercontent.com/u/206609?v=4)](https://github.com/teague2 "teague2 (5 commits)")[![jcs](https://avatars.githubusercontent.com/u/9888?v=4)](https://github.com/jcs "jcs (4 commits)")[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (3 commits)")[![NanneHuiges](https://avatars.githubusercontent.com/u/1526794?v=4)](https://github.com/NanneHuiges "NanneHuiges (3 commits)")[![shmax](https://avatars.githubusercontent.com/u/773172?v=4)](https://github.com/shmax "shmax (2 commits)")[![suxxes](https://avatars.githubusercontent.com/u/141334?v=4)](https://github.com/suxxes "suxxes (2 commits)")[![tuupola](https://avatars.githubusercontent.com/u/21913?v=4)](https://github.com/tuupola "tuupola (2 commits)")[![igorsantos07](https://avatars.githubusercontent.com/u/532299?v=4)](https://github.com/igorsantos07 "igorsantos07 (2 commits)")

---

Tags

ormactiverecord

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/softwarepunt-php-activerecord/health.svg)

```
[![Health](https://phpackages.com/badges/softwarepunt-php-activerecord/health.svg)](https://phpackages.com/packages/softwarepunt-php-activerecord)
```

###  Alternatives

[php-activerecord/php-activerecord

php-activerecord is an open source ORM library based on the ActiveRecord pattern.

1.3k397.8k21](/packages/php-activerecord-php-activerecord)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[bephp/activerecord

micro activerecord library in PHP(only 400 lines with comments), support chain calls and relations(HAS\_ONE, HAS\_MANY, BELONGS\_TO).

1202.1k2](/packages/bephp-activerecord)[spinitron/yii2-dynamic-ar

Extends Yii ActiveRecord for Maria Dynamic Columns

576.8k](/packages/spinitron-yii2-dynamic-ar)[php-patterns/activerecord

php-activerecord is an open source ORM library based on the ActiveRecord pattern.

449.2k](/packages/php-patterns-activerecord)[cycle/active-record

Provides a simple way to work with your database using Active Record pattern and Cycle ORM

671.3k3](/packages/cycle-active-record)

PHPackages © 2026

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