streams/Code/Daemon
2023-01-01 07:02:03 +11:00
..
Addon.php Add daemon interface 2022-11-27 18:05:33 +11:00
Cache_embeds.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Cache_image.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
CacheThumb.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Channel_purge.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Checksites.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Content_importer.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Convo.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Cron.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Cron_daily.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Cron_weekly.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Cronhooks.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
DaemonInterface.php Add daemon interface 2022-11-27 18:05:33 +11:00
Deliver.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Deliver_hooks.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Delxitems.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Directory.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Expire.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
File_importer.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Gprobe.php fix a few more places where hubloc_addr confusion can potentially occur. 2023-01-01 07:02:03 +11:00
Importdoc.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Importfile.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Notifier.php fix comment edits 2022-12-28 12:51:30 +11:00
Onepoll.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Poller.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Queue.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
README.md it's done 2022-02-15 20:08:28 -08:00
Run.php changes to daemon invocation 2022-10-23 20:51:54 +11:00
Thumbnail.php convrt to DaemonInterface 2022-11-27 20:15:28 +11:00
Xchan_photo.php convrt to DaemonInterface 2022-11-27 20:15:28 +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

Code\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 Code\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.