]> git.mxchange.org Git - friendica.git/blobdiff - include/shadowupdate.php
Now there is only the worker.
[friendica.git] / include / shadowupdate.php
index 83a785fe1fdd88b3455685861354b27ad73d3594..5b0a1b94b0af3f9b530a36db860163d576f71667 100644 (file)
@@ -5,20 +5,26 @@ use \Friendica\Core\Config;
 require_once("boot.php");
 require_once("include/threads.php");
 
-global $a, $db;
+function shadowupdate_run(&$argv, &$argc){
+       global $a, $db;
 
-if(is_null($a))
-       $a = new App;
+       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);
-}
+       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();
 
-Config::load();
+       update_shadow_copy();
+}
 
-update_shadow_copy();
-killme();
-?>
+if (array_search(__file__,get_included_files())===0){
+       shadowupdate_run($_SERVER["argv"],$_SERVER["argc"]);
+       killme();
+}