ftp.php 748 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. error_reporting(-1);
  3. require 'misc.php';
  4. spl_autoload_register('psr0_autoload', TRUE);
  5. use \Osinet\FiniteStateMachine\FtpClient;
  6. use \Osinet\FiniteStateMachine\Grapher;
  7. $ftp = new FtpClient(array(
  8. 'source' => 'ftp.xml',
  9. )) or die('Could not load the FtpClient class.');
  10. // echo "FSM loaded, ". count($ftp->fTransitions) ." transitions. State: {$ftp->getState()}\n";
  11. FALSE && $ftp->setParameters(array(
  12. 'RemoteHost' => 'ftp.example.com',
  13. 'RemoteUser' => 'anonymous',
  14. 'RemotePass' => 'anonymous',
  15. 'RemoteWd' => '/dev',
  16. 'RemoteFile' => 'null',
  17. 'LocalWd' => '/dev',
  18. 'LocalFile' => 'null',
  19. 'FtpCallback' => '',
  20. ));
  21. // print_r($ftp->fTransitions);
  22. $grapher = new Grapher($ftp, array('debug' => 1));
  23. echo $grapher->render();