3 * @file include/spool_post.php
4 * @brief Posts items that wer spooled because they couldn't be posted.
6 require_once("boot.php");
7 require_once("include/items.php");
9 function spool_post_run($argv, $argc) {
17 @include(".htconfig.php");
18 require_once("include/dba.php");
19 $db = new dba($db_host, $db_user, $db_pass, $db_data);
20 unset($db_host, $db_user, $db_pass, $db_data);
23 load_config('config');
24 load_config('system');
26 $path = get_spoolpath();
28 if (is_writable($path)){
29 if ($dh = opendir($path)) {
30 while (($file = readdir($dh)) !== false) {
31 $fullfile = $path."/".$file;
32 if (filetype($fullfile) != "file") {
35 $arr = json_decode(file_get_contents($fullfile), true);
36 $result = item_store($arr);
37 logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG);
45 if (array_search(__file__, get_included_files()) === 0) {
46 spool_post_run($_SERVER["argv"], $_SERVER["argc"]);