From bc616f22653fc9878693b0df54ea82001fd74311 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Thu, 18 Sep 2025 19:41:29 +0530 Subject: [PATCH] chore: replace uname in case environment does not supports --- src/Twilio/Base/BaseClient.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Twilio/Base/BaseClient.php b/src/Twilio/Base/BaseClient.php index 70ed2ec3b..ab84fe21d 100644 --- a/src/Twilio/Base/BaseClient.php +++ b/src/Twilio/Base/BaseClient.php @@ -173,9 +173,14 @@ public function request( } $logLevel = (getenv('DEBUG_HTTP_TRAFFIC') === 'true' ? 'debug' : $this->getLogLevel()); - + $os = PHP_OS; + $arch = 'default_arch'; + if (function_exists('php_uname')) { + $os = php_uname("s"); + $arch = php_uname("m"); + } $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . - ' (' . php_uname("s") . ' ' . php_uname("m") . ')' . + ' (' . $os . ' ' . $arch . ')' . ' PHP/' . PHP_VERSION; $headers['Accept-Charset'] = 'utf-8';