aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Master.php
blob: a78e7c590c74ee9e74184c44d894231a402e20f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)
		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();
		logger('Master: release: ' . print_r($argv,true));
		require_once('Zotlabs/Daemon/' . $argv[0] . '.php');
		$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
		$cls::run($argc,$argv);
	}	
}