Browse Source

eol list model #3

merge-requests/10/merge
JamesRezo 2 years ago
parent
commit
8357d15c40
  1. 1
      CHANGELOG
  2. 2
      README.md
  3. 2
      lang/supportedversions_en.php
  4. 4
      lang/supportedversions_fr.php
  5. 27
      modeles/supportedversions_eol.html
  6. 5
      modeles/supportedversions_table.html
  7. 19
      supportedversions_fonctions.php

1
CHANGELOG

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- `<supportedversions|latest`> model
- `<supportedversions|eol`> model
## [0.2.4] - 2020-10-02
### Changed

2
README.md

@ -9,6 +9,7 @@ SPIP Plugin backport of [PHP Supported Versions](http://php.net/supported-versio
- `<supportedversions|legend>` : colors and style explanations
- `<supportedversions|releases>` : list of releases in JSON
- `<supportedversions|latest>`: list of the latest releases of active branches
- `<supportedversions|eol>`: list of the end of life branches
## Other usage
@ -34,3 +35,4 @@ and call : `/releases.json`
- Hanjo for the Dutch translation
- Nicod_ for BEM and so much
- b_b & marcimat for thier support

2
lang/supportedversions_en.php

@ -20,4 +20,6 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
'php_compatibility' => 'PHP Compatibility',
'last_release' => 'Last release',
'latest_releases' => 'Latest releases',
'current_page' => 'current version',
'eol_page' => 'A table of end of life branches is available.',
];

4
lang/supportedversions_fr.php

@ -22,5 +22,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
'unreleased_definition' => 'Une version qui n\'a pas encore &eacute;t&eacute; publi&eacute;e.',
'php_compatibility' => 'Compatibilit&eacute; PHP',
'last_release' => 'Derni&egrave;re publication',
'latest_releases' => 'Derni&egrave;res versions'
'latest_releases' => 'Derni&egrave;res versions',
'current_page' => 'version maintenue',
'eol_page' => 'Un tableau de la fin de vie des branches est disponible.',
];

27
modeles/supportedversions_eol.html

@ -0,0 +1,27 @@
<B_eol_branches>
<table class="spip">
<thead>
<tr>
<th><:supportedversions:branch:></th>
<th colspan="2"><:date:></th>
<th><:supportedversions:last_release:></th>
<th><:info_notes:></th>
</tr>
</thead>
<tbody>
<BOUCLE_eol_branches(DATA){source table, #NULL|SupportedVersions::eoledBranches}>
<tr>
<td>#BRANCH</td>
<td>
[(#LAST_DATE_RELEASE|affdate)]
</td>
<td>
[(#LAST_DATE_RELEASE|date_relative)]
</td>
<td>#LAST_VERSION_RELEASE</td>
<td>&nbsp;</td>
</tr>
</BOUCLE_eol_branches>
</tbody>
</table>
</B_eol_branches>

5
modeles/supportedversions_table.html

@ -3,7 +3,7 @@
<thead>
<tr>
<th><:supportedversions:branch:></th>
<th><:supportedversions:last_release:></th>
<th colspan="2"><:supportedversions:last_release:></th>
<th><:supportedversions:php_compatibility:></th>
<th><:supportedversions:initial_release:></th>
<th><:supportedversions:active_support_until:></th>
@ -17,6 +17,9 @@
<td>
[(#LAST_DATE_RELEASE|affdate)]
</td>
<td>
[(#LAST_DATE_RELEASE|date_relative)]
</td>
<td>[(#PHP|array_shift)][ - (#PHP|array_pop)]</td>
<td>[(#INITIAL_RELEASE|affdate)]</td>
<td>[(#ACTIVE_SUPPORT|affdate)]</td>

19
supportedversions_fonctions.php

@ -75,6 +75,25 @@ class SupportedVersions
);
}
public static function eoledBranches() {
if (!self::$config) {
self::init();
}
$now = self::$now->format('Y-m-d');
return array_reduce(
self::$releases,
function ($branches, $release) use ($now) {
if ($release['eol'] != '' && $release['eol'] <= $now) {
$branches[] = $release;
}
return $branches;
},
[]
);
}
//Calendar Part
protected static function dateHorizCoord(DateTime $date) {

Loading…
Cancel
Save