• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/smile.php
  • Класс: CSmile
  • Вызов: CSmile::moveSmilesToUploadAgent
static function moveSmilesToUploadAgent(): string
{
	$paths = [
		'smiles' => [
			'old' => '/bitrix/images/main/smiles/',
			'new' => self::PATH_TO_SMILE
		],
		'icons' => [
			'old' => '/bitrix/images/main/icons/',
			'new' => self::PATH_TO_ICON
		]
	];

	$returnValue = '';
	foreach ($paths as $path)
	{
		$oldPath = $_SERVER["DOCUMENT_ROOT"] . $path['old'];
		$newPath = $_SERVER["DOCUMENT_ROOT"] . $path['new'];

		$directory = new BitrixMainIODirectory($oldPath);
		if ($directory->isExists())
		{
			CopyDirFiles($directory->getPhysicalPath(), $newPath, true, true);
			self::setLastUpdate();
		}
		else
		{
			$returnValue = __METHOD__ . '();';
		}
	}

	return $returnValue;
}