ftp_mdtm_basic.phpt 957 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Test the File Modification Time as described in http://tools.ietf.org/html/rfc3659#section-3.1
  3. --CREDITS--
  4. Nathaniel McHugh
  5. --EXTENSIONS--
  6. ftp
  7. pcntl
  8. --FILE--
  9. <?php
  10. require 'server.inc';
  11. $ftp = ftp_connect('127.0.0.1', $port);
  12. if (!$ftp) die("Couldn't connect to the server");
  13. var_dump(ftp_login($ftp, 'user', 'pass'));
  14. date_default_timezone_set('UTC');
  15. $time = ftp_mdtm($ftp, "A");
  16. echo date("F d Y H:i:s u",$time), PHP_EOL;
  17. $time = ftp_mdtm($ftp, "B");
  18. echo date("F d Y H:i:s u",$time), PHP_EOL;
  19. $time = ftp_mdtm($ftp, "C");
  20. echo date("F d Y H:i:s u",$time), PHP_EOL;
  21. $time = ftp_mdtm($ftp, "D");
  22. var_dump($time);
  23. $time = ftp_mdtm($ftp, "19990929043300 File6");
  24. echo date("F d Y H:i:s u",$time), PHP_EOL;
  25. $time = ftp_mdtm($ftp, "MdTm 19990929043300 file6");
  26. var_dump($time);
  27. ?>
  28. --EXPECT--
  29. bool(true)
  30. June 15 1998 10:00:45 000000
  31. June 15 1998 10:00:45 000000
  32. July 05 1998 13:23:16 000000
  33. int(-1)
  34. October 05 1999 21:31:02 000000
  35. int(-1)