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.
composer require sinevia/php-library-registry
Download from https://github.com/Sinevia/php-library-registry
\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');
$title = \Sinevia\Registry::get('title', 'Undefined');