mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Replace references to Zend with Laminas
This commit is contained in:
parent
0565553d4a
commit
5838af892f
16 changed files with 43 additions and 37 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Version 0.8.3 (2020-??-??)
|
||||||
|
==========================
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Officially require PHP 7.1 (effectively required since version 0.8.0)
|
||||||
|
|
||||||
Version 0.8.2 (2019-12-07)
|
Version 0.8.2 (2019-12-07)
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ if (\PHP_SAPI === "cli") {
|
||||||
$conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf;
|
$conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf;
|
||||||
Arsse::load($conf);
|
Arsse::load($conf);
|
||||||
// handle Web requests
|
// handle Web requests
|
||||||
$emitter = new \Zend\HttpHandlerRunner\Emitter\SapiEmitter;
|
$emitter = new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
|
||||||
$response = (new REST)->dispatch();
|
$response = (new REST)->dispatch();
|
||||||
$emitter->emit($response);
|
$emitter->emit($response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ use JKingWeb\Arsse\Misc\URL;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequestFactory;
|
use Laminas\Diactoros\ServerRequestFactory;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
class REST {
|
class REST {
|
||||||
const API_LIST = [
|
const API_LIST = [
|
||||||
|
|
|
@ -14,9 +14,9 @@ use JKingWeb\Arsse\Db\ExceptionInput;
|
||||||
use JKingWeb\Arsse\Misc\HTTP;
|
use JKingWeb\Arsse\Misc\HTTP;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Zend\Diactoros\Response\XmlResponse;
|
use Laminas\Diactoros\Response\XmlResponse;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
||||||
const LEVEL = 3;
|
const LEVEL = 3;
|
||||||
|
|
|
@ -19,8 +19,8 @@ use JKingWeb\Arsse\REST\Exception404;
|
||||||
use JKingWeb\Arsse\REST\Exception405;
|
use JKingWeb\Arsse\REST\Exception405;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
|
class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
|
||||||
const REALM = "Nextcloud News API v1-2";
|
const REALM = "Nextcloud News API v1-2";
|
||||||
|
|
|
@ -8,8 +8,8 @@ namespace JKingWeb\Arsse\REST\NextcloudNews;
|
||||||
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
class Versions implements \JKingWeb\Arsse\REST\Handler {
|
class Versions implements \JKingWeb\Arsse\REST\Handler {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
|
@ -20,8 +20,8 @@ use JKingWeb\Arsse\Db\ResultEmpty;
|
||||||
use JKingWeb\Arsse\Feed\Exception as FeedException;
|
use JKingWeb\Arsse\Feed\Exception as FeedException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
||||||
const LEVEL = 14; // emulated API level
|
const LEVEL = 14; // emulated API level
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace JKingWeb\Arsse\REST\TinyTinyRSS;
|
||||||
use JKingWeb\Arsse\Arsse;
|
use JKingWeb\Arsse\Arsse;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\EmptyResponse as Response;
|
use Laminas\Diactoros\Response\EmptyResponse as Response;
|
||||||
|
|
||||||
class Icon extends \JKingWeb\Arsse\REST\AbstractHandler {
|
class Icon extends \JKingWeb\Arsse\REST\AbstractHandler {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
|
@ -13,9 +13,9 @@ use Psr\Http\Message\ResponseInterface;
|
||||||
class TestHTTP extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestHTTP extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
/** @dataProvider provideMediaTypes */
|
/** @dataProvider provideMediaTypes */
|
||||||
public function testMatchMediaType(string $header, array $types, bool $exp) {
|
public function testMatchMediaType(string $header, array $types, bool $exp) {
|
||||||
$msg = (new \Zend\Diactoros\Request)->withHeader("Content-Type", $header);
|
$msg = (new \Laminas\Diactoros\Request)->withHeader("Content-Type", $header);
|
||||||
$this->assertSame($exp, HTTP::matchType($msg, ...$types));
|
$this->assertSame($exp, HTTP::matchType($msg, ...$types));
|
||||||
$msg = (new \Zend\Diactoros\Response)->withHeader("Content-Type", $header);
|
$msg = (new \Laminas\Diactoros\Response)->withHeader("Content-Type", $header);
|
||||||
$this->assertSame($exp, HTTP::matchType($msg, ...$types));
|
$this->assertSame($exp, HTTP::matchType($msg, ...$types));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ use JKingWeb\Arsse\Db\ExceptionInput;
|
||||||
use JKingWeb\Arsse\Db\Transaction;
|
use JKingWeb\Arsse\Db\Transaction;
|
||||||
use JKingWeb\Arsse\REST\Fever\API;
|
use JKingWeb\Arsse\REST\Fever\API;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Zend\Diactoros\Response\XmlResponse;
|
use Laminas\Diactoros\Response\XmlResponse;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\Fever\API<extended> */
|
/** @covers \JKingWeb\Arsse\REST\Fever\API<extended> */
|
||||||
class TestAPI extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestAPI extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
|
@ -16,8 +16,8 @@ use JKingWeb\Arsse\Db\ExceptionInput;
|
||||||
use JKingWeb\Arsse\Db\Transaction;
|
use JKingWeb\Arsse\Db\Transaction;
|
||||||
use JKingWeb\Arsse\REST\NextcloudNews\V1_2;
|
use JKingWeb\Arsse\REST\NextcloudNews\V1_2;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\NextcloudNews\V1_2<extended> */
|
/** @covers \JKingWeb\Arsse\REST\NextcloudNews\V1_2<extended> */
|
||||||
class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
|
@ -8,9 +8,9 @@ namespace JKingWeb\Arsse\TestCase\REST\NextcloudNews;
|
||||||
|
|
||||||
use JKingWeb\Arsse\REST\NextcloudNews\Versions;
|
use JKingWeb\Arsse\REST\NextcloudNews\Versions;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\NextcloudNews\Versions */
|
/** @covers \JKingWeb\Arsse\REST\NextcloudNews\Versions */
|
||||||
class TestVersions extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestVersions extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
|
@ -15,11 +15,11 @@ use JKingWeb\Arsse\REST\NextcloudNews\V1_2 as NCN;
|
||||||
use JKingWeb\Arsse\REST\TinyTinyRSS\API as TTRSS;
|
use JKingWeb\Arsse\REST\TinyTinyRSS\API as TTRSS;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\Request;
|
use Laminas\Diactoros\Request;
|
||||||
use Zend\Diactoros\Response;
|
use Laminas\Diactoros\Response;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\TextResponse;
|
use Laminas\Diactoros\Response\TextResponse;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST */
|
/** @covers \JKingWeb\Arsse\REST */
|
||||||
class TestREST extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestREST extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
|
@ -16,9 +16,9 @@ use JKingWeb\Arsse\Db\ExceptionInput;
|
||||||
use JKingWeb\Arsse\Db\Transaction;
|
use JKingWeb\Arsse\Db\Transaction;
|
||||||
use JKingWeb\Arsse\REST\TinyTinyRSS\API;
|
use JKingWeb\Arsse\REST\TinyTinyRSS\API;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\JsonResponse as Response;
|
use Laminas\Diactoros\Response\JsonResponse as Response;
|
||||||
use Zend\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API<extended>
|
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API<extended>
|
||||||
* @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */
|
* @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */
|
||||||
|
|
|
@ -11,8 +11,8 @@ use JKingWeb\Arsse\User;
|
||||||
use JKingWeb\Arsse\Database;
|
use JKingWeb\Arsse\Database;
|
||||||
use JKingWeb\Arsse\REST\TinyTinyRSS\Icon;
|
use JKingWeb\Arsse\REST\TinyTinyRSS\Icon;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\EmptyResponse as Response;
|
use Laminas\Diactoros\Response\EmptyResponse as Response;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Icon<extended> */
|
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Icon<extended> */
|
||||||
class TestIcon extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestIcon extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
|
@ -18,9 +18,9 @@ use Psr\Http\Message\MessageInterface;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Laminas\Diactoros\ServerRequest;
|
||||||
use Zend\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Zend\Diactoros\Response\XmlResponse;
|
use Laminas\Diactoros\Response\XmlResponse;
|
||||||
|
|
||||||
/** @coversNothing */
|
/** @coversNothing */
|
||||||
abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
|
abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
|
||||||
|
|
Loading…
Reference in a new issue