Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bermudaphp/registry

Superglobal key - value php storage
https://github.com/bermudaphp/registry

key-value php registry storage superglobals

Last synced: 4 days ago
JSON representation

Superglobal key - value php storage

Awesome Lists containing this project

README

        

# Install
```bash
composer require bermudaphp/registry
````

# Set
```php
Registry::set('message', 'Hello World');

Registry::getInstance()->offsetSet('message', 'Hello World!');
Registry::getInstance()['message'] = 'Hello, Jane!';

````

# Get
```php
Registry::get('MessaGe', 'default value'); // default value

Registry::getInstance()->offsetGet('message'); // Hello, Jane!
Registry::getInstance()['message']; // Hello, Jane!;

````

# Exists
```php
Registry::has('appVersion'); // false

Registry::getInstance()->offsetExists('message'); // true
isset(Registry::getInstance()['message']); // true;

````

# Unset
```php
Registry::remove('message');

Registry::getInstance()->offsetUnset('message');
unset(Registry::getInstance()['message']);

````