fluxcli.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env php
  2. <?php
  3. /* $Id: fluxcli.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. // prevent invocation from web
  17. if (empty($argv[0])) die();
  18. if (isset($_REQUEST['argv'])) die();
  19. // dummy
  20. $_SESSION = array('cache' => false);
  21. /******************************************************************************/
  22. // change to docroot if needed
  23. if (!is_file(realpath(getcwd().'/inc/main.core.php')))
  24. chdir(realpath(dirname(__FILE__)."/.."));
  25. // check for home
  26. if (!is_file('inc/main.core.php'))
  27. exit("Error: this script can only be used in its default-path (DOCROOT/bin/)\n");
  28. // main.core
  29. require_once('inc/main.core.php');
  30. // all functions
  31. require_once('inc/functions/functions.all.php');
  32. // FluxCLI-class
  33. require_once('inc/classes/FluxCLI.php');
  34. // load default-language
  35. loadLanguageFile($cfg["default_language"]);
  36. // transfers-array
  37. initGlobalTransfersArray();
  38. // Fluxd
  39. Fluxd::initialize();
  40. // FluxCLI
  41. FluxCLI::processRequest($argv);
  42. ?>