BxDolCronUpgradeCheck.php 661 B

123456789101112131415161718192021222324252627
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. class BxDolCronUpgradeCheck extends BxDolCron
  10. {
  11. public function processing()
  12. {
  13. if ('on' != getParam('sys_autoupdate'))
  14. return;
  15. $o = bx_instance('BxDolUpgrader');
  16. if (!$o->prepare()) {
  17. sendMailTemplateSystem('t_UpgradeFailed', array (
  18. 'error_msg' => $o->getError(),
  19. ));
  20. setParam('sys_autoupdate', ''); // disable auto-update if it is failed
  21. }
  22. }
  23. }
  24. /** @} */