aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Master.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-19 19:42:45 -0700
committerredmatrix <git@macgirvin.com>2016-05-19 19:42:45 -0700
commit5b2474238eb0d257db14b0668ef25eab92e53fea (patch)
tree30518577199eeb91e902ed1f3b39401268eece6c /Zotlabs/Daemon/Master.php
parent6e7d7c50174ffe3db78c5318dde0d9b0b1f416b8 (diff)
downloadvolse-hubzilla-5b2474238eb0d257db14b0668ef25eab92e53fea.tar.gz
volse-hubzilla-5b2474238eb0d257db14b0668ef25eab92e53fea.tar.bz2
volse-hubzilla-5b2474238eb0d257db14b0668ef25eab92e53fea.zip
first phase of daemon refactoring
Diffstat (limited to 'Zotlabs/Daemon/Master.php')
-rw-r--r--Zotlabs/Daemon/Master.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php
new file mode 100644
index 000000000..3d21a68e0
--- /dev/null
+++ b/Zotlabs/Daemon/Master.php
@@ -0,0 +1,30 @@
+<?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)
+ Master::Release($argc,$argv);
+ killme();
+}
+
+
+
+class Master {
+
+ static public function Summon($arr) {
+ proc_run('php','Zotlabs/Daemon/Master.php',$arr);
+ }
+
+ static public function Release($argc,$argv) {
+ cli_startup();
+ require_once('Zotlabs/Daemon/' . $argv[0] . '.php');
+ $cls = '\\Zotlabs\\Daemon\\' . $argv[0];
+ $cls::run($argc,$argv);
+ }
+} \ No newline at end of file