public.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/php
  2. <?php
  3. require_once dirname(__FILE__) . '/../../common.php';
  4. system('clear');
  5. print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
  6. PHP_EOL . 'Using the Free Public Server' .
  7. PHP_EOL .
  8. PHP_EOL . 'This sample application illustrates how to use Zend_Service_LiveDocx_MailMerge with the free, public LiveDocx server.' .
  9. PHP_EOL .
  10. PHP_EOL)
  11. );
  12. $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
  13. $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
  14. ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
  15. $phpLiveDocx->getTemplateFormats(); // then call methods as usual
  16. printf('Username : %s%sPassword : %s%s WSDL : %s%s%s',
  17. $phpLiveDocx->getUsername(),
  18. PHP_EOL,
  19. $phpLiveDocx->getPassword(),
  20. PHP_EOL,
  21. $phpLiveDocx->getWsdl(),
  22. PHP_EOL,
  23. PHP_EOL
  24. );
  25. unset($phpLiveDocx);
  26. // -----------------------------------------------------------------------------
  27. // Alternatively, you can pass username and password in the constructor.
  28. $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
  29. array (
  30. 'username' => Demos_Zend_Service_LiveDocx_Helper::USERNAME,
  31. 'password' => Demos_Zend_Service_LiveDocx_Helper::PASSWORD,
  32. )
  33. );
  34. $phpLiveDocx->getTemplateFormats(); // then call methods as usual
  35. printf('Username : %s%sPassword : %s%s WSDL : %s%s%s',
  36. $phpLiveDocx->getUsername(),
  37. PHP_EOL,
  38. $phpLiveDocx->getPassword(),
  39. PHP_EOL,
  40. $phpLiveDocx->getWsdl(),
  41. PHP_EOL,
  42. PHP_EOL
  43. );
  44. unset($phpLiveDocx);