Browse Source

Release 0.7.0

fix-api
JamesRezo 9 months ago
parent
commit
9a825bf46c
  1. 15
      CHANGELOG
  2. 6
      README.md
  3. 2
      composer.json
  4. 43
      composer.lock
  5. 7
      modeles/supportedversions_spiploaderlist_1.html
  6. 3
      paquet.xml
  7. 7
      spip_loader_list.json.html
  8. 52
      tests/SpipLoaderApiTest.php
  9. 1
      tests/bootstrap.php

15
CHANGELOG

@ -10,10 +10,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
## [0.7.0] - 2022-01-08
### Added
- releases upgrades (SPIP 4.0.1, SPIP 3.2.12)
- add last eol release to `spip_loader.api`
- logical operators for php extensions
- add sha1 file in `releases.json`, `spip_loader.api` and `<supportedversions|release_notes`> model
- `spip_loader.api` experimental v3
- `spip_loader.api` Last_Modified header based on `data/releases.json` and `data/pre_releases.json` mtime
### Changed
- `spip_loader.api` default version is 2 as current version. See [spip_loader_list.json](https://git.spip.net/spip-contrib-outils/spip_loader/src/commit/9853383d7571640f153dc32067b038d96cb160a3/spip_loader_list.json)
### Deprecated
- `spip_loader_list.json` page
- `spip_loader.api` v1
## [0.6.0] - 2021-08-14

6
README.md

@ -36,8 +36,6 @@ Calling `/spip.php?page=releases.json` renders a JSON formatted of releases.
Calling `/spip.php?page=pre_releases.json` renders a JSON formatted of alpha, beta and RC pre-releases.
Calling `/spip.php?page=spip_loader_list.json` renders a JSON formatted for `spip_loader.php` purpose. It accepts a parameter `api` (defaults to 1).
Calling `/spip_loader.api` or `/spip_loader.api/1` for apache httpd server with rewrite mode and `.htaccess` default file exposes the `spip_loader_list.json` JSON. First argument, like `/1` is the `api` parameter.
## .htaccess
@ -61,10 +59,10 @@ RewriteRule ^pre_releases\.json$ spip.php?page=pre_releases.json [QSA,L]
and call : `/pre_releases.json`
```apache
RewriteRule ^spip-dev/INSTALL/spip_loader_list.json$ spip.php?page=spip_loader_list.json [QSA,L]
RewriteRule ^spip-dev/INSTALL/spip_loader_list.json$ spip_loader.api [QSA,L]
```
and call : `/spip-dev/INSTALL/spip_loader_list.json` or `/spip-dev/INSTALL/spip_loader_list.json?api=2` for experimental purpose
and call : `/spip-dev/INSTALL/spip_loader_list.json`
## Thanks

2
composer.json

@ -14,7 +14,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.6.x-dev"
"dev-master": "0.7.x-dev"
}
},
"require-dev": {

43
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6a755d3fbd657648ffcefd91cb4faa57",
"content-hash": "1e77fd259bdf2f616865b22c097bf80c",
"packages": [],
"packages-dev": [
{
@ -542,16 +542,16 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.5.1",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"shasum": ""
},
"require": {
@ -586,9 +586,9 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
},
"time": "2021-10-02T14:08:47+00:00"
"time": "2022-01-04T19:58:01+00:00"
},
{
"name": "phpspec/prophecy",
@ -659,16 +659,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.2.0",
"version": "1.3.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee"
"reference": "151a51f6149855785fbd883e79768c0abc96b75f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee",
"reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/151a51f6149855785fbd883e79768c0abc96b75f",
"reference": "151a51f6149855785fbd883e79768c0abc96b75f",
"shasum": ""
},
"require": {
@ -684,7 +684,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
},
"autoload": {
@ -699,7 +699,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.2.0"
"source": "https://github.com/phpstan/phpstan/tree/1.3.3"
},
"funding": [
{
@ -719,7 +719,7 @@
"type": "tidelift"
}
],
"time": "2021-11-18T14:09:01+00:00"
"time": "2022-01-07T09:49:03+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -2222,21 +2222,24 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.23.0",
"version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
"reference": "30885182c981ab175d4d034db0f6f469898070ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
"reference": "30885182c981ab175d4d034db0f6f469898070ab",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
@ -2281,7 +2284,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0"
},
"funding": [
{
@ -2297,7 +2300,7 @@
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
"time": "2021-10-20T20:35:02+00:00"
},
{
"name": "theseer/tokenizer",

7
modeles/supportedversions_spiploaderlist_1.html

@ -1,4 +1,9 @@
#SET{list, #ARRAY{dev,spip/dev/spip-master.zip}}
[(#REM)
@deprecated 0.7.0
@see action_api_spip_loader_dist()
]#SET{list, #ARRAY{dev,spip/dev/spip-master.zip}}
<BOUCLE_pre_releases(DATA){source json, #CHEMIN{data/pre_releases.json}}{branch=#VAL{future}|SupportedVersions::getBranchesFromState|table_valeur{0/branch}}>
<BOUCLE_releases(DATA){source table, #PRE_RELEASES}{par released_at}{inverse}{0,1}>
<BOUCLE_download(DATA){source table, #DOWNLOAD}>#SET{file, #URL|replace{https://files.spip.net/}}</BOUCLE_download>

3
paquet.xml

@ -1,9 +1,10 @@
<paquet
categorie="date"
prefix="supportedversions"
version="0.6.0"
version="0.7.0"
etat="experimental"
compatibilite="[3.2.999;["
documentation="https://gitlab.com/JamesRezo/supported-versions/-/blob/master/README.md"
>
<nom>SPIP: Supported Versions</nom>
<pipeline nom="insert_head_css" />

7
spip_loader_list.json.html

@ -1,4 +1,9 @@
#HTTP_HEADER{Content-Type: application/json}#HTTP_HEADER{Access-Control-Allow-Origin: *}[
[(#REM)
@deprecated 0.7.0
@see action_api_spip_loader_dist()
]#HTTP_HEADER{Content-Type: application/json}#HTTP_HEADER{Access-Control-Allow-Origin: *}[
{
"api": (#ENV{api}|intval|sinon{#SUPPORTED_VERSIONS{spip_loader_api_default}})[,
"versions": (#MODELE{supportedversions_spiploaderlist_#ENV{api}|intval|sinon{#SUPPORTED_VERSIONS{spip_loader_api_default}}})]

52
tests/SpipLoaderApiTest.php

@ -42,4 +42,56 @@ class SpipLoaderApiTest extends TestCase
//Then
$this->assertEquals($expected, $actual);
}
public function dataGetMTime()
{
return [
'found' => [1628961121, __DIR__ . '/releases/init.json'],
'not found' => [0, ''],
];
}
/**
* @covers ::get_mtime
* @dataProvider dataGetMTime
*
* @return void
*/
public function testGetMTime($expected, $filename)
{
// Given
// When
$actual = get_mtime($filename);
// Then
$this->assertEquals($expected, $actual);
}
public function dataGetLastModified()
{
return [
'releases' => ['Last-Modified: Fri, 05 Nov 1971 18:40:12 GMT', '1970-11-05 21:00:00.000000Z'],
'preReleases' => ['Last-Modified: Wed, 01 Dec 1971 21:00:00 GMT', '1971-12-01 21:00:00.000000Z'],
];
}
/**
* @covers ::last_modified
* @dataProvider dataGetLastModified
*
* @return void
*/
public function testGetLastModified($expected, $preReleases)
{
// Given
$releases = \DateTime::createFromFormat('Y-m-d H:i:s.uZ', $this->now)->format('U');
// When
$preReleases = \DateTime::createFromFormat('Y-m-d H:i:s.uZ', $preReleases)->format('U');
$actual = last_modified($releases, $preReleases);
// Then
$this->assertEquals($expected, $actual);
}
}

1
tests/bootstrap.php

@ -2,3 +2,4 @@
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../supportedversions_fonctions.php';
require_once __DIR__ . '/../action/api_spip_loader.php';

Loading…
Cancel
Save