diff --git a/CHANGELOG.md b/CHANGELOG.md index 77151519..6ce7301c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2022-12-02 v.6.2.0 +- Удаление управления конфигурацией cron + ## 2022-12-01 v.6.1.9 - Исправление ошибки создания клиента без email по истории - Добавление передачи комментария к статусу заказа в CRM diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 778a2608..87149348 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,2 +1 @@ -- Исправление ошибки создания клиента без email по истории -- Добавление передачи комментария к статусу заказа в CRM \ No newline at end of file +- Удаление устаревнешего функционала управления конфигурацией cron \ No newline at end of file diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index 632773e8..ed906f1e 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -1133,81 +1133,6 @@ class intaro_retailcrm extends CModule ); } - if ('cron' === $typeLoading) { - include($this->INSTALL_PATH . '/../lib/vendor/symfony/component/process/phpexecutablefinder.php'); - include($this->INSTALL_PATH . '/../lib/vendor/symfony/component/process/executablefinder.php'); - - $agent_period = 24; - $finder = new PhpExecutableFinder(); - $agent_php_path = $finder->find(); - - if (!file_exists($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS . 'cron_frame.php')) { - CheckDirPath($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS); - $tmp_file_size = filesize($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS_DEF . 'cron_frame.php'); - $fp = fopen($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS_DEF . 'cron_frame.php', 'rb'); - $tmp_data = fread($fp, $tmp_file_size); - fclose($fp); - - $tmp_data = str_replace('#DOCUMENT_ROOT#', $_SERVER['DOCUMENT_ROOT'], $tmp_data); - $tmp_data = str_replace('#PHP_PATH#', $agent_php_path, $tmp_data); - - $fp = fopen($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS . 'cron_frame.php', 'ab'); - fwrite($fp, $tmp_data); - fclose($fp); - } - - $cfg_data = ''; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/crontab.cfg')) { - $cfg_file_size = filesize($_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/crontab.cfg'); - $fp = fopen($_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/crontab.cfg', 'rb'); - $cfg_data = fread($fp, $cfg_file_size); - fclose($fp); - } - - CheckDirPath($_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH2EXPORTS . 'logs/'); - - if ($arProfile['IN_CRON'] == 'Y') { - // remove - $cfg_data = preg_replace('#^.*?' - . preg_quote(CATALOG_PATH2EXPORTS) - . 'cron_frame.php +' - . $profileId - . ' *>.*?$#im', '', $cfg_data); - } else { - $strTime = '0 */' . $agent_period . ' * * * '; - if (strlen($cfg_data) > 0) { - $cfg_data .= "\n"; - } - - $cfg_data .= $strTime - . $agent_php_path - . ' -f ' - . $_SERVER['DOCUMENT_ROOT'] - . CATALOG_PATH2EXPORTS - . 'cron_frame.php ' - . $profileId - . ' >' - . $_SERVER['DOCUMENT_ROOT'] - . CATALOG_PATH2EXPORTS - . 'logs/' - . $profileId - . ".txt\n"; - } - - CCatalogExport::Update($profileId, [ - 'IN_CRON' => 'Y', - ]); - - CheckDirPath($_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/'); - $cfg_data = preg_replace("#[\r\n]{2,}#im", "\n", $cfg_data); - $fp = fopen($_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/crontab.cfg', 'wb'); - fwrite($fp, $cfg_data); - fclose($fp); - - $arRetval = []; - @exec('crontab ' . $_SERVER['DOCUMENT_ROOT'] . '/bitrix/crontab/crontab.cfg', $arRetval, $return_var); - } - $api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0); $api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0); $api_version = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_VERSION, 0); diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 234d7f73..6159b6dd 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.1.9', - 'VERSION_DATE' => '2022-12-01 11:30:00' + 'VERSION' => '6.2.0', + 'VERSION_DATE' => '2022-12-02 13:00:00' ];