| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FirePlugins Framework |
| 4 | - * @version 1.1.149 | |
| 4 | + * @version 1.2.6 | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <[email protected]> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | 8 | * @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| @@ -75,28 +75,23 @@ | ||
| 75 | 75 | { |
| 76 | 76 | return $priorities[$dir]; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $id = PHP_INT_MAX; | |
| 80 | - | |
| 81 | 79 | $version = firepluginsframework_getFrameworkVersion($dir); |
| 82 | - $version = array_map('intval', explode('.', $version)); | |
| 80 | + $version = array_map('intval', array_pad(explode('.', $version), 3, 0)); | |
| 83 | 81 | |
| 84 | - for ($i = 0; $i < count($version); $i++) | |
| 85 | - { | |
| 86 | - if ($i == 0) | |
| 87 | - { | |
| 88 | - $id -= $version[$i] * 105; | |
| 89 | - } | |
| 90 | - else if ($i == 1) | |
| 91 | - { | |
| 92 | - $id -= $version[$i] * 55; | |
| 93 | - } | |
| 94 | - else | |
| 95 | - { | |
| 96 | - $id -= $version[$i]; | |
| 97 | - } | |
| 98 | - } | |
| 82 | + /** | |
| 83 | + * Order the bundled frameworks so the newest one always registers first. | |
| 84 | + * | |
| 85 | + * Each component is weighted so it can never be outranked by the components below it. | |
| 86 | + * The previous weights (105 / 55 / 1) let the patch number outgrow a minor bump, so | |
| 87 | + * 1.1.150 loaded ahead of 1.2.0 and the older framework won. | |
| 88 | + * | |
| 89 | + * Bundles still shipping those weights produce offsets in the low hundreds, so any | |
| 90 | + * bundle using the weights below outranks them. That is the correct outcome, as every | |
| 91 | + * such bundle is by definition newer than the ones using the old weights. | |
| 92 | + */ | |
| 93 | + $id = PHP_INT_MAX - (($version[0] * 1000000) + ($version[1] * 1000) + $version[2]); | |
| 99 | 94 | |
| 100 | 95 | return ($priorities[$dir] = $id); |
| 101 | 96 | } |
| 102 | 97 | } |