Completed
Push — master ( 6d1a51...be646c )
by Lars
02:36
created

index.php ➔ microtime_float()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 1
eloc 3
c 2
b 1
f 1
nc 1
nop 0
dl 0
loc 6
rs 9.4285
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 93 and the first side effect is on line 35.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
use BounceMailHandler\BounceMailHandler;
4
5
/*~ index.php
6
.---------------------------------------------------------------------------.
7
|  Software: PHPMailer-BMH (Bounce Mail Handler)                            |
8
|   Version: 5.3-dev                                                        |
9
|   Contact: [email protected]                             |
10
|      Info: http://phpmailer.codeworxtech.com                              |
11
| ------------------------------------------------------------------------- |
12
|    Author: Andy Prevost [email protected] (admin)                 |
13
| Copyright (c) 2002-2009, Andy Prevost. All Rights Reserved.               |
14
| ------------------------------------------------------------------------- |
15
|   License: Distributed under the General Public License (GPL)             |
16
|            (http://www.gnu.org/licenses/gpl.html)                         |
17
| This program is distributed in the hope that it will be useful - WITHOUT  |
18
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
19
| FITNESS FOR A PARTICULAR PURPOSE.                                         |
20
| ------------------------------------------------------------------------- |
21
| This is a update of the original Bounce Mail Handler script               |
22
| http://sourceforge.net/projects/bmh/                                      |
23
| The script has been renamed from Bounce Mail Handler to PHPMailer-BMH     |
24
| ------------------------------------------------------------------------- |
25
| We offer a number of paid services:                                       |
26
| - Web Hosting on highly optimized fast and secure servers                 |
27
| - Technology Consulting                                                   |
28
| - Oursourcing (highly qualified programmers and graphic designers)        |
29
'---------------------------------------------------------------------------'
30
31
/*
32
 * This is an example script to work with PHPMailer-BMH (Bounce Mail Handler).
33
 */
34
35
$time_start = microtime_float();
36
37
require_once '../vendor/autoload.php';
38
39
// Use ONE of the following -- all echo back to the screen
40
41
//require_once 'callback_echo.php';
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
42
//require_once('callback_database.php'); // NOTE: Requires modification to insert your database settings
43
//require_once('callback_csv.php');      // NOTE: Requires creation of a 'logs' directory and making writable
44
45
// testing examples
46
$bmh = new BounceMailHandler();
47
$bmh->actionFunction       = 'callbackAction'; // default is 'callbackAction'
48
$bmh->verbose              = BounceMailHandler::VERBOSE_SIMPLE; //BounceMailHandler::VERBOSE_SIMPLE; //BounceMailHandler::VERBOSE_REPORT; //BounceMailHandler::VERBOSE_DEBUG; //BounceMailHandler::VERBOSE_QUIET; // default is BounceMailHandler::VERBOSE_SIMPLE
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
49
//$bmh->useFetchStructure  = true; // true is default, no need to specify
50
//$bmh->testMode           = false; // false is default, no need to specify
51
//$bmh->debugBodyRule      = false; // false is default, no need to specify
52
//$bmh->debugDsnRule       = false; // false is default, no need to specify
53
//$bmh->purgeUnprocessed   = false; // false is default, no need to specify
54
$bmh->disableDelete        = true; // false is default, no need to specify
55
56
/*
57
 * for local mailbox (to process .EML files)
58
 */
59
//$bmh->openLocal('/home/email/temp/mailbox');
0 ignored issues
show
Unused Code Comprehensibility introduced by
79% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
60
//$bmh->processMailbox();
61
62
/*
63
 * for remote mailbox
64
 */
65
$bmh->mailhost         = ''; // your mail server
66
$bmh->mailboxUserName  = ''; // your mailbox username
67
$bmh->mailboxPassword  = ''; // your mailbox password
68
$bmh->port             = 143; // the port to access your mailbox, default is 143
69
$bmh->service          = 'imap'; // the service to use (imap or pop3), default is 'imap'
70
$bmh->serviceOption    = 'notls'; // the service options (none, tls, notls, ssl, etc.), default is 'notls'
71
$bmh->boxname          = 'INBOX'; // the mailbox to access, default is 'INBOX'
72
73
//$bmh->moveHard           = true; // default is false
0 ignored issues
show
Unused Code Comprehensibility introduced by
41% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
74
//$bmh->hardMailbox        = 'INBOX.hardtest'; // default is 'INBOX.hard' - NOTE: must start with 'INBOX.'
75
//$bmh->moveSoft           = true; // default is false
76
//$bmh->softMailbox        = 'INBOX.softtest'; // default is 'INBOX.soft' - NOTE: must start with 'INBOX.'
77
//$bmh->deleteMsgDate      = '2009-01-05'; // format must be as 'yyyy-mm-dd'
78
79
/*
80
 * rest used regardless what type of connection it is
81
 */
82
$bmh->openMailbox();
83
$bmh->processMailbox();
84
85
echo '<hr style="width:200px;" />';
86
$time_end = microtime_float();
87
$time = $time_end - $time_start;
88
echo 'Seconds to process: ' . $time . '<br />';
89
90
/**
91
 * @return float
92
 */
93
function microtime_float()
94
{
95
  list($usec, $sec) = explode(' ', microtime());
96
97
  return ((float)$usec + (float)$sec);
98
}
99