PHPackages                             solophp/settings - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. solophp/settings

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

solophp/settings
================

Managing application settings stored in a database

v2.0.0(9mo ago)046MITPHPPHP &gt;=8.1

Since Oct 18Pushed 9mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Solo Settings
=============

[](#solo-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b10ae29e89690cf67e6d166069fdb951dde2f7f533af4df03567e534fcdaf063/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6c6f7068702f73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/solophp/settings)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/e9d5774d711280032c5415a877190492c7cad11df1751e07a83e6073ecc84794/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f6c6f7068702f73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/solophp/settings)

A simple and efficient PHP settings management package that provides an interface to store and retrieve application settings from a database.

Features
--------

[](#features)

- Easy integration with existing database connections
- Automatic serialization and deserialization of complex data types
- Support for both object-oriented and array-like access to settings
- Efficient caching of settings to minimize database queries

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

[](#installation)

```
composer require solophp/settings
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- PDO extension

### Basic Setup

[](#basic-setup)

First, ensure that you have a table for storing settings. The table should have two columns: `name` (string) and `value` (string).

Example table schema:

```
CREATE TABLE `settings` (
  `name` VARCHAR(255) NOT NULL,
  `value` TEXT NOT NULL,
  PRIMARY KEY (`name`)
);
```

Usage
-----

[](#usage)

First, create an instance of the `Settings` class:

```
use Solo\Settings\Settings;

$pdo = new PDO('mysql:host=localhost;dbname=app', 'user', 'pass');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$settings = new Settings($pdo, 'settings');
```

### Retrieving Settings

[](#retrieving-settings)

You can retrieve settings using either method calls or property access:

```
$value = $settings->get('my_setting');
// or
$value = $settings->my_setting;
```

### Storing Settings

[](#storing-settings)

Similarly, you can store settings using either method calls or property access:

```
$settings->set('my_setting', 'new_value');
// or
$settings->my_setting = 'new_value';
```

### Get all Settings

[](#get-all-settings)

Get all settings as an associative array.:

```
$settings->getAll();
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance57

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

283d ago

Major Versions

v1.3.0 → v2.0.02025-08-08

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f29817cec408d033cd4441c8f760e3ae40248dc0f66856a09080d282aee6959?d=identicon)[Vitaliy Olos](/maintainers/Vitaliy%20Olos)

---

Top Contributors

[![SoloPHP](https://avatars.githubusercontent.com/u/175482616?v=4)](https://github.com/SoloPHP "SoloPHP (6 commits)")

---

Tags

phpSettingsarray

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/solophp-settings/health.svg)

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

###  Alternatives

[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)

PHPackages © 2026

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