sinevia/php-library-registry

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

This package is auto-updated.

Last update: 2024-12-18 08:19:01 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');