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.
 
 
 
 
 
 

52 lines
906 B

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