Ensure that the spool path is set
This commit is contained in:
parent
2bfc40d74c
commit
9251d2af6f
2 changed files with 7 additions and 4 deletions
|
@ -860,9 +860,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
||||||
// We use "microtime" to keep the arrival order and "mt_rand" to avoid duplicates
|
// We use "microtime" to keep the arrival order and "mt_rand" to avoid duplicates
|
||||||
$file = 'item-'.round(microtime(true) * 10000).'-'.mt_rand().'.msg';
|
$file = 'item-'.round(microtime(true) * 10000).'-'.mt_rand().'.msg';
|
||||||
|
|
||||||
$spool = get_spoolpath().'/'.$file;
|
$spoolpath = get_spoolpath();
|
||||||
|
if ($spoolpath != "") {
|
||||||
|
$spool = $spoolpath.'/'.$file;
|
||||||
file_put_contents($spool, json_encode($arr));
|
file_put_contents($spool, json_encode($arr));
|
||||||
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
|
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ function spool_post_run($argv, $argc) {
|
||||||
|
|
||||||
$path = get_spoolpath();
|
$path = get_spoolpath();
|
||||||
|
|
||||||
if (is_writable($path)){
|
if (($path != '') AND is_writable($path)){
|
||||||
if ($dh = opendir($path)) {
|
if ($dh = opendir($path)) {
|
||||||
while (($file = readdir($dh)) !== false) {
|
while (($file = readdir($dh)) !== false) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue