streams/Zotlabs/Daemon
2018-09-19 16:26:36 -07:00
..
Addon.php move libzot to class 2018-05-31 19:42:13 -07:00
Checksites.php move libzot to class 2018-05-31 19:42:13 -07:00
Cli_suggest.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Cron.php Merge branch 'red' into dev 2018-09-18 20:51:38 -07:00
Cron_daily.php namespace/use swapped, merge conflict 2018-07-15 19:22:15 -07:00
Cron_weekly.php improve removed_channel final cleanup. Hubzilla issue #386 2017-11-12 21:37:06 -08:00
Cronhooks.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
CurlAuth.php still working through some issues with curl magic-auth 2016-06-27 22:25:37 -07:00
Deliver.php move queue functions to Zotlabs/Lib 2018-07-02 22:43:41 -07:00
Deliver_hooks.php move libzot to class 2018-05-31 19:42:13 -07:00
Directory.php directory packets need to be signed 2018-07-31 19:09:42 -07:00
Expire.php last commented expiration setting in admin 2018-04-10 00:05:20 -07:00
Externals.php move libzot to class 2018-05-31 19:42:13 -07:00
Gprobe.php typo 2018-08-27 19:09:48 -07:00
Importdoc.php only store search info for text filetypes when updating the documentation indexes 2017-05-24 22:34:52 -07:00
Importfile.php split off libsync from libzot 2018-06-04 18:40:11 -07:00
Master.php [FEATURE] Add config and use composer autoloader. 2016-10-18 18:11:41 +02:00
Notifier.php Merge branch 'zap' into dev 2018-09-11 17:41:22 -07:00
Onedirsync.php consolidate directory functions into libzotdir 2018-06-04 23:19:16 -07:00
Onepoll.php old protocol string still showing 2018-09-13 22:39:05 -07:00
Poller.php old protocol string still showing 2018-09-13 22:39:05 -07:00
Queue.php move queue functions to Zotlabs/Lib 2018-07-02 22:43:41 -07:00
README.md document the daemon classes 2016-06-26 21:58:09 -07:00
Thumbnail.php add thumbnail hook 2017-11-21 17:56:23 -08:00
Xchan_photo.php set a process timeout for fetching remote xchan photos 2018-09-06 18:33:27 -07:00

Daemon (background) Processes

This directory provides background tasks which are executed by a command-line process and detached from normal web processing.

Background tasks are invoked by calling

Zotlabs\Daemon\Master::Summon([ $cmd, $arg1, $argn... ]); 

The Master class loads the desired command file and passes the arguments.

To create a background task 'Foo' use the following template.

<?php

namespace Zotlabs\Daemon;

class Foo {

	static public function run($argc,$argv) {
		// do something
	}
}

The Master class "summons" the command by creating an executable script from the provided arguments, then it invokes "Release" to execute the script detached from web processing. This process calls the static::run() function with any command line arguments using the traditional argc, argv format.

Please note: These are real $argc, $argv variables passed from the command line, and not the parsed argc() and argv() functions/variables which were obtained from parsing path components of the request URL by web processes.

Background processes do not emit displayable output except through logs. They should also not make any assumptions about their HTML and web environment (as they do not have a web environment), particularly with respect to global variables such as $_SERVER, $_REQUEST, $_GET, $_POST, $_COOKIES, and $_SESSION.