# jpfuentes2/php-activerecord

ActiveRecord implementation for PHP

Repository: https://github.com/jpfuentes2/php-activerecord
Canonical: https://ross.abutalabs.com/products/php-activerecord
Homepage: http://www.phpactiverecord.org/
Language: PHP
License: NOASSERTION
License Family: other
Last push: 2024-06-12T23:38:57+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 6312, "days_push": 812, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1305, forks 431 (observed 2026-08-28T04:04:18.639450+00:00)

## What it is
PHP ActiveRecord is an open-source ORM library for PHP implementing the ActiveRecord pattern, inspired by Ruby on Rails' ActiveRecord. It maps database tables to PHP classes and eliminates hand-written SQL for common CRUD operations, with support for MySQL, SQLite, PostgreSQL, and Oracle via PDO.

## Use cases
- map database tables to PHP model classes without writing SQL
- perform CRUD operations on MySQL or PostgreSQL from PHP
- define model relationships and associations like has_many and belongs_to
- validate model attributes before saving to the database
- run database transactions in a PHP application
- serialize models to JSON or XML
- avoid N+1 queries with eager loading of associations

## When to choose
- you want a Rails-style ActiveRecord ORM in a PHP 5.3+ project
- you prefer convention over configuration with no code generators or mapping files
- you need a lightweight ORM supporting multiple database adapters via PDO

## When to avoid
- you need an actively developed ORM with modern PHP 8+ features
- you require advanced features like migrations, query builders, or complex joins
- you are starting a new project where Doctrine or Eloquent would be better supported

## Facets
- artifact type: library
- maturity: maintenance
- function: orm, database, serialization
- domain: databases, web-development, backend, developer-tools
- platform: php, windows, cross-platform
- tags: active-record-pattern, pdo, mysql, sqlite, postgresql, oracle, rails-inspired, crud, validations, callbacks, eager-loading, linux, macos

## Member repositories
- jpfuentes2/php-activerecord (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:18.639450+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:51:02.711741+00:00, confidence not recorded.
  - readme: https://github.com/jpfuentes2/php-activerecord (fetched 2026-08-28T04:04:18.639450+00:00, sha eed544256ae3)
  - homepage: http://www.phpactiverecord.org/ (fetched 2026-08-29T12:08:56.614493+00:00, sha 53427e8a1a5e)
  - site_page: https://www.phpactiverecord.org/docs (fetched 2026-08-29T12:08:56.626136+00:00, sha 38f0cb981f3f)
  - site_page: https://www.phpactiverecord.org/welcome/about (fetched 2026-08-29T12:08:56.632137+00:00, sha ec73463230c7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
