sinevia/php-library-registry

v2.9.0 2019-06-17 20:00 UTC

This package is auto-updated.

Last update: 2022-05-18 02:43:32 UTC


README

The Registry provides a safe implementation of an a registry store for variables, that can be used anywhere in the app.

It is a safe alternative of the $GLOBALS variable.

No Dependencies

Background

Installation

1. Via Composer

composer require sinevia/php-library-registry

2. Manually

Download from https://github.com/Sinevia/php-library-registry

Usage

1. Setting, retrieving, removing

\Sinevia\Registry::set('admin_email','admin@domain.com');

if (\Sinevia\Registry::has('admin_email')) { 
    echo \Sinevia\Registry::get('admin_email');
}

\Sinevia\Registry::remove('admin_email');

2. Default value

$title = \Sinevia\Registry::get('title', 'Undefined');