ftp_fget_basic3.phpt 717 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Testing ftp_fget resume parameter
  3. --CREDITS--
  4. Rodrigo Moyle <eu [at] rodrigorm [dot] com [dot] br>
  5. #testfest PHPSP on 2009-06-20
  6. --EXTENSIONS--
  7. ftp
  8. pcntl
  9. --FILE--
  10. <?php
  11. require 'server.inc';
  12. $ftp = ftp_connect('127.0.0.1', $port);
  13. ftp_login($ftp, 'user', 'pass');
  14. if (!$ftp) die("Couldn't connect to the server");
  15. $local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt";
  16. file_put_contents($local_file, 'ASCIIFoo');
  17. $handle = fopen($local_file, 'a');
  18. var_dump(ftp_fget($ftp, $handle, 'fgetresume.txt', FTP_ASCII, 8));
  19. var_dump(file_get_contents($local_file));
  20. ?>
  21. --CLEAN--
  22. <?php
  23. @unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt");
  24. ?>
  25. --EXPECT--
  26. bool(true)
  27. string(12) "ASCIIFooBar
  28. "