static function &init() { static $instance = false; if (!$instance) { $class = get_called_class(); $services = Keyring::get_registered_services(); if (in_array($class::NAME, array_keys($services))) { $instance = $services[$class::NAME]; } else { $instance = new $class(); Keyring::register_service($instance); } } return $instance; }