PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/demos/Zend/Service/LiveDocx/MailMerge/images/delete-all.php

https://github.com/decaoz/zf1
PHP | 29 lines | 20 code | 9 blank | 0 comment | 0 complexity | 49afdce2b8367500016348f9f8a85a55 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 . 'Deleting All Remotely Stored Images' .
10    PHP_EOL .
11    PHP_EOL)
12);
13
14$mailMerge = new Zend_Service_LiveDocx_MailMerge();
15
16$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
17          ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
18
19$counter = 1;
20foreach ($mailMerge->listImages() as $result) {
21    printf('%d) %s', $counter, $result['filename']);
22    $mailMerge->deleteImage($result['filename']);
23    print(' - DELETED.' . PHP_EOL);
24    $counter++;
25}
26
27print(PHP_EOL);
28
29unset($mailMerge);