ref #93387
Создание конфигурационного файла при установке и обновлении модуля
This commit is contained in:
parent
1ffad9447d
commit
254a4c88c5
3 changed files with 31 additions and 1 deletions
|
@ -252,6 +252,7 @@ class intaro_retailcrm extends CModule
|
|||
$this->addEvents();
|
||||
$this->addAgreement();
|
||||
$this->addUserFields();
|
||||
$this->createCustomPropertyFile();
|
||||
|
||||
OrderLoyaltyDataService::createLoyaltyHlBlock();
|
||||
|
||||
|
|
|
@ -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
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue