Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

79 lines
1.6 KiB

  1. <?php
  2. use \Friendica\Core\Config;
  3. if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
  4. $directory = dirname($_SERVER["argv"][0]);
  5. if (substr($directory, 0, 1) != "/")
  6. $directory = $_SERVER["PWD"]."/".$directory;
  7. $directory = realpath($directory."/..");
  8. chdir($directory);
  9. }
  10. require_once("boot.php");
  11. function cronjobs_run(&$argv, &$argc){
  12. global $a, $db;
  13. if(is_null($a)) {
  14. $a = new App;
  15. }
  16. if(is_null($db)) {
  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);
  21. };
  22. require_once('include/session.php');
  23. require_once('include/datetime.php');
  24. require_once('include/ostatus.php');
  25. require_once('include/post_update.php');
  26. require_once('mod/nodeinfo.php');
  27. Config::load();
  28. $a->set_baseurl(get_config('system','url'));
  29. // No parameter set? So return
  30. if ($argc <= 1)
  31. return;
  32. // Check OStatus conversations
  33. // Check only conversations with mentions (for a longer time)
  34. if ($argv[1] == 'ostatus_mentions') {
  35. ostatus::check_conversations(true);
  36. return;
  37. }
  38. // Check every conversation
  39. if ($argv[1] == 'ostatus_conversations') {
  40. ostatus::check_conversations(false);
  41. return;
  42. }
  43. // Call possible post update functions
  44. // see include/post_update.php for more details
  45. if ($argv[1] == 'post_update') {
  46. post_update();
  47. return;
  48. }
  49. // update nodeinfo data
  50. if ($argv[1] == 'nodeinfo') {
  51. nodeinfo_cron();
  52. return;
  53. }
  54. return;
  55. }
  56. if (array_search(__file__,get_included_files())===0){
  57. cronjobs_run($_SERVER["argv"],$_SERVER["argc"]);
  58. killme();
  59. }