schpnc

BX CRON AGENTS

Sep 30th, 2020
560
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * В dbconn.php
  4.  * + if(!(defined("CHK_EVENT") && CHK_EVENT === true))
  5.  * +      define("BX_CRONTAB_SUPPORT", true);
  6.  * - define("BX_CRONTAB_SUPPORT", true);
  7.  * - define("BX_CRONTAB", true);
  8.  *
  9.  * В PHP консоли
  10.  * COption::SetOptionString("main", "agents_use_crontab", "N");
  11.  * echo COption::GetOptionString("main", "agents_use_crontab", "N");
  12.  * COption::SetOptionString("main", "check_agents", "N");
  13.  * echo COption::GetOptionString("main", "check_agents", "Y");
  14.  *
  15.  * В bash консоли
  16.  * crontab -e
  17.  * * * * * * /usr/bin/php -f /home/bitrix/www/bitrix/php_interface/cron_events.php
  18.  *
  19.  */
  20.  
  21.  
  22. $_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__FILE__)."/../..");
  23. $DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
  24.  
  25. define("NO_KEEP_STATISTIC", true);
  26. define("NOT_CHECK_PERMISSIONS",true);
  27. define("CHK_EVENT", true);
  28.  
  29. require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
  30.  
  31. @set_time_limit(0);
  32. @ignore_user_abort(true);
  33.  
  34. CAgent::CheckAgents();
  35.  
  36. define("BX_CRONTAB_SUPPORT", true);
  37. define("BX_CRONTAB", true);
  38.  
  39. CEvent::CheckEvents();
  40. if(CModule::IncludeModule('sender')) {
  41.     \Bitrix\Sender\MailingManager::checkPeriod(false);
  42.     \Bitrix\Sender\MailingManager::checkSend();
  43. }
  44.  
  45. require($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/tools/backup.php");
  46.  
  47. CMain::FinalActions();
  48.  
RAW Paste Data