This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
core/Zotlabs/Daemon
Mario 158b8aea38 hopefully fix query for postgres
(cherry picked from commit 9ad4c6528cc3ee4e34d2b5d77027a1c33cbadf5c)
2019-11-10 12:02:12 +01:00
..
Addon.php daemon_addon hook - lets plugins create custom background processes. 2017-01-17 00:14:47 -08:00
Cache_embeds.php cache embeds in the background on initial storage rather than on first access 2019-01-29 15:14:49 -08:00
Checksites.php consolidate hubloc storage 2017-01-30 15:01:22 -08:00
Cli_suggest.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Cron_daily.php find unregistered z6 clones on hubzilla sites (does not happen automatically since z6 is not the default protocol on hubzilla). This will need to be pushed to master for the next point release. 2019-03-13 16:27:52 -07:00
Cron_weekly.php improve removed_channel final cleanup. Hubzilla issue #386 2017-11-12 21:37:06 -08:00
Cron.php hopefully fix query for postgres 2019-11-10 12:02:12 +01:00
Cronhooks.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
CurlAuth.php Return in the case of further processing 2019-08-19 23:13:19 -04:00
Deliver_hooks.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Deliver.php dreport updates 2018-11-12 16:08:22 -08:00
Directory.php daemon master: create some compatibility code 2016-05-19 20:36:32 -07:00
Expire.php last commented expiration setting in admin 2018-04-10 00:05:20 -07:00
Externals.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Gprobe.php cut down on a few extraneous gprobe processes 2017-08-31 23:21:06 -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 test recursive dav copy 2017-08-22 20:32:02 -07:00
Master.php Return in the case of further processing 2019-08-19 23:13:19 -04:00
Notifier.php Notify on custom items - rework hooks 2019-09-23 10:11:27 +02:00
Onedirsync.php first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
Onepoll.php more z6 compatibility fixes 2019-01-16 15:28:30 -08:00
Poller.php Return in the case of further processing 2019-08-19 23:13:19 -04:00
Queue.php Use dba_driver.php::db_getfunc() 2019-01-11 07:35:12 -05:00
Ratenotif.php put deferred queue logic every place we create a delivery process (except for protocol 'friend requests' which aren't likely to swamp the delivery system). Remove it from the queue_delivery function which was too late to do anything. 2017-11-02 03:13:30 -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

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.