public static function Utility::serverRun in Rocket.Chat 8.2
Same name and namespace in other branches
- 8 src/Utility.php \Drupal\rocket_chat\Utility::serverRun()
ServerRun.
Parameters
string $url: Url to use.
Return value
bool Connection Worked?
1 call to Utility::serverRun()
- RocketChatSettingsForm::validateForm in src/
Form/ RocketChatSettingsForm.php - Form validation handler.
File
- src/
Utility.php, line 118 - Contains \Drupal\rocket_chat\FormManager.
Class
- Utility
- Check the form values.
Namespace
Drupal\rocket_chatCode
public static function serverRun($url) {
try {
$urlSplit = Utility::parseUrl($url);
$ConnectionType = self::transportTestUrl($urlSplit['host'], $urlSplit['port'], $urlSplit['path']);
if (!empty($ConnectionType)) {
Drupal::messenger()
->addStatus(t("Connected to RocketChat through [@transport]", [
"@transport" => $ConnectionType,
]));
return TRUE;
}
else {
return FALSE;
}
} catch (Exception $exception) {
error_log("serverRun encountered and exception, check [{$url}] for valid URL" . $exception
->getMessage());
return FALSE;
}
}