cron.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. date_default_timezone_set('Europe/Moscow');
  3. @ini_set('display_errors', TRUE);
  4. @ini_set('html_errors', TRUE);
  5. @ini_set('error_reporting', E_ALL);
  6. DEFINE('EGP', TRUE);
  7. DEFINE('DIR', dirname('index.php'));
  8. DEFINE('ROOT', DIR . '/');
  9. DEFINE('SYS', ROOT . 'system/');
  10. DEFINE('TPL', ROOT . 'template/');
  11. DEFINE('TEMP', ROOT . 'temp/');
  12. DEFINE('FILES', ROOT . 'files/');
  13. DEFINE('DATA', SYS . 'data/');
  14. DEFINE('LIB', SYS . 'library/');
  15. DEFINE('ENG', SYS . 'engine/');
  16. DEFINE('SEC', SYS . 'sections/');
  17. DEFINE('CRON', LIB . 'cron/');
  18. $start_point = $_SERVER['REQUEST_TIME'];
  19. $mcache = new Memcache;
  20. $mcache->connect('127.0.0.1', 11211) or exit('Ошибка: не удалось создать связь с Memcache.' . PHP_EOL);
  21. // Настройки
  22. include(DATA . 'config.php');
  23. /*if($argv[1] != $cfg['cron_key'])
  24. exit('error key.'.PHP_EOL);
  25. */
  26. $task = $argv[2];
  27. include(DATA . 'engine.php');
  28. include(DATA . 'mysql.php');
  29. include(DATA . 'params.php');
  30. // Библиотеки
  31. include(LIB . 'sql.php');
  32. include(LIB . 'html.php');
  33. include(LIB . 'system.php');
  34. include(LIB . 'cron.php');
  35. ?>