Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/calendar/lib/sync/icloud/ |
Upload File : |
<?php namespace Bitrix\Calendar\Sync\Icloud; class VendorSyncService { /** @var Helper $helper */ protected Helper $helper; /** @var ?ApiService $apiService */ protected ?ApiService $apiService = null; /** @var ?string $error */ protected ?string $error = null; public function __construct() { $this->helper = new Helper(); } //DavConnection data or only authorization data public function getCalendarServerPath(array $connection): ?string { if (empty($connection['ID'])) { $server = $this->getApiService()->prepareUrl($this->helper::SERVER_PATH); $server['path'] = $this->getApiService()->getPrinciples($connection, $server); if (!$server['path']) { return null; } $calendarPath = $this->getApiService()->getCalendarPath($connection, $server); if ($calendarPath) { return $calendarPath; } return null; } return $connection['SERVER_SCHEME'] . '://' . $connection['SERVER_HOST'] . $connection['SERVER_PATH'] ; } public static function generateUuid(): string { $word = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0x0fff ) | 0x4000, mt_rand( 0, 0x3fff ) | 0x8000, mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); return mb_strtoupper($word); } private function getApiService(): ApiService { if (!$this->apiService) { $this->apiService = new ApiService(); } return $this->apiService; } public function getError(): ?string { return $this->error; } }