aboutsummaryrefslogblamecommitdiffstats
path: root/Zotlabs/Daemon/Master.php
blob: 3d21a68e0e224a58e5f47ba9810229a29de5c0e0 (plain) (tree)





























                                                                    
<?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);
	}	
}