PHPackages                             mrssoft/yii2-globalstate - 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. mrssoft/yii2-globalstate

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

mrssoft/yii2-globalstate
========================

Save and load global data

34.0k2[1 issues](https://github.com/mrs2000/yii2-globalstate/issues)PHP

Since Dec 11Pushed 3y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-globalstate
================

[](#yii2-globalstate)

Save and load global data

Install
-------

[](#install)

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

Either run

```
php composer.phar require --prefer-dist mrssoft/yii2-globalstate "dev-master"

```

or add

```
"mrssoft/yii2-globalstate": "dev-master"
```

to the require section of your composer.json

Usage
-----

[](#usage)

Add to you config:

```
'components' => [
	'globalstate' => [
		'class' => 'mrssoft\globalstate\GlobalStateFile',
        'path' => '@runtime', // Path for save data (optional)
        'filename' => 'globalstate.bin' //Filename (optional)
	],
]
```

Get value:

```
$value = Yii::$app->globalstate->get('key');

//or

$value = Yii::$app->globalstate->get('key', $default);
```

Set value:

```
Yii::$app->globalstate->set('key', $value);
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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/9e69f6780ee8c8e5b2c10af66e1232ac3925766c6f2f83db1820f2ff9a590a62?d=identicon)[mrs2000](/maintainers/mrs2000)

---

Top Contributors

[![mrs2000](https://avatars.githubusercontent.com/u/2921111?v=4)](https://github.com/mrs2000 "mrs2000 (9 commits)")

### Embed Badge

![Health badge](/badges/mrssoft-yii2-globalstate/health.svg)

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

PHPackages © 2026

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