diff options
author | mjfriaza <mjfriaza@noreply.codeberg.org> | 2021-02-18 13:28:05 +0100 |
---|---|---|
committer | mjfriaza <mjfriaza@noreply.codeberg.org> | 2021-02-18 13:28:05 +0100 |
commit | 655ae9d1cdaa940bb7861eb34f4f489a636879b2 (patch) | |
tree | 0a10c3d602f5da23dca56ac1360c3ee98282e079 /Zotlabs/Daemon/Master.php | |
parent | 76163fc37b76570e158ab32d53a1c0e0cc298bad (diff) | |
parent | 08c9152abdfa90da09931bdcc6e6c81ea243434c (diff) | |
download | volse-hubzilla-655ae9d1cdaa940bb7861eb34f4f489a636879b2.tar.gz volse-hubzilla-655ae9d1cdaa940bb7861eb34f4f489a636879b2.tar.bz2 volse-hubzilla-655ae9d1cdaa940bb7861eb34f4f489a636879b2.zip |
Merge branch 'dev' into dev
Diffstat (limited to 'Zotlabs/Daemon/Master.php')
-rw-r--r-- | Zotlabs/Daemon/Master.php | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 8c3a7e570..6fa656be5 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -2,58 +2,57 @@ namespace Zotlabs\Daemon; -if(array_search( __file__ , get_included_files()) === 0) { +if (array_search(__file__, get_included_files()) === 0) { require_once('include/cli_startup.php'); array_shift($argv); $argc = count($argv); - if($argc) - Master::Release($argc,$argv); + if ($argc) + Master::Release($argc, $argv); return; } - class Master { static public function Summon($arr) { $hookinfo = [ - 'argv'=>$arr + 'argv' => $arr ]; - call_hooks ('daemon_master_summon',$hookinfo); + call_hooks('daemon_master_summon', $hookinfo); - $arr = $hookinfo['argv']; + $arr = $hookinfo['argv']; $argc = count($arr); - if ((!is_array($arr) || (count($arr) < 1))) { - logger("Summon handled by hook.",LOGGER_DEBUG); + if ((!is_array($arr) || ($argc < 1))) { + logger("Summon handled by hook.", LOGGER_DEBUG); return; } - $phpbin = get_config('system','phpbin','php'); - proc_run($phpbin,'Zotlabs/Daemon/Master.php',$arr); + $phpbin = get_config('system', 'phpbin', 'php'); + proc_run($phpbin, 'Zotlabs/Daemon/Master.php', $arr); } - static public function Release($argc,$argv) { + static public function Release($argc, $argv) { cli_startup(); $hookinfo = [ - 'argv'=>$argv + 'argv' => $argv ]; - call_hooks ('daemon_master_release',$hookinfo); + call_hooks('daemon_master_release', $hookinfo); $argv = $hookinfo['argv']; $argc = count($argv); - if ((!is_array($argv) || (count($argv) < 1))) { - logger("Release handled by hook.",LOGGER_DEBUG); + if ((!is_array($argv) || ($argc < 1))) { + logger("Release handled by hook.", LOGGER_DEBUG); return; } - logger('Master: release: ' . json_encode($argv), LOGGER_ALL,LOG_DEBUG); - $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; - $cls::run($argc,$argv); + logger('Master: release: ' . json_encode($argv), LOGGER_ALL, LOG_DEBUG); + $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; + $cls::run($argc, $argv); } } |