X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fspool_post.php;h=b7b8de396ad6b0ba47772c15dc76124fd49e2bd8;hb=eb7cbb9adafa003a06f2e2d2df70b4f1a46b1a85;hp=36bcab2a5570d865a851b84283b6abbe42990132;hpb=2bfc40d74cf67c68ced8c0b90b4667c46fdf583e;p=friendica.git diff --git a/include/spool_post.php b/include/spool_post.php index 36bcab2a55..b7b8de396a 100644 --- a/include/spool_post.php +++ b/include/spool_post.php @@ -4,30 +4,16 @@ * @brief Posts items that wer spooled because they couldn't be posted. */ -use \Friendica\Core\Config; +use Friendica\Core\Config; -require_once("boot.php"); require_once("include/items.php"); function spool_post_run($argv, $argc) { - global $a, $db; - - if (is_null($a)) { - $a = new App; - } - - if (is_null($db)) { - @include(".htconfig.php"); - require_once("include/dba.php"); - $db = new dba($db_host, $db_user, $db_pass, $db_data); - unset($db_host, $db_user, $db_pass, $db_data); - } - - Config::load(); + global $a; $path = get_spoolpath(); - if (is_writable($path)){ + if (($path != '') && is_writable($path)){ if ($dh = opendir($path)) { while (($file = readdir($dh)) !== false) { @@ -44,7 +30,7 @@ function spool_post_run($argv, $argc) { } // We can't read or write the file? So we don't care about it. - if (!is_writable($fullfile) OR !is_readable($fullfile)) { + if (!is_writable($fullfile) || !is_readable($fullfile)) { continue; } @@ -56,7 +42,7 @@ function spool_post_run($argv, $argc) { } // Skip if it doesn't seem to be an item array - if (!isset($arr['uid']) AND !isset($arr['uri']) AND !isset($arr['network'])) { + if (!isset($arr['uid']) && !isset($arr['uri']) && !isset($arr['network'])) { continue; } @@ -69,9 +55,3 @@ function spool_post_run($argv, $argc) { } } } - -if (array_search(__file__, get_included_files()) === 0) { - spool_post_run($_SERVER["argv"], $_SERVER["argc"]); - killme(); -} -?>