aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/README.md
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-06-27 09:54:01 +0200
committerMario Vavti <mario@mariovavti.com>2016-06-27 09:54:01 +0200
commit5b9cd0af6492ad9a48ffa0cd757dacaf936dfdba (patch)
treee2622b1391d0a52c6511763f393f8a35cc27c352 /Zotlabs/Daemon/README.md
parent27ee95106df739d8daa4eb7fe8907b080fb69c24 (diff)
parent8d298d5a068845856c9827c0d2ea3f02f1399d72 (diff)
downloadvolse-hubzilla-5b9cd0af6492ad9a48ffa0cd757dacaf936dfdba.tar.gz
volse-hubzilla-5b9cd0af6492ad9a48ffa0cd757dacaf936dfdba.tar.bz2
volse-hubzilla-5b9cd0af6492ad9a48ffa0cd757dacaf936dfdba.zip
Merge branch 'dev' into sabre32
Diffstat (limited to 'Zotlabs/Daemon/README.md')
-rw-r--r--Zotlabs/Daemon/README.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/README.md b/Zotlabs/Daemon/README.md
new file mode 100644
index 000000000..cb5b00a56
--- /dev/null
+++ b/Zotlabs/Daemon/README.md
@@ -0,0 +1,43 @@
+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.
+