public static function getInstance($registry) { if (!isset($instance)) { Messaging::$instance = new Messaging($registry); } return Messaging::$instance; }