streams/Zotlabs/Daemon
2019-10-11 16:45:04 -07:00
..
Addon.php move libzot to class 2018-05-31 19:42:13 -07:00
Cache_embeds.php cache embeds on storage 2019-01-29 15:18:35 -08: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 Return in case caller needs to process further. 2019-08-19 22:35:17 -04:00
Cron_daily.php detect comment moderation with even more precision 2019-03-28 16:41:06 -07:00
Cron_weekly.php cleanup 2019-05-27 20:50:05 -07:00
Cronhooks.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
CurlAuth.php Return in case caller needs to process further. 2019-08-19 22:35:17 -04: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
Delxitems.php Return in case caller needs to process further. 2019-08-19 22:35:17 -04:00
Directory.php more photo object work 2018-10-28 21:01:58 -07:00
Expire.php rewrites - also remove legacy procedural module interface 2019-09-29 22:36:52 -07:00
Externals.php cleanup 2019-07-25 17:12:48 -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 Return in case caller needs to process further. 2019-08-19 22:35:17 -04:00
Notifier.php groups 2019-10-11 16:45:04 -07:00
Onedirsync.php consolidate directory functions into libzotdir 2018-06-04 23:19:16 -07:00
Onepoll.php improved notification links for new connections, ongoing work on onepoll and zotfeeds, reduce core usage of item.postopts 2019-08-27 22:25:06 -07:00
Poller.php Return in case caller needs to process further. 2019-08-19 22:35:17 -04:00
Queue.php regression in latest queue work 2019-02-03 11:21:25 -08: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.