template-exists.php 684 B

123456789101112131415161718192021222324252627282930
  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 . 'Checking For Remotely Stored Templates' .
  7. PHP_EOL .
  8. PHP_EOL)
  9. );
  10. $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
  11. $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
  12. ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
  13. print('Checking whether a template is available... ');
  14. if (true === $phpLiveDocx->templateExists('template-1.docx')) {
  15. print('EXISTS. ');
  16. } else {
  17. print('DOES NOT EXIST. ');
  18. }
  19. print('DONE' . PHP_EOL);
  20. print(PHP_EOL);
  21. unset($phpLiveDocx);