/** * Get a Latch instance * * @return Latch Connection instance */ public static function getLatchConnection() { $pluginParams = new JRegistry(JPluginHelper::getPlugin("user", "latch")->params); $appId = $pluginParams->get("latch_appID"); $appSecret = $pluginParams->get("latch_appSecret"); $apiHost = $pluginParams->get("latch_host"); if (!empty($apiHost)) { Latch::setHost(rtrim($apiHost, '/')); } if (!empty($appId) && !empty($appSecret)) { return new Latch($appId, $appSecret); } return; }