3 * @file include/spool_post.php
4 * @brief Posts items that wer spooled because they couldn't be posted.
7 use \Friendica\Core\Config;
9 require_once("boot.php");
10 require_once("include/items.php");
12 function spool_post_run($argv, $argc) {
20 @include(".htconfig.php");
21 require_once("include/dba.php");
22 $db = new dba($db_host, $db_user, $db_pass, $db_data);
23 unset($db_host, $db_user, $db_pass, $db_data);
28 $path = get_spoolpath();
30 if (is_writable($path)){
31 if ($dh = opendir($path)) {
32 while (($file = readdir($dh)) !== false) {
33 $fullfile = $path."/".$file;
34 if (filetype($fullfile) != "file") {
37 $arr = json_decode(file_get_contents($fullfile), true);
38 $result = item_store($arr);
39 logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG);
47 if (array_search(__file__, get_included_files()) === 0) {
48 spool_post_run($_SERVER["argv"], $_SERVER["argc"]);