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.

54 lines
934B

  1. <?php
  2. require_once("boot.php");
  3. function directory_run(&$argv, &$argc){
  4. global $a, $db;
  5. if(is_null($a)) {
  6. $a = new App;
  7. }
  8. if(is_null($db)) {
  9. @include(".htconfig.php");
  10. require_once("include/dba.php");
  11. $db = new dba($db_host, $db_user, $db_pass, $db_data);
  12. unset($db_host, $db_user, $db_pass, $db_data);
  13. };
  14. load_config('config');
  15. load_config('system');
  16. if($argc != 2)
  17. return;
  18. load_config('system');
  19. load_hooks();
  20. $a->set_baseurl(get_config('system','url'));
  21. $dir = get_config('system','directory');
  22. if(! strlen($dir))
  23. return;
  24. $dir .= "/submit";
  25. $arr = array('url' => $argv[1]);
  26. call_hooks('globaldir_update', $arr);
  27. logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
  28. if(strlen($arr['url']))
  29. fetch_url($dir . '?url=' . bin2hex($arr['url']));
  30. return;
  31. }
  32. if (array_search(__file__,get_included_files())===0){
  33. directory_run($_SERVER["argv"],$_SERVER["argc"]);
  34. killme();
  35. }