You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
491 B

  1. <?php
  2. declare(ticks=1);
  3. chdir(__DIR__.'/..');
  4. $mode = 'run';
  5. if(array_key_exists(1, $argv) && $argv[1] == 'once')
  6. $mode = 'once';
  7. if($mode == 'run') {
  8. if(function_exists('pcntl_signal')) {
  9. pcntl_signal(SIGINT, function($sig){
  10. global $pcntl_continue;
  11. $pcntl_continue = FALSE;
  12. });
  13. }
  14. }
  15. $pcntl_continue = TRUE;
  16. define('PDO_SUPPORT_DELAYED', TRUE);
  17. require 'vendor/autoload.php';
  18. if($mode == 'once') {
  19. DeferredTask::run_once();
  20. } else {
  21. DeferredTask::run();
  22. }