PHPackages                             spwashi/smphp - 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. spwashi/smphp

ActiveLibrary

spwashi/smphp
=============

PHP Framework for when you (I) have a fear of commitment

v0.8.4(8y ago)180proprietaryPHP

Since Sep 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/spwashi/SmPHP)[ Packagist](https://packagist.org/packages/spwashi/smphp)[ RSS](/packages/spwashi-smphp/feed)WikiDiscussions master Synced 3d ago

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

SmPHP
=====

[](#smphp)

Apologies there isn't a more helpful description of this Framework yet! That is a work-in-progress as well as this framework.

Configuring the ORM
===================

[](#configuring-the-orm)

Input
-----

[](#input)

This is an example of a JavaScript file that might be used to export the entities the SmJS framework would convert to JSON and save in a file, which this PHP framework would read and configure the Object Relational Mapper with.

```
const DATETIME_ = 'datetime';
const STRING_   = 'string';
const INTEGER_  = 'int';
const NULL_     = 'null';

export const models = {
    _:       {
        properties: {
            id:             {
                primary:     !0,
                isGenerated: true,
                datatypes:   INTEGER_,
                length:      11,
            },
            delete_dt:      {
                datatypes: [DATETIME_, NULL_],
            },
            creation_dt:    {
                datatypes:    [DATETIME_],
                defaultValue: 'now'
            },
            last_update_dt: {
                datatypes:   [DATETIME_, NULL_],
                updateValue: 'now'
            },
        }
    },
    users:   {
        inherits: '_',

        properties: {
            email:      {length: 255, datatypes: [STRING_], unique: true},
            first_name: {length: 50, datatypes: [STRING_, NULL_]},
            last_name:  {length: 50, datatypes: [STRING_, NULL_]}
        }
    },
    clients: {
        inherits:   '_',
        properties: {
            note:       {datatypes: [STRING_, NULL_], length: 3000,},
            user_id:    {datatypes: INTEGER_, length: 11,},
            clients_id: {datatypes: INTEGER_, length: 11,},
        }
    }
};

export default models;
```

\##Output

```
{
   "_": {
      "smID": "[Model]_",
      "propertyMeta": {
         "primary": [
            "[Property]{[Model]_} id"
         ],
         "unique": {}
      },
      "properties": {
         "id": {
            "datatypes": [
               "int"
            ],
            "smID": "[Property]{[Model]_} id",
            "length": 11,
            "primary": true,
            "isGenerated": true
         },
         "delete_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]_} delete_dt"
         },
         "creation_dt": {
            "datatypes": [
               "datetime"
            ],
            "smID": "[Property]{[Model]_} creation_dt",
            "defaultValue": "now"
         },
         "last_update_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]_} last_update_dt",
            "updateValue": "now"
         }
      }
   },
   "users": {
      "smID": "[Model]users",
      "propertyMeta": {
         "primary": [
            "[Property]{[Model]users} id"
         ],
         "unique": {
            "unique_key": [
               "[Property]{[Model]users} email"
            ]
         }
      },
      "properties": {
         "id": {
            "datatypes": [
               "int"
            ],
            "smID": "[Property]{[Model]users} id",
            "length": 11,
            "primary": true,
            "isGenerated": true
         },
         "delete_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]users} delete_dt"
         },
         "creation_dt": {
            "datatypes": [
               "datetime"
            ],
            "smID": "[Property]{[Model]users} creation_dt",
            "defaultValue": "now"
         },
         "last_update_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]users} last_update_dt",
            "updateValue": "now"
         },
         "email": {
            "datatypes": [
               "string"
            ],
            "smID": "[Property]{[Model]users} email",
            "length": 255,
            "unique": true
         },
         "first_name": {
            "datatypes": [
               "string",
               "null"
            ],
            "smID": "[Property]{[Model]users} first_name",
            "length": 50
         },
         "last_name": {
            "datatypes": [
               "string",
               "null"
            ],
            "smID": "[Property]{[Model]users} last_name",
            "length": 50
         }
      }
   },
   "clients": {
      "smID": "[Model]clients",
      "propertyMeta": {
         "primary": [
            "[Property]{[Model]clients} id"
         ],
         "unique": {}
      },
      "properties": {
         "id": {
            "datatypes": [
               "int"
            ],
            "smID": "[Property]{[Model]clients} id",
            "length": 11,
            "primary": true,
            "isGenerated": true
         },
         "delete_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]clients} delete_dt"
         },
         "creation_dt": {
            "datatypes": [
               "datetime"
            ],
            "smID": "[Property]{[Model]clients} creation_dt",
            "defaultValue": "now"
         },
         "last_update_dt": {
            "datatypes": [
               "datetime",
               "null"
            ],
            "smID": "[Property]{[Model]clients} last_update_dt",
            "updateValue": "now"
         },
         "note": {
            "datatypes": [
               "string",
               "null"
            ],
            "smID": "[Property]{[Model]clients} note",
            "length": 3000
         },
         "user_id": {
            "datatypes": [
               "int"
            ],
            "smID": "[Property]{[Model]clients} user_id",
            "length": 11
         },
         "clients_id": {
            "datatypes": [
               "int"
            ],
            "smID": "[Property]{[Model]clients} clients_id",
            "length": 11
         }
      }
   }
}
```

Used in PHP like
================

[](#used-in-php-like)

```
$application = $this->app;
        $dataLayer   = $application->data;

        # Instantiate a Model that we'll use to find a matching object (or throw an error if it doesn't exist)
        $_sam_model                 = $dataLayer->models->instantiate('users');
        $_sam_model->properties->id = 1;

        # The Model PersistenceManager is an object that gives us access to standard ORM methods
        ##  find, save, create, mark_delete (haven't implemented DELETE statements yet)
        $modelPersistenceManager = $dataLayer->models->persistenceManager;

        /** @var Model $sam */
        # This would throw an error if the Model could not be found
        $sam                     = $modelPersistenceManager->find($_sam_model);

        if($sam->properties->first_name->value !== 'Samuel'){
            $modelPersistenceManager->mark_delete($sam);
        }else{
            $sam->properties->first_name = 'Mr. Samuel';
            $modelPersistenceManager->save($sam);
        }
    ```
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

3032d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/571bccd240bb47075bac5e73fdd19560955c1adebce024598928b0f8b36366a3?d=identicon)[spwashi](/maintainers/spwashi)

---

Top Contributors

[![spwashi](https://avatars.githubusercontent.com/u/12436227?v=4)](https://github.com/spwashi "spwashi (61 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/spwashi-smphp/health.svg)

```
[![Health](https://phpackages.com/badges/spwashi-smphp/health.svg)](https://phpackages.com/packages/spwashi-smphp)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.4k37.3k](/packages/matomo-matomo)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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