1
0

RunningTransfer.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /* $Id: RunningTransfer.php 2550 2007-02-08 15:36:58Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. /**
  16. * base class RunningTransfer
  17. */
  18. class RunningTransfer
  19. {
  20. // public fields
  21. var $transferFile = "";
  22. var $filePath = "";
  23. var $transferowner = "";
  24. var $processId = "";
  25. var $args = "";
  26. /**
  27. * factory
  28. *
  29. * @param $psLine ps-line
  30. * @param $client client
  31. * @return RunningTransfer
  32. */
  33. function getInstance($psLine, $client = '') {
  34. // create and return object-instance
  35. switch ($client) {
  36. case "tornado":
  37. require_once('inc/classes/RunningTransfer.tornado.php');
  38. return new RunningTransferTornado($psLine);
  39. case "transmission":
  40. require_once('inc/classes/RunningTransfer.transmission.php');
  41. return new RunningTransferTransmission($psLine);
  42. case "mainline":
  43. require_once('inc/classes/RunningTransfer.mainline.php');
  44. return new RunningTransferMainline($psLine);
  45. case "azureus":
  46. require_once('inc/classes/RunningTransfer.azureus.php');
  47. return new RunningTransferAzureus($psLine);
  48. case "wget":
  49. require_once('inc/classes/RunningTransfer.wget.php');
  50. return new RunningTransferWget($psLine);
  51. case "nzbperl":
  52. require_once('inc/classes/RunningTransfer.nzbperl.php');
  53. return new RunningTransferNzbperl($psLine);
  54. default:
  55. global $cfg;
  56. return RunningTransfer::getInstance($psLine, $cfg["btclient"]);
  57. }
  58. }
  59. /**
  60. * ctor
  61. *
  62. * @return RunningTransfer
  63. */
  64. function RunningTransfer() {
  65. die('base class -- dont do this');
  66. }
  67. }
  68. ?>