• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/sharepoint_queue.php
  • Класс: CAllIntranetSharepointQueue
  • Вызов: CAllIntranetSharepointQueue::Lock
static function Lock()
{
	$lock_path = CTempFile::GetAbsoluteRoot().'/';
	$lock_filename = $lock_path.'sharepoint.lock.txt';
	$lock_ts = time();

	if (file_exists($lock_filename))
	{
		$ts = file_get_contents($lock_filename);

		if ($lock_ts - $ts < 300)
			return false;
	}

	CheckDirPath($lock_path);

	$fp = fopen($lock_filename, 'w');
	fwrite($fp, $lock_ts);
	fclose($fp);

	return true;
}