1
0
Fork 0
mirror of synced 2025-04-11 05:00:55 +00:00
Создание конфигурационного файла при установке и обновлении модуля
This commit is contained in:
Ivan Chaplygin 2024-01-12 15:58:17 +03:00
parent 1ffad9447d
commit 254a4c88c5
3 changed files with 31 additions and 1 deletions

View file

@ -252,6 +252,7 @@ class intaro_retailcrm extends CModule
$this->addEvents();
$this->addAgreement();
$this->addUserFields();
$this->createCustomPropertyFile();
OrderLoyaltyDataService::createLoyaltyHlBlock();

View file

@ -232,6 +232,19 @@ trait InstallerTrait
}
}
public function createCustomPropertyFile(): void
{
$path = $_SERVER['DOCUMENT_ROOT'] . '/local/';
CheckDirPath($path);
$file = new \Bitrix\Main\IO\File($path . 'addProper4ty.txt', $siteId = null);
if (!$file->isExists()) {
$file->putContents("");
}
}
/**
* delete loyalty program events handlers
*/
@ -272,4 +285,4 @@ trait InstallerTrait
);
}
}
}
}

View file

@ -1203,8 +1203,24 @@ function update()
'custom_fields_toggle',
'N'
);
createCustomPropertyFile();
}
function createCustomPropertyFile()
{
$path = $_SERVER['DOCUMENT_ROOT'] . '/local/';
CheckDirPath($path);
$file = new \Bitrix\Main\IO\File($path . 'addProper4ty.txt', $siteId = null);
if (!$file->isExists()) {
$file->putContents("");
}
}
try {
update();
} catch (Main\ObjectPropertyException | Main\ArgumentException | Main\SystemException $exception) {