aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-19 21:32:19 -0700
committerredmatrix <git@macgirvin.com>2016-05-19 21:32:19 -0700
commit014168a29bfbba69c2ba887af97e5fb290fa21c5 (patch)
tree377b736d899c5c69357864473a06d198f5014702 /boot.php
parent39bc0664a773a97ccce276161739f217e3ba7449 (diff)
downloadvolse-hubzilla-014168a29bfbba69c2ba887af97e5fb290fa21c5.tar.gz
volse-hubzilla-014168a29bfbba69c2ba887af97e5fb290fa21c5.tar.bz2
volse-hubzilla-014168a29bfbba69c2ba887af97e5fb290fa21c5.zip
cleanup of daemon infrastructure
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index bdce2a03f..ca3673361 100755
--- a/boot.php
+++ b/boot.php
@@ -1847,14 +1847,19 @@ function proc_run($cmd){
if(count($args) && $args[0] === 'php')
$args[0] = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php');
+
+ // redirect proc_run statements of legacy daemon processes to the new Daemon Master object class
+ // We will keep this interface until everybody has transitioned.
+
if(strstr($args[1],'include/')) {
+ // convert 'include/foo.php' to 'Foo'
$orig = substr(ucfirst(substr($args[1],8)),0,-4);
logger('proc_run_redirect: ' . $orig);
if(file_exists('Zotlabs/Daemon/' . $orig . '.php')) {
- array_shift($args);
- $args[0] = $orig;
- logger('Redirecting old proc_run interface: ' . print_r($args,true));
- \Zotlabs\Daemon\Master::Summon($args);
+ array_shift($args); // daemons are all run by php, pop it off the top of the array
+ $args[0] = $orig; // replace with the new daemon name
+ logger('Redirecting old proc_run interface: ' . print_r($args,true), LOGGER_DEBUG, LOG_DEBUG);
+ \Zotlabs\Daemon\Master::Summon($args); // summon the daemon
return;
}
}