aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r--Zotlabs/Daemon/Cron.php3
-rw-r--r--Zotlabs/Daemon/Master.php18
2 files changed, 19 insertions, 2 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php
index 8b6b42c8a..fe356bcbf 100644
--- a/Zotlabs/Daemon/Cron.php
+++ b/Zotlabs/Daemon/Cron.php
@@ -108,6 +108,7 @@ class Cron {
$file = dbunescbin($rr['content']);
if(is_file($file)) {
@unlink($file);
+ @rmdir(dirname($file));
logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG);
}
}
@@ -187,7 +188,7 @@ class Cron {
if($r) {
require_once('include/photo/photo_driver.php');
foreach($r as $rr) {
- $photos = import_xchan_photo($rr['xchan_photo_l'],$rr['xchan_hash']);
+ $photos = import_xchan_photo($rr['xchan_photo_l'], $rr['xchan_hash'], false, true);
$x = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php
index 857d47243..67a3acc0a 100644
--- a/Zotlabs/Daemon/Master.php
+++ b/Zotlabs/Daemon/Master.php
@@ -17,7 +17,22 @@ if(array_search( __file__ , get_included_files()) === 0) {
class Master {
static public function Summon($arr) {
- proc_run('php','Zotlabs/Daemon/Master.php',$arr);
+ $hookinfo = [
+ 'argv'=>$arr
+ ];
+
+ call_hooks ('daemon_master_summon',$hookinfo);
+
+ $arr = $hookinfo['argv'];
+ $argc = count($arr);
+
+ if ((!is_array($arr) || (count($arr) < 1))) {
+ logger("Summon handled by hook.",LOGGER_DEBUG);
+ return;
+ }
+
+ $phpbin = get_config('system','phpbin','php');
+ proc_run($phpbin,'Zotlabs/Daemon/Master.php',$arr);
}
static public function Release($argc,$argv) {
@@ -33,6 +48,7 @@ class Master {
$argc = count($argv);
if ((!is_array($argv) || (count($argv) < 1))) {
+ logger("Release handled by hook.",LOGGER_DEBUG);
return;
}