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.

78 lines
1.6KB

  1. <?php
  2. if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
  3. $directory = dirname($_SERVER["argv"][0]);
  4. if (substr($directory, 0, 1) != "/")
  5. $directory = $_SERVER["PWD"]."/".$directory;
  6. $directory = realpath($directory."/..");
  7. chdir($directory);
  8. }
  9. require_once("boot.php");
  10. function cronjobs_run(&$argv, &$argc){
  11. global $a, $db;
  12. if(is_null($a)) {
  13. $a = new App;
  14. }
  15. if(is_null($db)) {
  16. @include(".htconfig.php");
  17. require_once("include/dba.php");
  18. $db = new dba($db_host, $db_user, $db_pass, $db_data);
  19. unset($db_host, $db_user, $db_pass, $db_data);
  20. };
  21. require_once('include/session.php');
  22. require_once('include/datetime.php');
  23. require_once('include/ostatus.php');
  24. require_once('include/post_update.php');
  25. require_once('mod/nodeinfo.php');
  26. load_config('config');
  27. load_config('system');
  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. }