Cierto, es mejor que la hagas estatica, algo así:
Código PHP:
Ver original<?php
class Registry
{
private static
$_registry = array();
private function __construct(){}
public static function has($entry)
{
return (isset(self::$_registry[$entry])); }
public static function set($entry, $value)
{
self::$_registry[$entry] = $value;
}
public static function get($entry)
{
if (self::has($entry)) {
return self::$_registry[$entry];
} else {
return null;
}
}
public static function clear()
{
self::$_registry = array(); }
}
Saludos.