Browse Source

Preparing Zend_Service_LiveDocx_MailMerge demos for the introduction of Zend_Service_LiveDocx_Convert object and demos.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21632 44c647ce-9c0f-0410-b52a-842ac1e357ba
jonathan_maron 16 years ago
parent
commit
6ac2954f5f
21 changed files with 195 additions and 195 deletions
  1. 15 15
      demos/Zend/Service/LiveDocx/MailMerge/bitmaps/generate-bitmaps.php
  2. 9 9
      demos/Zend/Service/LiveDocx/MailMerge/constructors/hosted-licensed.php
  3. 6 6
      demos/Zend/Service/LiveDocx/MailMerge/constructors/public-zend_config.php
  4. 14 14
      demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php
  5. 8 8
      demos/Zend/Service/LiveDocx/MailMerge/convert/convert-document.php
  6. 14 14
      demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document-concat.php
  7. 17 17
      demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document.php
  8. 15 15
      demos/Zend/Service/LiveDocx/MailMerge/metafiles/generate-metafiles.php
  9. 17 17
      demos/Zend/Service/LiveDocx/MailMerge/pdf-security/generate-document.php
  10. 6 6
      demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts-cached.php
  11. 5 5
      demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts.php
  12. 7 7
      demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php
  13. 7 7
      demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php
  14. 13 13
      demos/Zend/Service/LiveDocx/MailMerge/telephone-bill/generate-document.php
  15. 12 12
      demos/Zend/Service/LiveDocx/MailMerge/template-info/list-template-info.php
  16. 6 6
      demos/Zend/Service/LiveDocx/MailMerge/templates/delete-all.php
  17. 6 6
      demos/Zend/Service/LiveDocx/MailMerge/templates/download.php
  18. 5 5
      demos/Zend/Service/LiveDocx/MailMerge/templates/list.php
  19. 5 5
      demos/Zend/Service/LiveDocx/MailMerge/templates/template-exists.php
  20. 6 6
      demos/Zend/Service/LiveDocx/MailMerge/templates/upload.php
  21. 2 2
      demos/Zend/Service/LiveDocx/check-environment.php

+ 15 - 15
demos/Zend/Service/LiveDocx/MailMerge/bitmaps/generate-bitmaps.php

@@ -3,32 +3,32 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('template.docx');
+$mailMerge->setLocalTemplate('template.docx');
 
-$phpLiveDocx->assign('software', 'Magic Graphical Compression Suite v1.9')
-            ->assign('licensee', 'Daï Lemaitre')
-            ->assign('company',  'Megasoft Co-operation')
-            ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
-            ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
-            ->assign('city',     'Lyon')
-            ->assign('country',  'France');
+$mailMerge->assign('software', 'Magic Graphical Compression Suite v1.9')
+          ->assign('licensee', 'Daï Lemaitre')
+          ->assign('company',  'Megasoft Co-operation')
+          ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
+          ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
+          ->assign('city',     'Lyon')
+          ->assign('country',  'France');
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
 // Get all bitmaps
-$bitmaps = $phpLiveDocx->getAllBitmaps(100, 'png');      // zoomFactor, format
+$bitmaps = $mailMerge->getAllBitmaps(100, 'png');      // zoomFactor, format
 
 // Get just bitmaps in specified range
-//$bitmaps = $phpLiveDocx->getBitmaps(2, 2, 100, 'png');   // fromPage, toPage, zoomFactor, format
+//$bitmaps = $mailMerge->getBitmaps(2, 2, 100, 'png');   // fromPage, toPage, zoomFactor, format
 
 foreach ($bitmaps as $pageNumber => $bitmapData) {
     $filename = sprintf('document-page-%d.png', $pageNumber);
     file_put_contents($filename, $bitmapData);
 }
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 9 - 9
demos/Zend/Service/LiveDocx/MailMerge/constructors/hosted-licensed.php

@@ -13,22 +13,22 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL')
-            ->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL')
+          ->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->getTemplateFormats(); // then call methods as usual
+$mailMerge->getTemplateFormats(); // then call methods as usual
 
 printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
-    $phpLiveDocx->getUsername(),
+    $mailMerge->getUsername(),
     PHP_EOL,
-    $phpLiveDocx->getPassword(),
+    $mailMerge->getPassword(),
     PHP_EOL,
-    $phpLiveDocx->getWsdl(),
+    $mailMerge->getWsdl(),
     PHP_EOL,
     PHP_EOL
 );
 
-unset($phpLiveDocx, $mySoapClient);
+unset($mailMerge, $mySoapClient);

+ 6 - 6
demos/Zend/Service/LiveDocx/MailMerge/constructors/public-zend_config.php

@@ -15,18 +15,18 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $options = new Zend_Config_Ini('credentials.ini');
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge($options);
+$mailMerge = new Zend_Service_LiveDocx_MailMerge($options);
 
-$phpLiveDocx->getTemplateFormats(); // then call methods as usual
+$mailMerge->getTemplateFormats(); // then call methods as usual
 
 printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
-    $phpLiveDocx->getUsername(),
+    $mailMerge->getUsername(),
     PHP_EOL,
-    $phpLiveDocx->getPassword(),
+    $mailMerge->getPassword(),
     PHP_EOL,
-    $phpLiveDocx->getWsdl(),
+    $mailMerge->getWsdl(),
     PHP_EOL,
     PHP_EOL
 );
 
-unset($phpLiveDocx, $options);
+unset($mailMerge, $options);

+ 14 - 14
demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php

@@ -13,46 +13,46 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->getTemplateFormats(); // then call methods as usual
+$mailMerge->getTemplateFormats(); // then call methods as usual
 
 printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
-    $phpLiveDocx->getUsername(),
+    $mailMerge->getUsername(),
     PHP_EOL,
-    $phpLiveDocx->getPassword(),
+    $mailMerge->getPassword(),
     PHP_EOL,
-    $phpLiveDocx->getWsdl(),
+    $mailMerge->getWsdl(),
     PHP_EOL,
     PHP_EOL
 );
 
-unset($phpLiveDocx);
+unset($mailMerge);
 
 // -----------------------------------------------------------------------------
 
 // Alternatively, you can pass username and password in the constructor.
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
+$mailMerge = new Zend_Service_LiveDocx_MailMerge(
     array (
         'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
         'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD,
     )
 );
 
-$phpLiveDocx->getTemplateFormats(); // then call methods as usual
+$mailMerge->getTemplateFormats(); // then call methods as usual
 
 printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
-    $phpLiveDocx->getUsername(),
+    $mailMerge->getUsername(),
     PHP_EOL,
-    $phpLiveDocx->getPassword(),
+    $mailMerge->getPassword(),
     PHP_EOL,
-    $phpLiveDocx->getWsdl(),
+    $mailMerge->getWsdl(),
     PHP_EOL,
     PHP_EOL
 );
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 8 - 8
demos/Zend/Service/LiveDocx/MailMerge/convert/convert-document.php

@@ -18,19 +18,19 @@ require_once dirname(__FILE__) . '/../../common.php';
  * made available.
  */
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('document.doc');
+$mailMerge->setLocalTemplate('document.doc');
 
-$phpLiveDocx->assign('dummyFieldName', 'dummyFieldValue'); // necessary as of LiveDocx 1.2
+$mailMerge->assign('dummyFieldName', 'dummyFieldValue'); // necessary as of LiveDocx 1.2
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
-$document = $phpLiveDocx->retrieveDocument('pdf');
+$document = $mailMerge->retrieveDocument('pdf');
 
 file_put_contents('document.pdf', $document);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 14 - 14
demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document-concat.php

@@ -89,34 +89,34 @@ mkdir($tempDirectory);
 
 $tempFilenames = array();
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('template.docx');
+$mailMerge->setLocalTemplate('template.docx');
 
 for ($iteration = 1; $iteration <= $iterations; $iteration ++) {
     
     $tempFilename = sprintf('%s/%010s.pdf', $tempDirectory, $iteration);
     $tempFilenames[] = $tempFilename;
     
-    $phpLiveDocx->assign('software', randomString())
-                ->assign('licensee', randomString())
-                ->assign('company',  randomString())
-                ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
-                ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
-                ->assign('city',     randomString())
-                ->assign('country',  randomString());
+    $mailMerge->assign('software', randomString())
+              ->assign('licensee', randomString())
+              ->assign('company',  randomString())
+              ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
+              ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
+              ->assign('city',     randomString())
+              ->assign('country',  randomString());
         
-    $phpLiveDocx->createDocument();
+    $mailMerge->createDocument();
     
-    file_put_contents($tempFilename, $phpLiveDocx->retrieveDocument('pdf'));
+    file_put_contents($tempFilename, $mailMerge->retrieveDocument('pdf'));
     
     $logger->log(sprintf('Generating temporary document %s.', $tempFilename), Zend_Log::INFO);
 }
 
-unset($phpLiveDocx);
+unset($mailMerge);
 
 // -----------------------------------------------------------------------------
 

+ 17 - 17
demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document.php

@@ -3,20 +3,20 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('template.docx');
+$mailMerge->setLocalTemplate('template.docx');
 
-$phpLiveDocx->assign('software', 'Magic Graphical Compression Suite v1.9')
-            ->assign('licensee', 'Henry Döner-Meyer')
-            ->assign('company',  'Co-Operation')
-            ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
-            ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
-            ->assign('city',     'Berlin')
-            ->assign('country',  'Germany');
+$mailMerge->assign('software', 'Magic Graphical Compression Suite v1.9')
+          ->assign('licensee', 'Henry Döner-Meyer')
+          ->assign('company',  'Co-Operation')
+          ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
+          ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
+          ->assign('city',     'Berlin')
+          ->assign('country',  'Germany');
 
 /**
  * ALTERNATIVE: Concatenating PDF files locally - basic
@@ -54,12 +54,12 @@ $fieldValues = array (
     )    
 );
 
-$phpLiveDocx->assign($fieldValues);
+$mailMerge->assign($fieldValues);
 */
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
-$document = $phpLiveDocx->retrieveDocument('pdf');
+$document = $mailMerge->retrieveDocument('pdf');
 
 file_put_contents('document.pdf', $document);
 
@@ -72,11 +72,11 @@ file_put_contents('document.pdf', $document);
  * application, you would probably decide on one or the other format.
  */
 /*
-foreach ($phpLiveDocx->getDocumentFormats() as $format) {
-    $document = $phpLiveDocx->retrieveDocument($format);
+foreach ($mailMerge->getDocumentFormats() as $format) {
+    $document = $mailMerge->retrieveDocument($format);
     file_put_contents('document.' . $format, $document);
 }
 
 */
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 15 - 15
demos/Zend/Service/LiveDocx/MailMerge/metafiles/generate-metafiles.php

@@ -3,32 +3,32 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('template.docx');
+$mailMerge->setLocalTemplate('template.docx');
             
-$phpLiveDocx->setFieldValue('software', 'Magic Graphical Compression Suite v1.9')
-            ->setFieldValue('licensee', 'Henry Döner-Meyer')
-            ->setFieldValue('company',  'Megasoft Co-operation')
-            ->setFieldValue('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
-            ->setFieldValue('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
-            ->setFieldValue('city',     'Bremen')
-            ->setFieldValue('country',  'Germany');
+$mailMerge->setFieldValue('software', 'Magic Graphical Compression Suite v1.9')
+          ->setFieldValue('licensee', 'Henry Döner-Meyer')
+          ->setFieldValue('company',  'Megasoft Co-operation')
+          ->setFieldValue('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
+          ->setFieldValue('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
+          ->setFieldValue('city',     'Bremen')
+          ->setFieldValue('country',  'Germany');
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
 // Get all metafiles
-$metaFiles = $phpLiveDocx->getAllMetafiles();
+$metaFiles = $mailMerge->getAllMetafiles();
 
 // Get just metafiles in specified range
-//$metaFiles = $phpLiveDocx->getMetafiles(1, 2);    // fromPage, toPage
+//$metaFiles = $mailMerge->getMetafiles(1, 2);    // fromPage, toPage
 
 foreach ($metaFiles as $pageNumber => $metaFileData) {
     $filename = sprintf('document-page-%d.wmf', $pageNumber);
     file_put_contents($filename, $metaFileData);
 }
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 17 - 17
demos/Zend/Service/LiveDocx/MailMerge/pdf-security/generate-document.php

@@ -3,29 +3,29 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
 // Set WSDL of your premium service server
-$phpLiveDocx->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL');
+$mailMerge->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL');
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-$phpLiveDocx->setLocalTemplate('template.docx');
+$mailMerge->setLocalTemplate('template.docx');
 
-$phpLiveDocx->assign('software', 'Magic Graphical Compression Suite v1.9')
-            ->assign('licensee', 'Henry Döner-Meyer')
-            ->assign('company',  'Co-Operation')
-            ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
-            ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
-            ->assign('city',     'Berlin')
-            ->assign('country',  'Germany');
+$mailMerge->assign('software', 'Magic Graphical Compression Suite v1.9')
+          ->assign('licensee', 'Henry Döner-Meyer')
+          ->assign('company',  'Co-Operation')
+          ->assign('date',     Zend_Date::now()->toString(Zend_Date::DATE_LONG))
+          ->assign('time',     Zend_Date::now()->toString(Zend_Date::TIME_LONG))
+          ->assign('city',     'Berlin')
+          ->assign('country',  'Germany');
 
 // Available on premium service only 
-$phpLiveDocx->setDocumentPassword('aaaaaaaaaa');
+$mailMerge->setDocumentPassword('aaaaaaaaaa');
 
 // Available on premium service only
-$phpLiveDocx->setDocumentAccessPermissions(
+$mailMerge->setDocumentAccessPermissions(
     array(
         'AllowHighLevelPrinting' ,  // getDocumentAccessOptions() returns
         'AllowExtractContents'      // array of permitted values
@@ -33,10 +33,10 @@ $phpLiveDocx->setDocumentAccessPermissions(
     'myDocumentAccessPassword'
 );
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
-$document = $phpLiveDocx->retrieveDocument('pdf');
+$document = $mailMerge->retrieveDocument('pdf');
 
 file_put_contents('document.pdf', $document);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 6 - 6
demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts-cached.php

@@ -22,16 +22,16 @@ if (! $fonts = $cache->load($cacheId)) {
     
     // Cache miss. Connect to backend service (expensive).
     
-    $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+    $mailMerge = new Zend_Service_LiveDocx_MailMerge();
     
-    $phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-                ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+    $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+              ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
     
-    $fonts = $phpLiveDocx->getFontNames();
+    $fonts = $mailMerge->getFontNames();
     
     $cache->save($fonts, $cacheId);
     
-    unset($phpLiveDocx);
+    unset($mailMerge);
     
 } else {
     
@@ -55,4 +55,4 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 print(PHP_EOL);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 5 - 5
demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts.php

@@ -3,10 +3,10 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 system('clear');
 
@@ -15,9 +15,9 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL . 
     PHP_EOL . 'The following fonts are installed on the backend server and may be used in templates. Fonts used in templates, which are NOT listed below, will be substituted. If you would like to use a font, which is not installed on the backend server, please contact your LiveDocx provider.' .
     PHP_EOL . 
-    PHP_EOL . Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($phpLiveDocx->getFontNames()) . 
+    PHP_EOL . Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($mailMerge->getFontNames()) . 
     PHP_EOL . 
     PHP_EOL)
 );
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 7 - 7
demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php

@@ -32,20 +32,20 @@ if (! $formats = $cache->load($cacheId)) {
     
     // Cache miss. Connect to backend service (expensive).
     
-    $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+    $mailMerge = new Zend_Service_LiveDocx_MailMerge();
     
-    $phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-                ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+    $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+              ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
     
     $formats = new StdClass();
     
-    $formats->template = $phpLiveDocx->getTemplateFormats();
-    $formats->document = $phpLiveDocx->getDocumentFormats();
-    $formats->image    = $phpLiveDocx->getImageFormats();
+    $formats->template = $mailMerge->getTemplateFormats();
+    $formats->document = $mailMerge->getDocumentFormats();
+    $formats->image    = $mailMerge->getImageFormats();
     
     $cache->save($formats, $cacheId);
     
-    unset($phpLiveDocx);
+    unset($mailMerge);
     
 } else {
     

+ 7 - 7
demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php

@@ -13,20 +13,20 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 printf("Supported TEMPLATE file formats (input)  : %s%s",
-    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($phpLiveDocx->getTemplateFormats()), PHP_EOL);
+    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($mailMerge->getTemplateFormats()), PHP_EOL);
 
 printf("Supported DOCUMENT file formats (output) : %s%s",
-    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($phpLiveDocx->getDocumentFormats()), PHP_EOL);
+    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($mailMerge->getDocumentFormats()), PHP_EOL);
 
 printf("Supported IMAGE file formats (output)    : %s%s",
-    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($phpLiveDocx->getImageFormats()), PHP_EOL);
+    Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($mailMerge->getImageFormats()), PHP_EOL);
 
 print PHP_EOL;
     
-unset($phpLiveDocx);
+unset($mailMerge);

+ 13 - 13
demos/Zend/Service/LiveDocx/MailMerge/telephone-bill/generate-document.php

@@ -3,17 +3,17 @@
 require_once dirname(__FILE__) . '/../../common.php';
 
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 /*
  * ALTERNATIVE: Specify username and password in constructor
  */
             
 /*
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
+$mailMerge = new Zend_Service_LiveDocx_MailMerge(
     array (
         'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
         'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
@@ -21,12 +21,12 @@ $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
 );
 */
 
-$phpLiveDocx->setLocalTemplate('template.doc');
+$mailMerge->setLocalTemplate('template.doc');
 
 
-$phpLiveDocx->assign('customer_number', sprintf("#%'10s",  rand(0,1000000000)))
-            ->assign('invoice_number',  sprintf("#%'10s",  rand(0,1000000000)))
-            ->assign('account_number',  sprintf("#%'10s",  rand(0,1000000000)));
+$mailMerge->assign('customer_number', sprintf("#%'10s",  rand(0,1000000000)))
+          ->assign('invoice_number',  sprintf("#%'10s",  rand(0,1000000000)))
+          ->assign('account_number',  sprintf("#%'10s",  rand(0,1000000000)));
 
 
 $billData = array (  
@@ -44,7 +44,7 @@ $billData = array (
     'total'         =>  '23.32'
 );
 
-$phpLiveDocx->assign($billData);
+$mailMerge->assign($billData);
 
 
 $billConnections = array(
@@ -70,13 +70,13 @@ $billConnections = array(
     )
 );
 
-$phpLiveDocx->assign('connection', $billConnections);
+$mailMerge->assign('connection', $billConnections);
 
 
-$phpLiveDocx->createDocument();
+$mailMerge->createDocument();
 
-$document = $phpLiveDocx->retrieveDocument('pdf');
+$document = $mailMerge->retrieveDocument('pdf');
 
-unset($phpLiveDocx);
+unset($mailMerge);
 
 file_put_contents('document.pdf', $document);

+ 12 - 12
demos/Zend/Service/LiveDocx/MailMerge/template-info/list-template-info.php

@@ -13,20 +13,20 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 // -----------------------------------------------------------------------------
 
 $templateName = 'template-1-text-field.docx';
 
-$phpLiveDocx->setLocalTemplate($templateName);
+$mailMerge->setLocalTemplate($templateName);
 
 printf('Field names in %s:%s', $templateName, PHP_EOL);
 
-$fieldNames = $phpLiveDocx->getFieldNames();
+$fieldNames = $mailMerge->getFieldNames();
 foreach ($fieldNames as $fieldName) {
     printf('- %s%s', $fieldName, PHP_EOL);   
 }
@@ -35,11 +35,11 @@ foreach ($fieldNames as $fieldName) {
 
 $templateName = 'template-2-text-fields.doc';
 
-$phpLiveDocx->setLocalTemplate($templateName);
+$mailMerge->setLocalTemplate($templateName);
 
 printf('%sField names in %s:%s', PHP_EOL, $templateName, PHP_EOL);
 
-$fieldNames = $phpLiveDocx->getFieldNames();
+$fieldNames = $mailMerge->getFieldNames();
 foreach ($fieldNames as $fieldName) {
     printf('- %s%s', $fieldName, PHP_EOL);     
 }
@@ -48,18 +48,18 @@ foreach ($fieldNames as $fieldName) {
 
 $templateName = 'template-block-fields.doc';
 
-$phpLiveDocx->setLocalTemplate($templateName);
+$mailMerge->setLocalTemplate($templateName);
 
 printf('%sField names in %s:%s', PHP_EOL, $templateName, PHP_EOL);
 
-$fieldNames = $phpLiveDocx->getFieldNames();
+$fieldNames = $mailMerge->getFieldNames();
 foreach ($fieldNames as $fieldName) {
     printf('- %s%s', $fieldName, PHP_EOL);     
 }
 
 printf('%sBlock names in %s:%s', PHP_EOL, $templateName, PHP_EOL);
 
-$blockNames = $phpLiveDocx->getBlockNames();
+$blockNames = $mailMerge->getBlockNames();
 foreach ($blockNames as $blockName) {
     printf('- %s%s', $blockName, PHP_EOL);    
 }
@@ -67,7 +67,7 @@ foreach ($blockNames as $blockName) {
 printf('%sBlock field names in %s:%s', PHP_EOL, $templateName, PHP_EOL);
 
 foreach ($blockNames as $blockName) {
-    $blockFieldNames = $phpLiveDocx->getBlockFieldNames($blockName);
+    $blockFieldNames = $mailMerge->getBlockFieldNames($blockName);
     foreach ($blockFieldNames as $blockFieldName) {
         printf('- %s::%s%s', $blockName, $blockFieldName, PHP_EOL);          
     }
@@ -77,4 +77,4 @@ print(PHP_EOL);
 
 // -----------------------------------------------------------------------------
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 6 - 6
demos/Zend/Service/LiveDocx/MailMerge/templates/delete-all.php

@@ -11,19 +11,19 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $counter = 1;
-foreach ($phpLiveDocx->listTemplates() as $result) {
+foreach ($mailMerge->listTemplates() as $result) {
     printf('%d) %s', $counter, $result['filename']);
-    $phpLiveDocx->deleteTemplate($result['filename']);
+    $mailMerge->deleteTemplate($result['filename']);
     print(' - DELETED.' . PHP_EOL);
     $counter++;
 }
 
 print(PHP_EOL);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 6 - 6
demos/Zend/Service/LiveDocx/MailMerge/templates/download.php

@@ -11,15 +11,15 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $counter = 1;
-foreach ($phpLiveDocx->listTemplates() as $result) {
+foreach ($mailMerge->listTemplates() as $result) {
     printf('%d) %s', $counter, $result['filename']);
-    $template = $phpLiveDocx->downloadTemplate($result['filename']);
+    $template = $mailMerge->downloadTemplate($result['filename']);
     file_put_contents('downloaded-' . $result['filename'], $template);
     print(" - DOWNLOADED.\n");
     $counter++;
@@ -27,4 +27,4 @@ foreach ($phpLiveDocx->listTemplates() as $result) {
 
 print(PHP_EOL);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 5 - 5
demos/Zend/Service/LiveDocx/MailMerge/templates/list.php

@@ -13,11 +13,11 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
-print(Demos_Zend_Service_LiveDocx_Helper::listDecorator($phpLiveDocx->listTemplates()));
+print(Demos_Zend_Service_LiveDocx_Helper::listDecorator($mailMerge->listTemplates()));
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 5 - 5
demos/Zend/Service/LiveDocx/MailMerge/templates/template-exists.php

@@ -11,13 +11,13 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 print('Checking whether a template is available... ');
-if (true === $phpLiveDocx->templateExists('template-1.docx')) {
+if (true === $mailMerge->templateExists('template-1.docx')) {
     print('EXISTS. ');
 } else {
     print('DOES NOT EXIST. ');
@@ -26,4 +26,4 @@ print('DONE' . PHP_EOL);
 
 print(PHP_EOL);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 6 - 6
demos/Zend/Service/LiveDocx/MailMerge/templates/upload.php

@@ -11,19 +11,19 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
     PHP_EOL)
 );
 
-$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
+$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
-            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
+$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 print('Uploading template... ');
-$phpLiveDocx->uploadTemplate('template-1.docx');
+$mailMerge->uploadTemplate('template-1.docx');
 print('DONE.' . PHP_EOL);
 
 print('Uploading template... ');
-$phpLiveDocx->uploadTemplate('template-2.docx');
+$mailMerge->uploadTemplate('template-2.docx');
 print('DONE.' . PHP_EOL);
 
 print(PHP_EOL);
 
-unset($phpLiveDocx);
+unset($mailMerge);

+ 2 - 2
demos/Zend/Service/LiveDocx/check-environment.php

@@ -220,13 +220,13 @@ $errorMessage = null;
 
 try {
     $microtime = microtime(true);
-    $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
+    $mailMerge = new Zend_Service_LiveDocx_MailMerge(
         array (
             'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
             'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
         )
     );
-    $phpLiveDocx->logIn();
+    $mailMerge->logIn();
     $duration = microtime(true) - $microtime;
 } catch (Zend_Service_LiveDocx_Exception $e) {
     $duration = -1;