Skip to content

Commit 07619d0

Browse files
author
dremecker
committed
Cleaning comments
removes french comments and adds a few new comments in english
1 parent 3e24cb4 commit 07619d0

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

runInstallModule.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
$db_initscript = 'bfwmailer_init_db.php';
1212
$process_q_script = 'bfwmailer_process_q.php';
1313

14-
15-
//$result .= "\033[0m\n";
1614
echo "\n".' > Copy script '."\033[0;36m".$process_q_script."\033[0m into /src/cli/";
1715

1816
// We check that our destination file does not exist

src/classes/QueueHandler.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public function __construct(MailerOptions $options)
5959
*/
6060
public function enqueue (\PHPMailer &$email, SendindStatus &$sendingStatus)
6161
{
62-
// Nous traitons notre contenu
62+
// processing email content and retreiving content database id
6363
$cont_id = $this->process_content($email);
6464

65-
// Si nous avons un id, nous construisons le données de l'outbox et nous
66-
// les poussons dans la table prévue à cet effet
65+
// if content processing going well, add email metadata into outbox and
66+
// update the sending status of the whole email
6767
if ($cont_id !== false) {
6868

6969
$out_id = $this->db_outbox->add(
@@ -95,32 +95,34 @@ public function enqueue (\PHPMailer &$email, SendindStatus &$sendingStatus)
9595
*/
9696
public function dequeue (\PHPMailer &$email, SendindStatus &$sendingStatus, $max_sendingAttempts)
9797
{
98-
// we refresh our scheduled elements before going further
98+
// refreshing our scheduled elements before going further
9999
$this->db_outbox->refresh_scheduled(time());
100100

101101
// get the next email to send from the queue
102102
$out_id = $this->db_outbox->get_nextPending($max_sendingAttempts);
103103

104104
if ($out_id !== false) {
105105

106+
// retrieving outbox and content data
106107
$outbox = $this->db_outbox->retrieve($out_id);
107108
$content = $this->db_content->retrieve($outbox[modeles\Outbox::DB_CONT_ID]);
108109

109-
// Nous construisons notre contenu pour injection dans la base
110+
// making email sending status
110111
$sendingStatus->priority = $outbox[modeles\Outbox::DB_PRIORITY];
111112
$sendingStatus->state = $outbox[modeles\Outbox::DB_STATE];
112113
$sendingStatus->error = $outbox[modeles\Outbox::DB_ERROR];
113114
$sendingStatus->attempts = $outbox[modeles\Outbox::DB_ATTEMPTS];
114115
$sendingStatus->lastAction_ts = $outbox[modeles\Outbox::DB_LAST_ACT];
115116

117+
// making email metadata
116118
$this->add_emailAttr($email, $outbox[modeles\Outbox::DB_FROM], 'From');
117119
$this->add_emailAttr($email, $outbox[modeles\Outbox::DB_REPLY], 'ReplyTo');
118120
$this->add_emailAttr($email, $outbox[modeles\Outbox::DB_TO], 'Address');
119121
$this->add_emailAttr($email, $outbox[modeles\Outbox::DB_CC], 'CC');
120122
$this->add_emailAttr($email, $outbox[modeles\Outbox::DB_BCC], 'BCC');
121123

124+
// constructing email content
122125
if ($content !== false) {
123-
124126
$email->Subject = $content[modeles\Content::DB_SUBJECT];
125127
$email->Body = $content[modeles\Content::DB_BODY];
126128
$email->AltBody = $content[modeles\Content::DB_ALT_BODY];
@@ -145,7 +147,6 @@ public function dequeue (\PHPMailer &$email, SendindStatus &$sendingStatus, $max
145147

146148
// flushing old sent emails and old failed emails
147149
$this->clean_db(time() - $this->sent_ttl);
148-
149150
return false;
150151
}
151152

@@ -161,11 +162,12 @@ public function dequeue (\PHPMailer &$email, SendindStatus &$sendingStatus, $max
161162
*/
162163
public function archive (\PHPMailer &$email, $outbox_id = null)
163164
{
164-
// Nous traitons notre contenu
165+
// processing email content and retreiving content database id
165166
$cont_id = $this->process_content($email);
166167

167-
// Si nous avons un id, nous construisons le données de l'outbox et nous
168-
// les poussons dans la table prévue à cet effet
168+
// if content processing going well, add email metadata into sentbox,
169+
// update the last action timestamp of the whole email
170+
// and remove the email metadata from the outbox
169171
if ($cont_id !== false) {
170172

171173
$send_id = $this->db_sentbox->add(

src/classes/modeles/AbstrMailBox.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function is_content_used($cont_id)
9494
* @param string $cc : cc field
9595
* @param string $bcc : bcc field
9696
* @param integer $cont_id : content id
97-
* @param integer $email_id : email id, default = null
9897
* @return mixed : mailbox id corresponding to the added email, or false in case of fail
9998
*/
10099
public function add($from, $reply, $to, $cc, $bcc, $cont_id)

src/classes/modeles/Outbox.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ public function add($from, $reply, $to, $cc, $bcc, $cont_id, $prio = \BfwMailer\
9090
*/
9191
public function get_nextPending($max_sendingAttempts)
9292
{
93-
// Nous construisons nos données pour le test sur l'outbox
94-
$outbox_test = array(
93+
// creating our database outbox conditions for the fetch
94+
$outbox_cond = array(
9595
':pending' => \BfwMailer\SendindStatus::STATE_PENDING,
9696
':failed' => \BfwMailer\SendindStatus::STATE_FAILED,
9797
':maxAttempts' => $max_sendingAttempts,
9898
':actualTime' => time());
9999

100-
// Connexion à la bdd pour récupérer l'email actif avec la plus petite priorité (type)
100+
// retrieving active email with the lower priority
101101
$req = $this->select()->from($this->tableName)
102102
->where('('.self::DB_STATE. '=:pending OR '
103103
.self::DB_STATE. '=:failed) AND '
104104
.self::DB_ATTEMPTS.'<:maxAttempts AND '
105-
.self::DB_LAST_ACT. '<=:actualTime', $outbox_test)
105+
.self::DB_LAST_ACT. '<=:actualTime', $outbox_cond)
106106
->order(self::DB_PRIORITY.' ASC')
107107
->limit(1);
108108
$outbox = $this->fetch_sql($req, 'fetchRow');

src/classes/modeles/Sentbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Sentbox extends AbstrMailBox
1313
/**
1414
* @var string $tableName : table name
1515
*/
16-
protected $tableName = 'bfwmailer_sendbox';
16+
protected $tableName = 'bfwmailer_sentbox';
1717

1818

1919

0 commit comments

Comments
 (0)