• Модуль: mobileapp
  • Путь к файлу: ~/bitrix/modules/mobileapp/lib/designer/tools.php
  • Класс: BitrixMobileAppDesignerTools
  • Вызов: Tools::generateMobileJSFile
static function generateMobileJSFile()
{
	$lastModificationHash = Option::get("mobileapp","mobile_core_modification","");
	$coreMobileFileList = array(
		"/bitrix/js/main/core/core.js",
		"/bitrix/js/main/core/core_promise.js",
		"/bitrix/js/main/core/core_ajax.js",
		"/bitrix/js/main/core/core_db.js",
		"/bitrix/js/mobileapp/bitrix_mobile.js",
		"/bitrix/js/mobileapp/mobile_lib.js"
	);

	$modificationHash = self::getArrayFilesHash($coreMobileFileList);

	$coreFile = new File(Application::getDocumentRoot().self::$jsMobileCorePath);

	if($modificationHash == $lastModificationHash && $coreFile->isExists())
		return;

	CheckDirPath(Application::getDocumentRoot()."/bitrix/cache/js/mobileapp_designer/");

	$content = "";
	foreach ($coreMobileFileList as $filePath)
	{
		$file = new BitrixMainIOFile(Application::getDocumentRoot().$filePath);
		if($file->isExists())
		{
			$fileContent = $file->getContents();
			$content.="nn".$fileContent;

		}
	}


	$coreFile->open("w+");
	$coreFile->putContents($content);
	$coreFile->close();

	Option::set("mobileapp","mobile_core_modification", $modificationHash);

}