@@ -29,7 +29,13 @@ class GedcomParser
2929 protected $ repo_ids = [];
3030 protected $ conn = '' ;
3131
32- public function parse ($ conn , string $ filename , string $ slug , bool $ progressBar = false )
32+ public function parse (
33+ $ conn ,
34+ string $ filename ,
35+ string $ slug ,
36+ bool $ progressBar = false ,
37+ $ channel = ['name ' => 'gedcom-progress ' , 'eventName ' => 'newMessage ' ]
38+ )
3339 {
3440 $ this ->conn = $ conn ;
3541 error_log ('PARSE LOG : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' .$ conn );
@@ -46,14 +52,14 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
4652 $head = $gedcom->getHead();
4753 }
4854 **/
49-
55+
5056 $ subn = [];
5157 $ subm = [];
5258 $ sour = [];
5359 $ note = [];
5460 $ repo = [];
5561 $ obje = [];
56-
62+
5763 if ($ gedcom ->getSubn ())
5864 {
5965 $ subn = $ gedcom ->getSubn ();
@@ -101,7 +107,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
101107 $ complete = 0 ;
102108 if ($ progressBar === true ) {
103109 $ bar = $ this ->getProgressBar (count ($ individuals ) + count ($ families ));
104- event (new GedComProgressSent ($ slug , $ total , $ complete ));
110+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
105111 }
106112 Log::info ('Individual: ' .count ($ individuals ));
107113 Log::info ('Families: ' .count ($ families ));
@@ -124,7 +130,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
124130 if ($ progressBar === true ) {
125131 $ bar ->advance ();
126132 $ complete ++;
127- event (new GedComProgressSent ($ slug , $ total , $ complete ));
133+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
128134 }
129135 }
130136
@@ -139,7 +145,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
139145 if ($ progressBar === true ) {
140146 $ bar ->advance ();
141147 $ complete ++;
142- event (new GedComProgressSent ($ slug , $ total , $ complete ));
148+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
143149 }
144150 }
145151
@@ -150,7 +156,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
150156 if ($ progressBar === true ) {
151157 $ bar ->advance ();
152158 $ complete ++;
153- event (new GedComProgressSent ($ slug , $ total , $ complete ));
159+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
154160 }
155161 }
156162
@@ -166,7 +172,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
166172 if ($ progressBar === true ) {
167173 $ bar ->advance ();
168174 $ complete ++;
169- event (new GedComProgressSent ($ slug , $ total , $ complete ));
175+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
170176 }
171177 }
172178
@@ -181,7 +187,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
181187 if ($ progressBar === true ) {
182188 $ bar ->advance ();
183189 $ complete ++;
184- event (new GedComProgressSent ($ slug , $ total , $ complete ));
190+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
185191 }
186192 }
187193
@@ -199,7 +205,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
199205 if ($ progressBar === true ) {
200206 $ bar ->advance ();
201207 $ complete ++;
202- event (new GedComProgressSent ($ slug , $ total , $ complete ));
208+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
203209 }
204210 }
205211
@@ -208,7 +214,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
208214 if ($ progressBar === true ) {
209215 $ bar ->advance ();
210216 $ complete ++;
211- event (new GedComProgressSent ($ slug , $ total , $ complete ));
217+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
212218 }
213219 }
214220
@@ -242,7 +248,7 @@ public function parse($conn, string $filename, string $slug, bool $progressBar =
242248 if ($ progressBar === true ) {
243249 $ bar ->advance ();
244250 $ complete ++;
245- event (new GedComProgressSent ($ slug , $ total , $ complete ));
251+ event (new GedComProgressSent ($ slug , $ total , $ complete, $ channel ));
246252 }
247253 }
248254
0 commit comments