PHPackages                             emo-ti-on/storekeeper - 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. emo-ti-on/storekeeper

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

emo-ti-on/storekeeper
=====================

PHP config creator

02PHP

Since Apr 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Emo-ti-on/Storekeeper)[ Packagist](https://packagist.org/packages/emo-ti-on/storekeeper)[ RSS](/packages/emo-ti-on-storekeeper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Storekeeper
===========

[](#storekeeper)

### Be careful README.md was created by (not) master of english

[](#be-careful-readmemd-was-created-by-not-master-of-english)

Configuring
-----------

[](#configuring)

You must set up folder were we will store all configs.

```
Simplify\Storekeeper\Config::setConfigFolder('/path/to/folder')
```

Also, you may select separator for map.

```
Simplify\Storekeeper\Config::setSeparator('.') // By default separator is "."
```

Usage
-----

[](#usage)

Create instance of `Simplify\Storekeeper\Config`

```
$config = new Simplify\Storekeeper\Config('name_of_config');
```

If you want you can store some data inside config, when you create instance

```
$data = [
    'data' => '2',
    'data2' => 1
];

$config = new Simplify\Storekeeper\Config('name_of_config', $data);
```

Storekeeper check is file (with name as config name) exists. If exists it fills current config, otherwise it stays empty.

Now you can start your work with the available methods.

---

### *get(string $map = ''): mixed*

[](#getstring-map---mixed)

Returns data searched by $map

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config'),
    [
        'someData' => [
            'subData1' => true,
            'subData2' => 'data2'
        ],
        'number' => 123
    ]
);

$data = $config->get('someData.subData1'); // Returns true
$data2 = $config->get('somData.subData2'); // Returns 'data2'
$data3 = $config->get('number'); // Returns 123
```

---

### *set(string $map, mixed $value): void*

[](#setstring-map-mixed-value-void)

Setup data by $map

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config');

$config->set('str', '1234');
$config->set('number', 1234);
$config->set('somData.subData2', false);
```

### Pay attention!

[](#pay-attention)

All data keeps in global value

```
$config = new Simplify\Storekeeper\Config('name_of_config');
$sameConfig = new Simplify\Storekeeper\Config('name_of_config');

$config->set('foo', 'global value');

echo $sameConfig->get('foo'); // Output: 'global value'
```

---

### *contains(string $map): bool*

[](#containsstring-map-bool)

Check is config key exists

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config'),
    [
        'existVal' => [
            'existsSubVal' => 'data'
        ]
    ]
);

$config->contains('existVal') // Returns true
$config->contains('existVal.existsSubVal') // Returns true
$config->contains('thisValueIsNotExists') // Returns false
```

---

### *unset(string $map): void*

[](#unsetstring-map-void)

Removes data by $map

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config'),
    [
        'someData' => [
            'subData1' => true,
            'subData2' => 'data2'
        ],
        'number' => 123
    ]
);
$config->unset('someData')
$config->get('someData') // throws Exception 'Key someData does not exist'
```

---

### *reset()*

[](#reset)

Returns config to it initial state

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config'),
    [
        'value1' => 'i\'am a string'
        'value2' => 97
    ]
);
$config->set('value1', 555)
$config->unset('value2')

print_r($config->get()) // Array (value1 => 555)

$config->reset()
print_r($config->get())
/*
   Array (
       value1 => i'am a string
       value2 => 97
   )
 */
```

### Be careful!!!

[](#be-careful)

When you create instance of Config it saves current state in local value.

```
$snake_config = new \Simplify\Storekeeper\Config('config'); // Saved state is []

$snake_config->set('foo', 1233); // Current state ['foo' => 1233]
echo $snake_config->get('foo') . PHP_EOL; // output 1233

$camelConfig = new \Simplify\Storekeeper\Config('config'); // Saved state ['foo' => 1233]

$camelConfig->set('foo', 12); // Current state ['foo' => 12]
echo $camelConfig->get('foo') . PHP_EOL; // output 12

$camelConfig->reset(); // Current state ['foo' => 1233]
echo $snake_config->get('foo') . PHP_EOL; // output 1233

$snake_config->reset();

$camelConfig->get('foo'); // Exception: value: 'foo' Does not exists in ...
```

---

### *truncate(): void*

[](#truncate-void)

Remove all data from current config

Example

```
$config = new Simplify\Storekeeper\Config('name_of_config'),
    [
        'value1' => 'i\'am a string'
        'value2' => 97
    ]
);

print_r($config->get())
/*
   Array (
       value1 => i'am a string
       value2 => 97
   )
 */

$config->truncate();

print_r($config->get()); // Array ()
```

---

### *delete(): void*

[](#delete-void)

Remove file from config folder

---

### *save(): void*

[](#save-void)

Stores data to file inside config folder (filename is the same as config name)

---

### *isEmpty(): bool*

[](#isempty-bool)

Check is current config empty

---

### *isNotExists(): bool*

[](#isnotexists-bool)

Check is config file exists

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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/869cf40df62849af6983f2031da31b11f4fd421b3fa159a05fea46a64068a5e4?d=identicon)[Emo-ti-on](/maintainers/Emo-ti-on)

---

Top Contributors

[![Emo-ti-on](https://avatars.githubusercontent.com/u/69530368?v=4)](https://github.com/Emo-ti-on "Emo-ti-on (1 commits)")

---

Tags

configconfiguration-filesphp

### Embed Badge

![Health badge](/badges/emo-ti-on-storekeeper/health.svg)

```
[![Health](https://phpackages.com/badges/emo-ti-on-storekeeper/health.svg)](https://phpackages.com/packages/emo-ti-on-storekeeper)
```

###  Alternatives

[codemix/yii2-configloader

Build configuration arrays from config files and env vars.

60127.5k](/packages/codemix-yii2-configloader)

PHPackages © 2026

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