From 9cb1ac3de5d0f540bc6e1f5b1f4277b5a5bb9e67 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 19 May 2016 20:36:32 -0700 Subject: daemon master: create some compatibility code --- Zotlabs/Daemon/Deliver.php | 2 +- Zotlabs/Daemon/Directory.php | 4 ++-- Zotlabs/Daemon/Master.php | 1 + Zotlabs/Daemon/Notifier.php | 5 +++-- Zotlabs/Daemon/Poller.php | 24 ++++++++++++------------ Zotlabs/Daemon/Ratenotif.php | 4 ++-- 6 files changed, 21 insertions(+), 19 deletions(-) (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Deliver.php b/Zotlabs/Daemon/Deliver.php index 56f0fed78..7a321a1f8 100644 --- a/Zotlabs/Daemon/Deliver.php +++ b/Zotlabs/Daemon/Deliver.php @@ -8,7 +8,7 @@ require_once('include/queue_fn.php'); class Deliver { - static public function function run($argc,$argv) { + static public function run($argc,$argv) { if($argc < 2) return; diff --git a/Zotlabs/Daemon/Directory.php b/Zotlabs/Daemon/Directory.php index 1312f0638..c8cdafdf5 100644 --- a/Zotlabs/Daemon/Directory.php +++ b/Zotlabs/Daemon/Directory.php @@ -51,7 +51,7 @@ class Directory { // Now update all the connections if($pushall) - proc_run('php','include/notifier.php','refresh_all',$channel['channel_id']); + Master::Summon(array('Notifier','refresh_all',$channel['channel_id'])); return; } @@ -94,7 +94,7 @@ class Directory { // Now update all the connections if($pushall) - proc_run('php','include/notifier.php','refresh_all',$channel['channel_id']); + Master::Summon(array('Notifier','refresh_all',$channel['channel_id'])); } } diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 3d21a68e0..a78e7c590 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -23,6 +23,7 @@ class Master { static public function Release($argc,$argv) { cli_startup(); + logger('Master: release: ' . print_r($argv,true)); require_once('Zotlabs/Daemon/' . $argv[0] . '.php'); $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; $cls::run($argc,$argv); diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 919f98823..d37182a4d 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -381,7 +381,7 @@ class Notifier { // don't uplink a relayed post to the relay owner if($parent_item['source_xchan'] !== $parent_item['owner_xchan']) { logger('notifier: uplinking this item'); - proc_run('php','include/notifier.php','uplink',$item_id); + Master::Summon(array('Notifier','uplink',$item_id)); } } @@ -641,7 +641,8 @@ class Notifier { if($normal_mode) { $x = q("select * from hook where hook = 'notifier_normal'"); if($x) - proc_run('php','include/deliver_hooks.php', $target_item['id']); + Master::Summon(array('Deliver_hooks',$target_item['id'])); + } if($deliveries) diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php index ab96de7c8..1473b5ec6 100644 --- a/Zotlabs/Daemon/Poller.php +++ b/Zotlabs/Daemon/Poller.php @@ -36,7 +36,7 @@ class Poller { // run queue delivery process in the background - proc_run('php',"include/queue.php"); + Master::Summon(array('Queue')); // maintenance for mod sharedwithme - check for updated items and remove them @@ -76,7 +76,7 @@ class Poller { ); if($r) { foreach($r as $rr) { - proc_run('php','include/directory.php',$rr['channel_id'],'force'); + Master::Summon(array('Directory',$rr['channel_id'],'force')); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } @@ -96,7 +96,7 @@ class Poller { intval($rr['id']) ); if($x) { - proc_run('php','include/notifier.php','wall-new',$rr['id']); + Master::Summon(array('Notifier','wall-new',$rr['id'])); } } } @@ -172,10 +172,10 @@ class Poller { } // Check for dead sites - proc_run('php', 'include/checksites.php'); + Master::Summon(array('Checksites')); // update searchable doc indexes - proc_run('php', 'include/importdoc.php'); + Master::Summon(array('Importdoc')); /** * End Cron Weekly @@ -223,8 +223,8 @@ class Poller { set_config('system','last_expire_day',$d2); - proc_run('php','include/expire.php'); - proc_run('php','include/cli_suggest.php'); + Master::Summon(array('Expire')); + Master::Summon(array('Cli_suggest')); require_once('include/hubloc.php'); remove_obsolete_hublocs(); @@ -261,7 +261,7 @@ class Poller { // pull in some public posts if(! get_config('system','disable_discover_tab')) - proc_run('php','include/externals.php'); + Master::Summon(array('Externals')); $manual_id = 0; @@ -295,7 +295,7 @@ class Poller { // TODO check to see if there are any cronhooks before wasting a process if(! $restart) - proc_run('php','include/cronhooks.php'); + Master::Summon(array('Cronhooks')); // Only poll from those with suitable relationships @@ -333,7 +333,7 @@ class Poller { $min = 60; $x = datetime_convert('UTC','UTC',"now - $min minutes"); if($c < $x) { - proc_run('php','include/onepoll.php',$contact['abook_id']); + Master::Summon(array('Onepoll',$contact['abook_id'])); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } @@ -398,7 +398,7 @@ class Poller { if((! $update) && (! $force)) continue; - proc_run('php','include/onepoll.php',$contact['abook_id']); + Master::Summon(array('Onepoll',$contact['abook_id'])); if($interval) @time_sleep_until(microtime(true) + (float) $interval); @@ -420,7 +420,7 @@ class Poller { if($rr['ud_last'] != NULL_DATE) if($rr['ud_last'] > datetime_convert('UTC','UTC', 'now - 1 day')) continue; - proc_run('php','include/onedirsync.php',$rr['ud_id']); + Master::Summon(array('Onedirsync',$rr['ud_id'])); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } diff --git a/Zotlabs/Daemon/Ratenotif.php b/Zotlabs/Daemon/Ratenotif.php index fd2200dc9..a404273e2 100644 --- a/Zotlabs/Daemon/Ratenotif.php +++ b/Zotlabs/Daemon/Ratenotif.php @@ -92,7 +92,7 @@ class Ratenotif { $deliver[] = $hash; if(count($deliver) >= $deliveries_per_process) { - proc_run('php','include/deliver.php',$deliver); + Master::Summon(array('Deliver',$deliver)); $deliver = array(); if($interval) @time_sleep_until(microtime(true) + (float) $interval); @@ -102,7 +102,7 @@ class Ratenotif { // catch any stragglers if(count($deliver)) { - proc_run('php','include/deliver.php',$deliver); + Master::Summon(array('Deliver',$deliver)); } } } -- cgit v1.2.3