PHPackages                             olessavluk/yii2-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. olessavluk/yii2-settings

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

olessavluk/yii2-settings
========================

Simple yii2 component for persistent settings storage

165PHP

Since Oct 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/olessavluk/yii2-settings)[ Packagist](https://packagist.org/packages/olessavluk/yii2-settings)[ RSS](/packages/olessavluk-yii2-settings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Settings Component
==================

[](#settings-component)

Simple yii2 component for persistent settings storage

Installation:
-------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

`php composer.phar require olessavluk/yii2-settings "*@dev"`

or add

`"olessavluk/yii2-settings": "*@dev"`

to your `composer.json` file.

Usage
-----

[](#usage)

Add migration to create table for settings:

```
class m150929_124601_settings extends olessavluk\settings\m150929_122401_settings
{
}
```

Add the following code in your application configuration:

```
'components' => [
  ...
  /**
   * required for advanced application template,
   * to share cache between frontend and backend
   */
  'frontCache' => [
     'class' => 'yii\caching\FileCache',
     'cachePath' => '@frontend/runtime/cache',
  ],
  'settings' => [
      'class' => '\olessavluk\settings\SettingsComponent',
      'cacheName' => 'frontCache',
      'defaults' => [ //optional default settings
          'app' => [
              'siteName' => 'MyApp',
              'adminEmail' => 'admin@exapmle.com',
              'fromEmail' => 'no-reply@example.com',
          ],
      ],
  ],
  ...
]
```

Now you can use this component:

```
Yii->$app->settings->get('app', 'siteName');
Yii->$app->settings->delete('app', 'siteName');
Yii->$app->settings->set('app', 'siteName', 'NewSiteName');
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/06162549259182d57ac2a025d265c188ee8acbaeb7d7b82a03dcf1f947c845e8?d=identicon)[olessavluk](/maintainers/olessavluk)

---

Top Contributors

[![olessavluk](https://avatars.githubusercontent.com/u/1577804?v=4)](https://github.com/olessavluk "olessavluk (2 commits)")

### Embed Badge

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

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

###  Alternatives

[yurunsoft/swoole-co-pool

26388.0k1](/packages/yurunsoft-swoole-co-pool)[barrelstrength/sprout-fields

International, Craft-friendly field types.

1176.5k](/packages/barrelstrength-sprout-fields)

PHPackages © 2026

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