]> git.mxchange.org Git - friendica.git/blob - include/create_shadowentry.php
Merge remote-tracking branch 'upstream/develop' into 1612-spool
[friendica.git] / include / create_shadowentry.php
1 <?php
2 /**
3  * @file include/create_shadowentry.php
4  * @brief This script creates posts with UID = 0 for a given public post.
5  *
6  * This script is started from mod/item.php to save some time when doing a post.
7  */
8 require_once("boot.php");
9 require_once("include/threads.php");
10
11 function create_shadowentry_run($argv, $argc) {
12         global $a, $db;
13
14         if (is_null($a))
15                 $a = new App;
16
17         if (is_null($db)) {
18                 @include(".htconfig.php");
19                 require_once("include/dba.php");
20                 $db = new dba($db_host, $db_user, $db_pass, $db_data);
21                 unset($db_host, $db_user, $db_pass, $db_data);
22         }
23
24         load_config('config');
25         load_config('system');
26
27         if ($argc != 2) {
28                 return;
29         }
30
31         $message_id = intval($argv[1]);
32
33         add_shadow_entry($message_id);
34 }
35
36 if (array_search(__file__,get_included_files())===0){
37   create_shadowentry_run($_SERVER["argv"],$_SERVER["argc"]);
38   killme();
39 }
40 ?>