@@ -197,7 +197,12 @@ public function run($from_file = false, $force = false, $progress = null)
197197
198198 $ last_type = $ last_contrib = '' ;
199199 $ packages = array ();
200- $ packages_phpbb4_only = array ();
200+ $ filtered_packages = array ();
201+ $ branches = ext::get_filtered_repository_branches ();
202+ foreach ($ branches as $ branch )
203+ {
204+ $ filtered_packages [$ branch ] = array ();
205+ }
201206
202207 foreach ($ batch as $ contrib_id => $ revisions )
203208 {
@@ -253,14 +258,17 @@ public function run($from_file = false, $force = false, $progress = null)
253258 $ contrib_url
254259 );
255260
256- if ($ revision [ ' phpbb_version_branch ' ] >= ext:: TITANIA_REPOSITORY_MIN_PHPBB_BRANCH )
261+ foreach ($ filtered_packages as $ branch => $ packages_data )
257262 {
258- $ packages_phpbb4_only = $ this ->repo ->set_release (
259- $ packages_phpbb4_only ,
260- $ revision ['revision_composer_json ' ],
261- $ download_url ,
262- $ contrib_url
263- );
263+ if ($ revision ['phpbb_version_branch ' ] >= $ branch )
264+ {
265+ $ filtered_packages [$ branch ] = $ this ->repo ->set_release (
266+ $ filtered_packages [$ branch ],
267+ $ revision ['revision_composer_json ' ],
268+ $ download_url ,
269+ $ contrib_url
270+ );
271+ }
264272 }
265273
266274 unset($ batch [$ contrib_id ][$ index ]);
@@ -274,18 +282,24 @@ public function run($from_file = false, $force = false, $progress = null)
274282 if (($ group_count % 50 ) === 0 )
275283 {
276284 $ this ->dump_include ($ last_type , $ group , $ packages );
277- $ this ->dump_include ($ last_type , $ group , $ packages_phpbb4_only , ext::TITANIA_REPOSITORY_MIN_PHPBB_BRANCH );
285+ foreach ($ filtered_packages as $ branch => $ packages_data )
286+ {
287+ $ this ->dump_include ($ last_type , $ group , $ packages_data , $ branch );
288+ $ filtered_packages [$ branch ] = array ();
289+ }
278290 $ group_count = 0 ;
279291 $ group ++;
280292 $ packages = array ();
281- $ packages_phpbb4_only = array ();
282293 }
283294 $ group_count ++;
284295 }
285296 if (!empty ($ packages ))
286297 {
287298 $ this ->dump_include ($ last_type , $ group , $ packages );
288- $ this ->dump_include ($ last_type , $ group , $ packages_phpbb4_only , ext::TITANIA_REPOSITORY_MIN_PHPBB_BRANCH );
299+ foreach ($ filtered_packages as $ branch => $ packages_data )
300+ {
301+ $ this ->dump_include ($ last_type , $ group , $ packages_data , $ branch );
302+ }
289303 }
290304
291305 $ next_batch = $ this ->limit ? $ this ->start + $ this ->limit : $ this ->get_total ();
0 commit comments