PHPackages                             battis/appmetadata - 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. battis/appmetadata

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

battis/appmetadata
==================

An object to store app metadata backed by a MySQL table

v1.2.2(9y ago)0317[2 issues](https://github.com/battis/appmetadata/issues)4LGPL-3.0PHP

Since Jun 23Pushed 4y ago2 watchersCompare

[ Source](https://github.com/battis/appmetadata)[ Packagist](https://packagist.org/packages/battis/appmetadata)[ RSS](/packages/battis-appmetadata/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)DependenciesVersions (9)Used By (4)

AppMetadata
===========

[](#appmetadata)

[![Latest Version](https://camo.githubusercontent.com/470aa4d89fc8597301487d7983ecd0b825fe1bb3db756fb1865c64bc52e4790b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261747469732f6170706d657461646174612e737667)](https://packagist.org/packages/battis/appmetadata)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c8c6d95455616dd4f6eced33de7248de8a6fcc89401af74cc61e6242393738c1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6261747469732f6170706d657461646174612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/battis/appmetadata/?branch=master)

This is one of those things that feels like it should already exist, but my cursory search of the interwebs failed to turn it up: an associative array akin to `$_GLOBALS` that is backed by a persistent datastore (MySQL in this case, because it's the only thing I ever use, because… lazy, I guess).

### Usage

[](#usage)

Update your [`composer.json`](https://getcomposer.org) file to include the following.

```
{
  "requires": {
    "battis/appmetadata": "~1.0"
  }
}
```

*Handy hint:* It always annoys me to have the overhead of documentation, unit tests, etc. for other projects included in mine. Per [this answer on Stack Overflow](http://stackoverflow.com/a/17069547), you can actually buy some small improvement by adding the `--prefer-dist` flag to `composer install` and `composer update`, as in:

```
composer install --prefer-dist
```

Create an `AppMetadata` object and treat it as you would any other associative array.

```
// instantiate a new mysqli database connection
$sql = new mysqli('localhost', 'root', 's00pers3kr3t', 'demo-db');

// first use (create database tables -- only needs to happen once!)
Battis\AppMetadata::prepareDatabase($sql);

// instantiate our metadata array
$metadata = new Battis\AppMetadata($sql, 'my-unique-app-key');

// store something into the database
$metadata['X'] = 'foobar';

// read something out of the database
echo $metadata['X']; // 'foobar'

// use one metadata value to derive another
$metadata['Y'] = '@X again'
echo $metadata['Y']; // 'foobar again';

// derived values update automagically
$metadata['X'] = 'xoxo';
echo $metadata['Y']; // 'xoxo again';

// remove something from the database
unset($metadata['X']);
echo $metadata['Y']; // '@X again', since no value X to derive from
```

Complete documentation is available [within the package](http://htmlpreview.github.io/?https://github.com/battis/appmetadata/blob/master/doc/index.html).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~85 days

Total

7

Last Release

3588d ago

### Community

Maintainers

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

---

Top Contributors

[![battis](https://avatars.githubusercontent.com/u/419619?v=4)](https://github.com/battis "battis (21 commits)")

### Embed Badge

![Health badge](/badges/battis-appmetadata/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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