streams/Zotlabs/Daemon
2022-01-24 17:26:12 -08:00
..
Addon.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Cache_embeds.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Cache_image.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
CacheThumb.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Channel_purge.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Checksites.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Content_importer.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Convo.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Cron.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Cron_daily.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Cron_weekly.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Cronhooks.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
CurlAuth.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Deliver.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Deliver_hooks.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Delxitems.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Directory.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Expire.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
File_importer.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Gprobe.php Merge branch 'dev' of /home/macgirvin/roadhouse into dev 2021-12-06 13:19:19 -08:00
Importdoc.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Importfile.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Notifier.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Onedirsync.php Merge branch 'dev' of /home/macgirvin/roadhouse into dev 2021-12-06 13:19:19 -08:00
Onepoll.php Merge branch 'dev' of /home/macgirvin/roadhouse into dev 2021-12-06 13:19:19 -08:00
Poller.php move account and channel to zlib 2022-01-24 17:26:12 -08:00
Queue.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
README.md Deprecate the term 'master' from the codebase. 2020-06-15 00:29:56 -07:00
Run.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Thumbnail.php psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
Xchan_photo.php psr12 rewrites, continued 2021-12-03 14:01:39 +11: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\Run::Summon([ $cmd, $arg1, $argn... ]); 

The Run 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 Run 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.