PHPackages                             ruckuus/php-activerecord-service-provider - 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. ruckuus/php-activerecord-service-provider

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

ruckuus/php-activerecord-service-provider
=========================================

A PHPActiveRecord Service Provider for Silex

0.0.1(12y ago)73.0k5[1 PRs](https://github.com/ruckuus/ActiveRecordServiceProvider/pulls)MITPHPPHP &gt;=5.3.0

Since Mar 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ruckuus/ActiveRecordServiceProvider)[ Packagist](https://packagist.org/packages/ruckuus/php-activerecord-service-provider)[ Docs](https://github.com/ruckuus/ActiveRecordServiceProvider)[ RSS](/packages/ruckuus-php-activerecord-service-provider/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

ActiveRecordServiceProvider
===========================

[](#activerecordserviceprovider)

A PHP ActiveRecord ServiceProvider for Silex.

History
-------

[](#history)

I was about to use \[Available ActiveRecord Extension\] (), but then I realised that registerNamespace() is deprecated in later version of Silex. This work is experimental, it has a minimum functionality to "work".

Fetch
-----

[](#fetch)

The recommended way to install ActiveRecordServiceProvider is [through composer](http://getcomposer.org).

Just create a composer.json file for your project:

```
{
    "require": {
        "ruckuus/php-activerecord-service-provider": "dev-master",
        "silex/silex": "1.0.*@dev"
    }
}
```

Parameters
----------

[](#parameters)

- *ar.model\_dir* - Path to where model folder is located ( without trailing slash )
- *ar.connections* - Array of connections (`name => connection`). Connections examples:
    - `mysql://username:password@localhost/database_name`
    - `pgsql://username:password@localhost/development`
    - `sqlite://my_database.db`
    - `oci://username:passsword@localhost/xe`
- *ar.default\_connection* - default models connection.

Register
--------

[](#register)

```
use Silex\Application;
use Ruckuus\Silex\ActiveRecordServiceProvider;

$app = new Application();

$app->register(new ActiveRecordServiceProvider(), array(
    'ar.model_dir' => __DIR__ . '/App/Model',
    'ar.connections' =>  array ('development' => 'mysql://root@localhost/database_name'),
    'ar.default_connection' => 'development',
));
```

Usage
-----

[](#usage)

Create your model in `__DIR__ . '/app/Model'`. Eg.

```
namespace App\Model;

class User extends \ActiveRecord\Model {
    static $has_many = array (
        array('problem'),
        array('luck')
    )
}
```

In your application:

```
use App\Model\User;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;

class UserProvider implements UserProviderInterface
{
    public function loadUserByUsername($username)
    {
        $user = User::find_by_username(strtolower($username));

        if ($user->dirty_attributes()) {
            throw new UnsupportedUserException(sprintf('Bad credentials for "%s"'), $username);
        }
    }
}
```

For more informations check the website of [PHP ActiveRecord](http://phpactiverecord.org/). Its [wiki](http://www.phpactiverecord.org/projects/main/wiki).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

4437d ago

### Community

Maintainers

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

---

Top Contributors

[![ruckuus](https://avatars.githubusercontent.com/u/53867?v=4)](https://github.com/ruckuus "ruckuus (6 commits)")[![ScullWM](https://avatars.githubusercontent.com/u/1017746?v=4)](https://github.com/ScullWM "ScullWM (2 commits)")[![srsbiz](https://avatars.githubusercontent.com/u/1525842?v=4)](https://github.com/srsbiz "srsbiz (1 commits)")[![TiGR](https://avatars.githubusercontent.com/u/281226?v=4)](https://github.com/TiGR "TiGR (1 commits)")

---

Tags

databaseormsilexactiverecord

### Embed Badge

![Health badge](/badges/ruckuus-php-activerecord-service-provider/health.svg)

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

###  Alternatives

[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)[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)[kumbia/activerecord

Fast ActiveRecord

261.6k](/packages/kumbia-activerecord)[icanboogie/activerecord

ActiveRecord Object-relational mapping

135.0k3](/packages/icanboogie-activerecord)

PHPackages © 2026

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