streams/Zotlabs/Daemon
2016-10-03 19:47:36 -07:00
..
Checksites.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Cli_suggest.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Cron.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Cron_daily.php the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files. 2016-06-01 21:48:54 -07:00
Cron_weekly.php disable wiki if feature disabled, sync updates of delayed publish posts 2016-06-30 21:27:59 -07: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 don't try to deliver empty hashes 2016-05-19 20:48:40 -07:00
Deliver_hooks.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Directory.php daemon master: create some compatibility code 2016-05-19 20:36:32 -07:00
Expire.php expire crashing on shared hosting from memory exhaustion. Lower the expire limit. Also the sys channel was being expired with everybody else due to a flag change regression. 2016-07-06 22:02:06 -07:00
Externals.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Gprobe.php finish updating zot_finger instances 2016-05-21 18:18:33 -07:00
Importdoc.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Master.php cleanup of daemon infrastructure 2016-05-19 21:32:19 -07:00
Notifier.php start removing db backticks 2016-10-03 19:47:36 -07:00
Onedirsync.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Onepoll.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Poller.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Queue.php require token signatures in zot_refresh, also move channel specific stuff into include/channel.php from include/connections.php 2016-05-24 23:05:00 -07:00
Ratenotif.php renamed include files identity.php (channel.php) and Contact.php (connections.php) 2016-05-22 16:54:30 -07:00
README.md document the daemon classes 2016-06-26 21:58:09 -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.