Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bermudaphp/registry
- Owner: bermudaphp
- License: mit
- Created: 2020-06-25T16:34:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T17:34:08.000Z (almost 3 years ago)
- Last Synced: 2024-03-22T01:21:10.544Z (8 months ago)
- Topics: key-value, php, registry, storage, superglobals
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 valueRegistry::getInstance()->offsetGet('message'); // Hello, Jane!
Registry::getInstance()['message']; // Hello, Jane!;````
# Exists
```php
Registry::has('appVersion'); // falseRegistry::getInstance()->offsetExists('message'); // true
isset(Registry::getInstance()['message']); // true;````
# Unset
```php
Registry::remove('message');Registry::getInstance()->offsetUnset('message');
unset(Registry::getInstance()['message']);````