Example #1
0
                        break;
                    case 2:
                        if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 12 hour")) {
                            $update = true;
                        }
                        break;
                    case 1:
                    default:
                        if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 hour")) {
                            $update = true;
                        }
                        break;
                }
                if (!$update) {
                    continue;
                }
            }
            logger("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact["nick"] . " " . $contact["name"]);
            proc_run('php', 'include/onepoll.php', $contact['id']);
            if ($interval) {
                @time_sleep_until(microtime(true) + (double) $interval);
            }
        }
    }
    logger('poller: end');
    return;
}
if (array_search(__FILE__, get_included_files()) === 0) {
    poller_run($_SERVER["argv"], $_SERVER["argc"]);
    killme();
}
Example #2
0
                            $update = true;
                        }
                        break;
                    case 2:
                        if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 12 hour")) {
                            $update = true;
                        }
                        break;
                    case 1:
                    default:
                        if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 hour")) {
                            $update = true;
                        }
                        break;
                }
                if (!$update && !$force) {
                    continue;
                }
            }
            proc_run('php', 'include/onepoll.php', $contact['id']);
            if ($interval) {
                @time_sleep_until(microtime(true) + (double) $interval);
            }
        }
    }
    return;
}
if (array_search(__FILE__, get_included_files()) === 0) {
    poller_run($argv, $argc);
    killme();
}
Example #3
0
<?php

/** @file */
require_once 'include/cli_startup.php';
function poller_run($argc, $argv)
{
    cli_startup();
    \Zotlabs\Daemon\Master::Summon(array('Cron'));
}
if (array_search(__FILE__, get_included_files()) === 0) {
    poller_run($argc, $argv);
    killme();
}