Skip to content

bermudaphp/registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Install

composer require bermudaphp/registry

Set

Registry::set('message', 'Hello World');

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

Get

Registry::get('MessaGe', 'default value'); // default value

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

Exists

Registry::has('appVersion'); // false

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

Unset

Registry::remove('message');

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