PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php

https://github.com/decaoz/zf1
PHP | 58 lines | 41 code | 15 blank | 2 comment | 0 complexity | 9ba6e2803969310bbc10ef44e1e6cacb MD5 | raw file
 1<?php
 2
 3require_once dirname(__FILE__) . '/../../common.php';
 4
 5
 6system('clear');
 7
 8print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 9    PHP_EOL . 'Using the Free Public Server' .
10    PHP_EOL . 
11    PHP_EOL . 'This sample application illustrates how to use Zend_Service_LiveDocx_MailMerge with the free, public LiveDocx server.' .
12    PHP_EOL .
13    PHP_EOL)
14);
15
16$mailMerge = new Zend_Service_LiveDocx_MailMerge();
17
18$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
19          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
20
21$mailMerge->getTemplateFormats(); // then call methods as usual
22
23printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
24    $mailMerge->getUsername(),
25    PHP_EOL,
26    $mailMerge->getPassword(),
27    PHP_EOL,
28    $mailMerge->getWsdl(),
29    PHP_EOL,
30    PHP_EOL
31);
32
33unset($mailMerge);
34
35// -----------------------------------------------------------------------------
36
37// Alternatively, you can pass username and password in the constructor.
38
39$mailMerge = new Zend_Service_LiveDocx_MailMerge(
40    array (
41        'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
42        'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD,
43    )
44);
45
46$mailMerge->getTemplateFormats(); // then call methods as usual
47
48printf('Username : %s%sPassword : %s%s    WSDL : %s%s%s',
49    $mailMerge->getUsername(),
50    PHP_EOL,
51    $mailMerge->getPassword(),
52    PHP_EOL,
53    $mailMerge->getWsdl(),
54    PHP_EOL,
55    PHP_EOL
56);
57
58unset($mailMerge);