Merge branch 'dev' of ../p3 into dev

This commit is contained in:
zotlabs 2020-06-15 01:04:00 -07:00
commit 32d414d173
52 changed files with 188 additions and 146 deletions

View file

@ -72,7 +72,7 @@ Switch the verification on/off (1/0)
- restart
+ create cron jobs for
- DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes
- Master.php for Zap/Hubzilla every 10 minutes
- Run.php for Zap/Hubzilla every 10 minutes
- daily maintenance script every day at 05:30
The script is known to work without adjustments with

View file

@ -30,7 +30,7 @@
# * adminer,
# * git to download and update addons
# - configure cron
# * "Master.php" for regular background prozesses of hubzilla
# * "Run.php" for regular background prozesses of hubzilla
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
# * backup hubzillas database and files (rsync)
@ -485,9 +485,9 @@ function install_cryptosetup {
function configure_cron_daily {
print_info "configuring cron..."
# every 10 min for poller.php
if [ -z "`grep 'Master.php' /etc/crontab`" ]
if [ -z "`grep 'Run.php' /etc/crontab`" ]
then
echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab
echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Run.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30
# - stop apache and mysql-server

View file

@ -34,9 +34,9 @@ class Cron {
// run queue delivery process in the background
Master::Summon(array('Queue'));
Run::Summon(array('Queue'));
Master::Summon(array('Poller'));
Run::Summon(array('Poller'));
// maintenance for mod sharedwithme - check for updated items and remove them
@ -62,7 +62,7 @@ class Cron {
drop_item($rr['id'],false,(($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
if($rr['item_wall']) {
// The notifier isn't normally invoked unless item_drop is interactive.
Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
Run::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
}
}
}
@ -91,7 +91,7 @@ class Cron {
);
if($r) {
foreach($r as $rr) {
Master::Summon(array('Directory',$rr['channel_id'],'force'));
Run::Summon(array('Directory',$rr['channel_id'],'force'));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
@ -123,7 +123,7 @@ class Cron {
]
);
}
Master::Summon(array('Notifier','wall-new',$rr['id']));
Run::Summon(array('Notifier','wall-new',$rr['id']));
}
}
}
@ -152,7 +152,7 @@ class Cron {
if(($d2 != $d1) && ($h1 == $h2)) {
Master::Summon(array('Cron_daily'));
Run::Summon(array('Cron_daily'));
}
// update any photos which didn't get imported properly
@ -183,7 +183,7 @@ class Cron {
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
if(! $disable_discover_tab)
Master::Summon(array('Externals'));
Run::Summon(array('Externals'));
$generation = 0;
@ -203,7 +203,7 @@ class Cron {
// TODO check to see if there are any cronhooks before wasting a process
if(! $restart)
Master::Summon(array('Cronhooks'));
Run::Summon(array('Cronhooks'));
set_config('system','lastcron',datetime_convert());

View file

@ -20,7 +20,7 @@ class Cron_daily {
$d3 = intval(datetime_convert('UTC','UTC','now','N'));
if($d3 == 7) {
Master::Summon(array('Cron_weekly'));
Run::Summon(array('Cron_weekly'));
}
// once daily run birthday_updates and then expire in background
@ -78,8 +78,8 @@ class Cron_daily {
}
Master::Summon(array('Expire'));
Master::Summon(array('Cli_suggest'));
Run::Summon(array('Expire'));
Run::Summon(array('Cli_suggest'));
remove_obsolete_hublocs();

View file

@ -49,7 +49,7 @@ class Cron_weekly {
}
// Check for dead sites
Master::Summon(array('Checksites'));
Run::Summon(array('Checksites'));
// clean up image cache - use site expiration or 180 days if not set
@ -70,7 +70,7 @@ class Cron_weekly {
// update searchable doc indexes
// disabled until help system regenerated
// Master::Summon(array('Importdoc'));
// Run::Summon(array('Importdoc'));
/**
* End Cron Weekly

View file

@ -50,7 +50,7 @@ class Directory {
// Now update all the connections
if($pushall)
Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
Run::Summon(array('Notifier','refresh_all',$channel['channel_id']));
return;
}
@ -99,7 +99,7 @@ class Directory {
// Now update all the connections
if($pushall)
Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
Run::Summon(array('Notifier','refresh_all',$channel['channel_id']));
}
}

View file

@ -1,7 +1,18 @@
<?php
namespace Zotlabs\Daemon;
/* This file will be left here for a period of six months
* starting 2020-06-15. Then it will be removed.
* The English word 'master' is being removed from the codebase.
* This file was previously referenced in setup scripts and is
* required to run background tasks. It is executed by cron.
* We don't want to break this on the short term. This is your
* first warning. The file will be removed in six months and
* you will need to point your cron job or scheduled task to
* Zotlabs/Daemon/Run.php instead of Zotlabs/Daemon/Master.php.
*
*/
if(array_search( __file__ , get_included_files()) === 0) {
require_once('include/cli_startup.php');

View file

@ -36,7 +36,7 @@ require_once('include/bbcode.php');
/*
* The notifier is typically called with:
*
* Zotlabs\Daemon\Master::Summon( [ 'Notifier', COMMAND, ITEM_ID ] );
* Zotlabs\Daemon\Run::Summon( [ 'Notifier', COMMAND, ITEM_ID ] );
*
* where COMMAND is one of the following:
*
@ -395,7 +395,7 @@ class Notifier {
$is_moderated = their_perms_contains($parent_item['uid'],$sendto,'moderated');
if ($relay_to_owner && $thread_is_public && (! $is_moderated)) {
if (get_pconfig($target_item['uid'],'system','hyperdrive',false)) {
Master::Summon([ 'Notifier' , 'hyper', $item_id ]);
Run::Summon([ 'Notifier' , 'hyper', $item_id ]);
}
}
@ -415,7 +415,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');
Master::Summon(array('Notifier','uplink',$item_id));
Run::Summon(array('Notifier','uplink',$item_id));
}
}
@ -681,7 +681,7 @@ class Notifier {
// This wastes a process if there are no delivery hooks configured, so check this before launching the new process
$x = q("select * from hook where hook = 'notifier_normal'");
if ($x) {
Master::Summon( [ 'Deliver_hooks', $target_item['id'] ] );
Run::Summon( [ 'Deliver_hooks', $target_item['id'] ] );
}
}

View file

@ -102,7 +102,7 @@ class Poller {
$min = 60;
$x = datetime_convert('UTC','UTC',"now - $min minutes");
if($c < $x) {
Master::Summon(array('Onepoll',$contact['abook_id']));
Run::Summon(array('Onepoll',$contact['abook_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
@ -167,7 +167,7 @@ class Poller {
if((! $update) && (! $force))
continue;
Master::Summon(array('Onepoll',$contact['abook_id']));
Run::Summon(array('Onepoll',$contact['abook_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
@ -189,7 +189,7 @@ class Poller {
if($rr['ud_last'] > NULL_DATE)
if($rr['ud_last'] > datetime_convert('UTC','UTC', 'now - 1 day'))
continue;
Master::Summon(array('Onedirsync',$rr['ud_id']));
Run::Summon(array('Onedirsync',$rr['ud_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}

View file

@ -8,9 +8,9 @@ command-line process and detached from normal web processing.
Background tasks are invoked by calling
Zotlabs\Daemon\Master::Summon([ $cmd, $arg1, $argn... ]);
Zotlabs\Daemon\Run::Summon([ $cmd, $arg1, $argn... ]);
The Master class loads the desired command file and passes the arguments.
The Run class loads the desired command file and passes the arguments.
To create a background task 'Foo' use the following template.
@ -27,7 +27,7 @@ To create a background task 'Foo' use the following template.
}
The Master class "summons" the command by creating an executable script
The Run class "summons" the command by creating an executable script
from the provided arguments, then it invokes "Release" to execute the script
detached from web processing. This process calls the static::run() function
with any command line arguments using the traditional argc, argv format.

31
Zotlabs/Daemon/Run.php Normal file
View file

@ -0,0 +1,31 @@
<?php
namespace Zotlabs\Daemon;
if (array_search( __file__ , get_included_files()) === 0) {
require_once('include/cli_startup.php');
array_shift($argv);
$argc = count($argv);
if ($argc) {
Run::Release($argc,$argv);
}
return;
}
class Run {
static public function Summon($arr) {
proc_run('php','Zotlabs/Daemon/Run.php',$arr);
}
static public function Release($argc,$argv) {
cli_startup();
logger('Run: release: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
}
}

View file

@ -6,7 +6,7 @@ use Zotlabs\Web\HTTPSig;
use Zotlabs\Access\Permissions;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\PConfig;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\LibBlock;
@ -1328,7 +1328,7 @@ class Activity {
// Send an Accept back to them
set_abconfig($channel['channel_id'],$person_obj['id'],'activitypub','their_follow_id', $their_follow_id);
Master::Summon([ 'Notifier', 'permissions_accept', $contact['abook_id'] ]);
Run::Summon([ 'Notifier', 'permissions_accept', $contact['abook_id'] ]);
return;
case 'Accept':
@ -1443,9 +1443,9 @@ class Activity {
if ($my_perms && $automatic) {
// send an Accept for this Follow activity
Master::Summon([ 'Notifier', 'permissions_accept', $new_connection[0]['abook_id'] ]);
Run::Summon([ 'Notifier', 'permissions_accept', $new_connection[0]['abook_id'] ]);
// Send back a Follow notification to them
Master::Summon([ 'Notifier', 'permissions_create', $new_connection[0]['abook_id'] ]);
Run::Summon([ 'Notifier', 'permissions_create', $new_connection[0]['abook_id'] ]);
}
$clone = array();
@ -1741,7 +1741,7 @@ class Activity {
$icon = z_root() . '/' . get_default_profile_photo(300);
}
Master::Summon( [ 'Xchan_photo', bin2hex($icon), bin2hex($url) ] );
Run::Summon( [ 'Xchan_photo', bin2hex($icon), bin2hex($url) ] );
}
@ -1900,7 +1900,7 @@ class Activity {
dbesc(datetime_convert()),
intval($item['id'])
);
Master::Summon( [ 'Notifier', 'wall-new', $item['id'] ] );
Run::Summon( [ 'Notifier', 'wall-new', $item['id'] ] );
return true;
}
@ -2716,7 +2716,7 @@ class Activity {
if ($is_child_node) {
if ($item['owner_xchan'] === $channel['channel_hash']) {
// We are the owner of this conversation, so send all received comments back downstream
Master::Summon(array('Notifier','comment-import',$x['item_id']));
Run::Summon(array('Notifier','comment-import',$x['item_id']));
}
$r = q("select * from item where id = %d limit 1",
intval($x['item_id'])

View file

@ -6,7 +6,7 @@ use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Queue;
use Zotlabs\Lib\Libsync;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\IConfig;
class ActivityPub {
@ -407,7 +407,7 @@ class ActivityPub {
if ($h) {
$qi = self::queue_message($jmsg,$channel,$h[0]);
if ($qi) {
Master::Summon([ 'Deliver' , $qi ]);
Run::Summon([ 'Deliver' , $qi ]);
}
}
}

View file

@ -4,7 +4,7 @@ namespace Zotlabs\Lib;
use App;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
@ -260,7 +260,7 @@ class Connect {
if ($r) {
$result['abook'] = array_shift($r);
Master::Summon([ 'Notifier', 'permissions_create', $result['abook']['abook_id'] ]);
Run::Summon([ 'Notifier', 'permissions_create', $result['abook']['abook_id'] ]);
}
$arr = [ 'channel_id' => $uid, 'channel' => $channel, 'abook' => $result['abook'] ];

View file

@ -1,7 +1,7 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
class Img_cache {
@ -53,7 +53,7 @@ class Img_cache {
if ($x['success']) {
$i = getimagesize($file);
if ($i && $i[2]) { // looking for non-zero imagetype
Master::Summon( [ 'CacheThumb' , basename($file) ] );
Run::Summon( [ 'CacheThumb' , basename($file) ] );
return true;
}
}

View file

@ -7,7 +7,7 @@ use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Queue;
use Zotlabs\Lib\Connect;
use Zotlabs\Lib\DReport;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
class Libsync {
@ -173,7 +173,7 @@ class Libsync {
}
Master::Summon([ 'Deliver', $hash ]);
Run::Summon([ 'Deliver', $hash ]);
$total = $total - 1;
if ($interval && $total) {
@ -263,7 +263,7 @@ class Libsync {
continue;
}
Master::Summon([ 'Deliver', $hash ]);
Run::Summon([ 'Deliver', $hash ]);
if ($interval && count($h) > 1) {
@time_sleep_until(microtime(true) + (float) $interval);

View file

@ -14,7 +14,7 @@ use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Lib\LibBlock;
use Zotlabs\Lib\Activity;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
class Libzot {
@ -379,7 +379,7 @@ class Libzot {
else {
// if we were just granted read stream permission and didn't have it before, try to pull in some posts
if ((! $old_read_stream_perm) && (intval($permissions['view_stream'])))
Master::Summon([ 'Onepoll', $r[0]['abook_id'] ]);
Run::Summon([ 'Onepoll', $r[0]['abook_id'] ]);
}
}
else {
@ -468,7 +468,7 @@ class Libzot {
if ($new_connection) {
if (! Permissions::PermsCompare($new_perms,$previous_perms)) {
Master::Summon([ 'Notifier', 'permissions_create', $new_connection[0]['abook_id'] ]);
Run::Summon([ 'Notifier', 'permissions_create', $new_connection[0]['abook_id'] ]);
}
if (! $is_collection) {
@ -485,7 +485,7 @@ class Libzot {
if (intval($permissions['view_stream'])) {
if (intval(get_pconfig($channel['channel_id'],'perm_limits','send_stream') & PERMS_PENDING)
|| (! intval($new_connection[0]['abook_pending'])))
Master::Summon([ 'Onepoll', $new_connection[0]['abook_id'] ]);
Run::Summon([ 'Onepoll', $new_connection[0]['abook_id'] ]);
}
@ -1954,7 +1954,7 @@ class Libzot {
if ($relay && $item_id) {
logger('process_delivery: invoking relay');
Master::Summon([ 'Notifier', 'relay', intval($item_id) ]);
Run::Summon([ 'Notifier', 'relay', intval($item_id) ]);
$DR->update('relayed');
$result[] = $DR->get();
}
@ -2073,7 +2073,7 @@ class Libzot {
if ($relay && $item_id) {
logger('Invoking relay');
Master::Summon([ 'Notifier', 'relay', intval($item_id) ]);
Run::Summon([ 'Notifier', 'relay', intval($item_id) ]);
$DR->addto_update('relayed');
$result[] = $DR->get();
}

View file

@ -3,7 +3,7 @@
namespace Zotlabs\Module\Admin;
use App;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
/**
* @brief Admin Module for Channels.
@ -30,7 +30,7 @@ class Channels {
intval(PAGE_CENSORED),
intval( $uid )
);
Master::Summon( [ 'Directory', $uid, 'nopush' ] );
Run::Summon( [ 'Directory', $uid, 'nopush' ] );
}
notice( sprintf( tt("%s channel censored/uncensored", "%s channels censored/uncensored", count($channels)), count($channels)) );
}
@ -86,7 +86,7 @@ class Channels {
intval($pflags),
intval( $uid )
);
Master::Summon( [ 'Directory', $uid, 'nopush' ]);
Run::Summon( [ 'Directory', $uid, 'nopush' ]);
notice( sprintf( (($pflags & PAGE_CENSORED) ? t("Channel '%s' censored"): t("Channel '%s' uncensored")) , $channel[0]['channel_name'] . ' (' . $channel[0]['channel_address'] . ')' ) . EOL);
}; break;

View file

@ -6,7 +6,7 @@ use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libsync;
use Zotlabs\Access\AccessControl;
use Zotlabs\Lib\Apps;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/conversation.php');
@ -230,7 +230,7 @@ class Calendar extends Controller {
}
}
Master::Summon( [ 'Notifier', 'event', $item_id ] );
Run::Summon( [ 'Notifier', 'event', $item_id ] );
killme();
}

View file

@ -4,7 +4,7 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\Libprofile;
@ -41,7 +41,7 @@ class Connect extends Controller {
intval(local_channel())
);
Master::Summon(array('Notifier','refresh_all',App::$data['channel']['channel_id']));
Run::Summon(array('Notifier','refresh_all',App::$data['channel']['channel_id']));
}
set_pconfig(App::$data['channel']['channel_id'],'system','selltext',$text);
// reload the page completely to get fresh data

View file

@ -12,7 +12,7 @@ use Zotlabs\Lib\LibBlock;
use Zotlabs\Access\Permissions;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Lib\Permcat;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Web\HTTPHeaders;
use Sabre\VObject\Reader;
@ -198,10 +198,10 @@ class Connedit extends Controller {
if (! intval(App::$poi['abook_self'])) {
if ($new_friend) {
Master::Summon( [ 'Notifier', 'permissions_accept', $contact_id ] );
Run::Summon( [ 'Notifier', 'permissions_accept', $contact_id ] );
}
Master::Summon( [
Run::Summon( [
'Notifier',
(($new_friend) ? 'permissions_create' : 'permissions_update'),
$contact_id
@ -246,7 +246,7 @@ class Connedit extends Controller {
}
// pull in a bit of content if there is any to pull in
Master::Summon( [ 'Onepoll', $contact_id ]);
Run::Summon( [ 'Onepoll', $contact_id ]);
}
// Refresh the structure in memory with the new data
@ -370,7 +370,7 @@ class Connedit extends Controller {
if ($cmd === 'update') {
// pull feed and consume it, which should subscribe to the hub.
Master::Summon( [ 'Poller', $contact_id ]);
Run::Summon( [ 'Poller', $contact_id ]);
goaway(z_root() . '/connedit/' . $contact_id);
}
@ -416,7 +416,7 @@ class Connedit extends Controller {
}
else {
// if they are on a different network we'll force a refresh of the connection basic info
Master::Summon( [ 'Notifier', 'permissions_update', $contact_id ]);
Run::Summon( [ 'Notifier', 'permissions_update', $contact_id ]);
}
goaway(z_root() . '/connedit/' . $contact_id);
}
@ -488,7 +488,7 @@ class Connedit extends Controller {
// The purge notification is sent to the xchan_hash as the abook record will have just been removed
Master::Summon( [ 'Notifier' , 'purge', $orig_record['xchan_hash'] ] );
Run::Summon( [ 'Notifier' , 'purge', $orig_record['xchan_hash'] ] );
Libsync::build_sync_packet(0, [ 'abook' => [ 'abook_xchan' => $orig_record['abook_xchan'], 'entry_deleted' => true ] ] );

View file

@ -36,7 +36,7 @@ class Dreport extends \Zotlabs\Web\Controller {
dbesc($channel['channel_hash'])
);
if($i) {
\Zotlabs\Daemon\Master::Summon([ 'Notifier', 'edit_post', $i[0]['id'] ]);
\Zotlabs\Daemon\Run::Summon([ 'Notifier', 'edit_post', $i[0]['id'] ]);
}
}
sleep(3);

View file

@ -6,7 +6,7 @@ use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Apps;
use Zotlabs\Access\AccessControl;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/conversation.php');
require_once('include/bbcode.php');
@ -262,7 +262,7 @@ class Events extends Controller {
}
if($share)
Master::Summon(array('Notifier','event',$item_id));
Run::Summon(array('Notifier','event',$item_id));
}

View file

@ -10,7 +10,7 @@ use Zotlabs\Lib\Libzot;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\LDSignatures;
use Zotlabs\Lib\Connect;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
class Follow extends Controller {
@ -163,7 +163,7 @@ class Follow extends Controller {
// If we can view their stream, pull in some posts
if (($can_view_stream) || ($result['abook']['xchan_network'] === 'rss')) {
Master::Summon([ 'Onepoll', $result['abook']['abook_id'] ]);
Run::Summon([ 'Onepoll', $result['abook']['abook_id'] ]);
}
if ($interactive) {

View file

@ -7,7 +7,7 @@ use URLify;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Connect;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/import.php');
require_once('include/photo_factory.php');
@ -526,11 +526,11 @@ class Import extends Controller {
// send out refresh requests
// notify old server that it may no longer be primary.
Master::Summon( [ 'Notifier','refresh_all',$channel['channel_id'] ] );
Run::Summon( [ 'Notifier','refresh_all',$channel['channel_id'] ] );
// This will indirectly perform a refresh_all *and* update the directory
Master::Summon( [ 'Directory', $channel['channel_id'] ] );
Run::Summon( [ 'Directory', $channel['channel_id'] ] );
notice( t('Import completed.') . EOL);

View file

@ -1386,7 +1386,7 @@ class Item extends Controller {
}
}
if(! $nopush)
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'edit_post', $post_id));
\Zotlabs\Daemon\Run::Summon(array('Notifier', 'edit_post', $post_id));
if($api_source)
@ -1505,7 +1505,7 @@ class Item extends Controller {
}
if(! $nopush) {
\Zotlabs\Daemon\Master::Summon(array('Notifier', $notify_type, $post_id));
\Zotlabs\Daemon\Run::Summon(array('Notifier', $notify_type, $post_id));
}
logger('post_complete');

View file

@ -5,7 +5,7 @@ use App;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Activity;
use Zotlabs\Web\Controller;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/security.php');
require_once('include/bbcode.php');
@ -321,7 +321,7 @@ class Like extends Controller {
// drop_item was not done interactively, so we need to invoke the notifier
// in order to push the changes to connections
Master::Summon(array('Notifier','drop',$rr['id']));
Run::Summon(array('Notifier','drop',$rr['id']));
}
@ -384,7 +384,7 @@ class Like extends Controller {
Libsync::build_sync_packet($ch[0]['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
}
Master::Summon(array('Notifier','wall-new',$item['id']));
Run::Summon(array('Notifier','wall-new',$item['id']));
}
}
@ -517,7 +517,7 @@ class Like extends Controller {
}
\Zotlabs\Daemon\Master::Summon(array('Notifier','like',$post_id));
\Zotlabs\Daemon\Run::Summon(array('Notifier','like',$post_id));
killme();
}

View file

@ -3,7 +3,7 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
class Locs extends Controller {
@ -37,7 +37,7 @@ class Locs extends Controller {
dbesc($channel['channel_hash'])
);
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
Run::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
return;
}
}
@ -75,7 +75,7 @@ class Locs extends Controller {
intval($hubloc_id),
dbesc($channel['channel_hash'])
);
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
Run::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
return;
}
}
@ -94,7 +94,7 @@ class Locs extends Controller {
$channel = App::get_channel();
if($_REQUEST['sync']) {
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
Run::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
info( t('Pushing location info') . EOL);
goaway(z_root() . '/locs');
}

View file

@ -88,7 +88,7 @@ class Moderate extends \Zotlabs\Web\Controller {
Libsync::build_sync_packet(local_channel(),array('item' => array(encode_item($sync_item[0],true))));
}
if($action === 'approve') {
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'comment-new', $post_id));
\Zotlabs\Daemon\Run::Summon(array('Notifier', 'comment-new', $post_id));
}
goaway(z_root() . '/moderate');
}

View file

@ -105,7 +105,7 @@ class Mood extends Controller {
$item_id = $post['item_id'];
if($item_id) {
\Zotlabs\Daemon\Master::Summon(array('Notifier','activity', $item_id));
\Zotlabs\Daemon\Run::Summon(array('Notifier','activity', $item_id));
}
call_hooks('post_local_end', $arr);

View file

@ -8,7 +8,7 @@ use Zotlabs\Lib\Libprofile;
use Zotlabs\Lib\PermissionDescription;
use Zotlabs\Web\Controller;
use Zotlabs\Access\AccessControl;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/photo_factory.php');
require_once('include/photos.php');
@ -433,7 +433,7 @@ class Photos extends Controller {
}
if($visibility) {
Master::Summon(array('Notifier','edit_post',$item_id));
Run::Summon(array('Notifier','edit_post',$item_id));
}
$sync = attach_export_data(App::$data['channel'],$resource_id);

View file

@ -11,7 +11,7 @@ use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Libprofile;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/photo_factory.php');
@ -216,7 +216,7 @@ class Profile_photo extends Controller {
info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
// Update directory in background
Master::Summon( [ 'Directory', $channel['channel_id'] ] );
Run::Summon( [ 'Directory', $channel['channel_id'] ] );
}
else {
@ -418,7 +418,7 @@ class Profile_photo extends Controller {
Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
}
Master::Summon( [ 'Directory',local_channel() ] );
Run::Summon( [ 'Directory',local_channel() ] );
goaway(z_root() . '/profiles');
}

View file

@ -5,7 +5,7 @@ use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Libprofile;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Sabre\VObject\Reader;
@ -613,7 +613,7 @@ class Profiles extends Controller {
}
if($is_default) {
Master::Summon(array('Directory',local_channel()));
Run::Summon(array('Directory',local_channel()));
goaway(z_root() . '/profiles/' . $sync[0]['id']);
}
}
@ -920,7 +920,7 @@ class Profiles extends Controller {
if($i) {
// FIXME - limit delivery in notifier.php to those specificed in the perms argument
Zotlabs\Daemon\Master::Summon(array('Notifier','activity', $i, 'PERMS_R_PROFILE'));
Zotlabs\Daemon\Run::Summon(array('Notifier','activity', $i, 'PERMS_R_PROFILE'));
}
}

View file

@ -4,7 +4,7 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Activity;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
@ -81,7 +81,7 @@ class React extends Controller {
if($x['success']) {
$nid = $x['item_id'];
Master::Summon( [ 'Notifier', 'like', $nid ] );
Run::Summon( [ 'Notifier', 'like', $nid ] );
}
}

View file

@ -9,7 +9,7 @@ use Zotlabs\Access\Permissions;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\AccessControl;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\Permcat;
class Channel {
@ -335,7 +335,7 @@ class Channel {
);
}
Master::Summon( [ 'Directory', local_channel() ] );
Run::Summon( [ 'Directory', local_channel() ] );
Libsync::build_sync_packet();

View file

@ -2,7 +2,7 @@
namespace Zotlabs\Module;
use App;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\Libsync;
require_once('include/security.php');
@ -126,7 +126,7 @@ class Share extends \Zotlabs\Web\Controller {
Libsync::build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
}
Master::Summon([ 'Notifier','like',$post_id ]);
Run::Summon([ 'Notifier','like',$post_id ]);
killme();

View file

@ -4,7 +4,7 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Activity;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\Libsync;
class Vote extends Controller {
@ -113,7 +113,7 @@ class Vote extends Controller {
if($x['success']) {
$itemid = $x['item_id'];
Master::Summon( [ 'Notifier', 'like', $itemid ] );
Run::Summon( [ 'Notifier', 'like', $itemid ] );
}
$r = q("select * from item where id = %d",

View file

@ -5,7 +5,7 @@ namespace Zotlabs\Storage;
use App;
use Sabre\DAV;
use Zotlabs\Lib\Libsync;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/photos.php');
@ -384,7 +384,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
$p = photo_upload($channel, App::get_observer(), $args);
}
Master::Summon([ 'Thumbnail' , $hash ]);
Run::Summon([ 'Thumbnail' , $hash ]);
$sync = attach_export_data($channel, $hash);

View file

@ -5,7 +5,7 @@ namespace Zotlabs\Storage;
use App;
use Sabre\DAV;
use Zotlabs\Lib\Libsync;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/photos.php');
@ -297,7 +297,7 @@ class File extends DAV\Node implements DAV\IFile {
}
}
Master::Summon([ 'Thumbnail' , $this->data['hash'] ]);
Run::Summon([ 'Thumbnail' , $this->data['hash'] ]);
$sync = attach_export_data($channel,$this->data['hash']);

View file

@ -8,7 +8,7 @@ use Zotlabs\Render\Comanche;
use Zotlabs\Render\Theme;
use Zotlabs\Lib\DB_Upgrade;
use Zotlabs\Lib\System;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
/**
* @file boot.php
@ -1540,7 +1540,7 @@ function fix_system_urls($oldurl, $newurl) {
}
}
Master::Summon( [ 'Notifier', 'refresh_all', $c[0]['channel_id'] ]);
Run::Summon( [ 'Notifier', 'refresh_all', $c[0]['channel_id'] ]);
}
}
@ -2467,7 +2467,7 @@ function check_cron_broken() {
$d = get_config('system','lastcron');
if((! $d) || ($d < datetime_convert('UTC','UTC','now - 4 hours'))) {
Master::Summon(array('Cron'));
Run::Summon(array('Cron'));
set_config('system','lastcron',datetime_convert());
}

View file

@ -1015,7 +1015,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
call_hooks('photo_upload_end', $ret);
}
\Zotlabs\Daemon\Master::Summon([ 'Thumbnail' , $hash ]);
\Zotlabs\Daemon\Run::Summon([ 'Thumbnail' , $hash ]);
if($dosync) {

View file

@ -13,7 +13,7 @@ use Zotlabs\Lib\Connect;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
use Zotlabs\Lib\System;
use Zotlabs\Render\Comanche;
@ -489,7 +489,7 @@ function create_identity($arr) {
// If we can view their stream, pull in some posts
if(($can_view_stream) || ($f['abook']['xchan_network'] === 'rss')) {
Master::Summon([ 'Onepoll',$f['abook']['abook_id'] ]);
Run::Summon([ 'Onepoll',$f['abook']['abook_id'] ]);
}
}
}
@ -505,7 +505,7 @@ function create_identity($arr) {
call_hooks('create_identity', $newuid);
Master::Summon(array('Directory', $ret['channel']['channel_id']));
Run::Summon(array('Directory', $ret['channel']['channel_id']));
}
$ret['success'] = true;
@ -637,7 +637,7 @@ function change_channel_keys($channel) {
xchan_change_key($oldxchan,$newxchan,$stored);
Master::Summon([ 'Notifier', 'keychange', $channel['channel_id'] ]);
Run::Summon([ 'Notifier', 'keychange', $channel['channel_id'] ]);
$ret['success'] = true;
return $ret;
@ -720,7 +720,7 @@ function channel_change_address($channel,$new_address) {
}
}
Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
Run::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
$ret['success'] = true;
return $ret;
@ -1292,7 +1292,7 @@ function zid_init() {
dbesc($tmp_str)
);
if(! $r) {
Master::Summon(array('Gprobe',bin2hex($tmp_str)));
Run::Summon(array('Gprobe',bin2hex($tmp_str)));
}
if($r && remote_channel() && remote_channel() === $r[0]['hubloc_hash'])
return;
@ -2246,7 +2246,7 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
dbesc($channel['channel_hash'])
);
// send a cleanup message to other servers
Master::Summon( [ 'Notifier', 'purge_all', $channel_id ] );
Run::Summon( [ 'Notifier', 'purge_all', $channel_id ] );
}
//remove from file system
@ -2257,7 +2257,7 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
@rrmdir($f);
}
Master::Summon([ 'Directory', $channel_id ]);
Run::Summon([ 'Directory', $channel_id ]);
if ($channel_id == local_channel() && $unset_session) {
App::$session->nuke();

View file

@ -1,6 +1,6 @@
<?php /** @file */
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
function abook_store_lowlevel($arr) {
@ -409,7 +409,7 @@ function contact_remove($channel_id, $abook_id) {
// remove items in the background as this can take some time
Master::Summon( [ 'Delxitems', $channel_id, $abook['abook_xchan'] ] );
Run::Summon( [ 'Delxitems', $channel_id, $abook['abook_xchan'] ] );
$r = q("delete from abook where abook_id = %d and abook_channel = %d",

View file

@ -163,7 +163,7 @@ function remove_obsolete_hublocs() {
dbesc($rr['hubloc_hash'])
);
if($x) {
Zotlabs\Daemon\Master::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id']));
Zotlabs\Daemon\Run::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}

View file

@ -6,7 +6,7 @@ use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Connect;
use Zotlabs\Lib\LibBlock;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
require_once('include/menu.php');
@ -902,7 +902,7 @@ function import_items($channel, $items, $sync = false, $relocate = null) {
if ($sync && $item['item_wall']) {
// deliver singletons if we have any
if ($item_result && $item_result['success']) {
Master::Summon( [ 'Notifier','single_activity',$item_result['item_id'] ]);
Run::Summon( [ 'Notifier','single_activity',$item_result['item_id'] ]);
}
}
}
@ -1284,7 +1284,7 @@ function import_mail($channel, $mails, $sync = false) {
$mail_id = mail_store($m);
if ($sync && $mail_id) {
// Not applicable to Zap which does not federate with singletons
// Master::Summon(array('Notifier','single_mail',$mail_id));
// Run::Summon(array('Notifier','single_mail',$mail_id));
}
}
}
@ -1641,7 +1641,7 @@ function sync_files($channel, $files) {
}
}
Master::Summon([ 'Thumbnail' , $att['hash'] ]);
Run::Summon([ 'Thumbnail' , $att['hash'] ]);
if ($f['item']) {
sync_items($channel,$f['item'],

View file

@ -22,7 +22,7 @@ use Zotlabs\Lib\ThreadListener;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\AccessControl;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
@ -483,7 +483,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) {
}
if($post_id && $deliver) {
Master::Summon([ 'Notifier','activity',$post_id ]);
Run::Summon([ 'Notifier','activity',$post_id ]);
}
$ret['success'] = true;
@ -1920,7 +1920,7 @@ function item_store($arr, $allow_exec = false, $deliver = true, $linkid = true)
item_update_parent_commented($arr);
if((strpos($arr['body'],'[embed]') !== false) || (strpos($arr['body'],'[/img]') !== false) || (strpos($arr['body'],'[/zmg]') !== false)) {
Master::Summon([ 'Cache_embeds', $current_post ]);
Run::Summon([ 'Cache_embeds', $current_post ]);
}
// If _creating_ a deleted item, don't propagate it further or send out notifications.
@ -2250,7 +2250,7 @@ function item_store_update($arr, $allow_exec = false, $deliver = true, $linkid =
if((strpos($arr['body'],'[embed]') !== false) || (strpos($arr['body'],'[/img]') !== false)) {
Master::Summon([ 'Cache_embeds', $orig_post_id ]);
Run::Summon([ 'Cache_embeds', $orig_post_id ]);
}
if($deliver) {
@ -2901,7 +2901,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false)
$post_id = $post['item_id'];
if($post_id) {
Master::Summon([ 'Notifier','tgroup',$post_id ]);
Run::Summon([ 'Notifier','tgroup',$post_id ]);
}
return;
}
@ -2963,7 +2963,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false)
);
if($r)
Master::Summon([ 'Notifier','tgroup',$item_id ]);
Run::Summon([ 'Notifier','tgroup',$item_id ]);
else {
logger('start_delivery_chain: failed to update item');
// reset the source xchan to prevent loops
@ -3337,7 +3337,7 @@ function drop_items($items,$interactive = false,$stage = DROPITEM_NORMAL,$force
// multiple threads may have been deleted, send an expire notification
if($uid) {
Master::Summon([ 'Notifier','expire',$uid ]);
Run::Summon([ 'Notifier','expire',$uid ]);
}
}
@ -3453,7 +3453,7 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal
// set if we know we're going to send delete notifications out to others.
if((intval($item['item_wall']) && ($stage != DROPITEM_PHASE2)) || ($stage == DROPITEM_PHASE1)) {
Master::Summon([ 'Notifier','drop',$notify_id ]);
Run::Summon([ 'Notifier','drop',$notify_id ]);
}
goaway(z_root() . '/' . $_SESSION['return_url']);
@ -4568,7 +4568,7 @@ function item_create_edit_activity($post) {
}
}
Master::Summon([ 'Notifier', 'edit_activity', $post_id ]);
Run::Summon([ 'Notifier', 'edit_activity', $post_id ]);
}
/**

View file

@ -9,8 +9,8 @@ use Zotlabs\Lib\ActivityPub;
use Zotlabs\Lib\Queue;
use Zotlabs\Lib\System;
use Zotlabs\Lib\Keyutils;
use Zotlabs\Daemon\Master;
use Masterminds\HTML5;
use Zotlabs\Daemon\Run;
use Runminds\HTML5;
/**
* @file include/network.php
@ -1080,7 +1080,7 @@ function do_delivery($deliveries, $force = false) {
$deliver[] = $d;
if(count($deliver) >= $deliveries_per_process) {
Master::Summon(array('Deliver',$deliver));
Run::Summon(array('Deliver',$deliver));
$deliver = array();
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
@ -1090,7 +1090,7 @@ function do_delivery($deliveries, $force = false) {
// catch any stragglers
if($deliver) {
Master::Summon(array('Deliver',$deliver));
Run::Summon(array('Deliver',$deliver));
}
}

View file

@ -530,7 +530,7 @@ function photo_upload($channel, $observer, $args) {
$item_id = $result['item_id'];
if($visible && $deliver)
Zotlabs\Daemon\Master::Summon(array('Notifier', 'wall-new', $item_id));
Zotlabs\Daemon\Run::Summon(array('Notifier', 'wall-new', $item_id));
}
$ret['success'] = true;

View file

@ -204,14 +204,14 @@ using web forms.
8. Set up a cron job or scheduled task to run the Cron manager once every 10-15
minutes to perform background processing and maintenance. Example:
cd /base/directory; /path/to/php Zotlabs/Daemon/Master.php Cron
cd /base/directory; /path/to/php Zotlabs/Daemon/Run.php Cron
Change "/base/directory", and "/path/to/php" as appropriate for your situation.
If you are using a Linux server, run "crontab -e" and add a line like the
one shown, substituting for your unique paths and settings:
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php Zotlabs/Daemon/Master.php Cron > /dev/null 2>&1
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php Zotlabs/Daemon/Run.php Cron > /dev/null 2>&1
You can generally find the location of PHP by executing "which php". If you
have troubles with this section please contact your hosting provider for

View file

@ -5,7 +5,7 @@
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Connect;
use Zotlabs\Daemon\Master;
use Zotlabs\Daemon\Run;
if(! file_exists('include/cli_startup.php')) {
echo t('Run from the top level $Projectname web directory, as util/connect <args>') . PHP_EOL;
@ -61,7 +61,7 @@ cli_startup();
// If we can view their stream, pull in some posts
if(($can_view_stream) || ($result['abook']['xchan_network'] === 'rss')) {
Master::Summon([ 'Onepoll',$result['abook']['abook_id'] ]);
Run::Summon([ 'Onepoll',$result['abook']['abook_id'] ]);
}
exit(0);

View file

@ -106,7 +106,7 @@ if($argc < 3) {
else {
$dstname = (($isadir) ? '' : basename($dstfile));
$cmd = [ 'Importfile', $channel['channel_id'], $argv[$x], $folder, $dstname ];
\Zotlabs\Daemon\Master::Summon($cmd);
\Zotlabs\Daemon\Run::Summon($cmd);
}
}
@ -147,7 +147,7 @@ if($argc < 3) {
}
else {
$cmd = [ 'Importfile', $channel['channel_id'], $src . '/' . $entry, $folder ];
\Zotlabs\Daemon\Master::Summon($cmd);
\Zotlabs\Daemon\Run::Summon($cmd);
}
}
closedir($dir);

View file

@ -91,7 +91,7 @@ App::$config['system']['php_path'] = '{{$phpath}}';
// Configure how we communicate with directory servers.
// DIRECTORY_MODE_NORMAL = directory client, we will find a directory
// DIRECTORY_MODE_SECONDARY = caching directory or mirror
// DIRECTORY_MODE_PRIMARY = master directory server - one per realm
// DIRECTORY_MODE_PRIMARY = main directory server - one per realm
// DIRECTORY_MODE_STANDALONE = "off the grid" or private directory services
App::$config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL;