1
0

RunningTransfer.mainline.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /* $Id: RunningTransfer.mainline.php 2260 2007-01-11 00:46:01Z 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. * class RunningTransferMainline for mainline-client
  17. */
  18. class RunningTransferMainline extends RunningTransfer
  19. {
  20. /**
  21. * ctor
  22. *
  23. * @param $psLine
  24. * @return RunningTransferMainline
  25. */
  26. function RunningTransferMainline($psLine) {
  27. global $cfg;
  28. // mainlineBin
  29. $mainlineBin = $cfg["docroot"]."bin/clients/mainline/tfmainline.py";
  30. // ps-parse
  31. if (strlen($psLine) > 0) {
  32. while (strpos($psLine," ") > 0)
  33. $psLine = str_replace(" ",' ',trim($psLine));
  34. $arr = explode(' ',$psLine);
  35. $this->processId = $arr[0];
  36. $arrC = count($arr);
  37. foreach($arr as $key =>$value) {
  38. if ($key == 0)
  39. $startArgs = false;
  40. if ($value == $mainlineBin) {
  41. $this->transferowner = $arr[5];
  42. $this->filePath = substr($arr[$arrC - 1], 0, strrpos($arr[$arrC - 1], "/") + 1);
  43. $this->transferFile = str_replace($cfg['transfer_file_path'],'', $arr[$arrC - 1]);
  44. }
  45. }
  46. $this->args = str_replace("--","",$this->args);
  47. $this->args = substr($this->args,0,strlen($this->args));
  48. }
  49. }
  50. }
  51. ?>