diff options
author | Max Kostikov <max@kostikov.co> | 2021-01-20 13:15:40 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2021-01-20 13:15:40 +0100 |
commit | 9612a69a6448331ae3296503e97ef6ce204d9be1 (patch) | |
tree | afae1ea1fa8c63db4c23836e0ebfe57b56b808ec /Zotlabs/Daemon/Master.php | |
parent | 308e94ea799b7851287fbc7635480ac13bfe3c61 (diff) | |
parent | 08264f8d11d349bbda92233d984ad52c16c6b2d6 (diff) | |
download | volse-hubzilla-9612a69a6448331ae3296503e97ef6ce204d9be1.tar.gz volse-hubzilla-9612a69a6448331ae3296503e97ef6ce204d9be1.tar.bz2 volse-hubzilla-9612a69a6448331ae3296503e97ef6ce204d9be1.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!1
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); } } |