wget.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env php
  2. <?php
  3. /* $Id: wget.php 2939 2007-04-23 16:44:45Z b4rt $ */
  4. /*******************************************************************************
  5. LICENSE
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License (GPL)
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  15. *******************************************************************************/
  16. // declare ticks
  17. declare(ticks = 1);
  18. // prevent invocation from web
  19. if (empty($argv[0])) die();
  20. if (isset($_REQUEST['argv'])) die();
  21. // dummy
  22. $_SESSION = array('cache' => false);
  23. /******************************************************************************/
  24. // change to docroot if needed
  25. if (!is_file(realpath(getcwd().'/inc/main.core.php')))
  26. chdir(realpath(dirname(__FILE__)."/.."));
  27. // check for home
  28. if (!is_file('inc/main.core.php'))
  29. exit("Error: this script can only be used in its default-path (DOCROOT/bin/)\n");
  30. // check args
  31. if ((!isset($argc)) || ($argc < 7))
  32. exit("Arg Error\n");
  33. // signals
  34. require_once('inc/defines/defines.signals.php');
  35. // main.core
  36. require_once('inc/main.core.php');
  37. // common functions
  38. require_once('inc/functions/functions.common.php');
  39. // wget wrapper class
  40. require_once('inc/classes/Wrapper.wget.php');
  41. // load default-language
  42. loadLanguageFile($cfg["default_language"]);
  43. // from here on the wget-wrapper-class takes over
  44. WrapperWget::start($argv[1], $argv[2], $argv[3], $argv[4], $argv[5], $argv[6]);
  45. ?>