Compare commits

..

9 Commits

62 changed files with 13655 additions and 16 deletions

37
.github/workflows/pages.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Deploy Documentation
on:
push:
branches: [ "main" ]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
GitHubPages:
name: GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'doc/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
/.phpdoc/cache/
/.vscode/
/vendor/
.php-cs-fixer.cache
.php-cs-fixer.php
composer.lock
phpcs.xml

View File

@ -0,0 +1,34 @@
.. title:: Changelog
Changelog
#########
.. sidebar:: Table of Contents
.. contents::
v1.1.0
======
**New Features:**
* Extended `documentation <https://opencultureconsulting.github.io/psr-15/>`_
**Minor Changes:**
* Added Composer commands for development tools (PHP_CodeSniffer, PHP-CS-Fixer, PHPStan, Psalm and phpDocumentor)
**Maintencance:**
* Updated dependencies
v1.0.1
======
**Maintenance:**
* Updated dependencies
v1.0.0
======
**Initial Release**

11
.phpdoc/guide/index.rst Normal file
View File

@ -0,0 +1,11 @@
.. title:: PSR-15 Queue
Documentation
#############
.. toctree::
:maxdepth: 2
overview/index
usage/index
changelog

View File

@ -0,0 +1,52 @@
.. title:: AbstractMiddleware
AbstractMiddleware
##################
.. sidebar:: Table of Contents
.. contents::
The `AbstractMiddleware` is a little helper for creating your own middlewares. It processes the incoming request before
handing it over to the next middleware in line, and later processes the response before returning it to the previous
middleware. Originally both methods just return their argument unchanged, so you should implement either one of them or
both as needed.
The `AbstractMiddleware` implements the `Psr\Http\Server\MiddlewareInterface` following PHP-FIG's recommendation
`PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_.
Properties
==========
The `AbstractMiddleware` has a single protected property `AbstractMiddleware::requestHandler` referencing the request
handler which called the middleware. This can be used to access the request and/or response object (as properties of
:doc:`queuerequesthandler`) when they are otherwise not available.
Methods
=======
The `AbstractMiddleware` provides one public API method and two protected methods. While the former is final and makes
sure it implements the `Psr\Http\Server\MiddlewareInterface`, the latter are intended to be extended in your own class.
The main :php:method:`OCC\PSR15\AbstractMiddleware::process()` method implements the interface and is also called when
invoking the middleware object directly. It first passes the incoming request to the
:php:method:`OCC\PSR15\AbstractMiddleware::processRequest()` method, then hands over the result to the request handler
to receive a response, which is then processed by :php:method:`OCC\PSR15\AbstractMiddleware::processResponse()` before
returning it back to the request handler again.
Processing a Request
--------------------
The default method of `AbstractMiddleware` just returns the request unchanged. If you need to process the request, you
have to implement your own `processRequest()` method. It takes a request object as only argument and must return a
valid request object as well. Just make sure it follows PHP-FIG's standard recommendation
`PSR-7: HTTP Message Interfaces <https://www.php-fig.org/psr/psr-7/>`_ and implements the
`Psr\Http\Message\ServerRequestInterface`.
Processing a Response
---------------------
The default method of `AbstractMiddleware` just returns the response unchanged. If you need to process the response,
you have to implement your own `processResponse()` method. It takes a response object as only argument and must return
a valid response object as well. Just make sure it follows PHP-FIG's standard recommendation
`PSR-7: HTTP Message Interfaces <https://www.php-fig.org/psr/psr-7/>`_ and implements the
`Psr\Http\Message\ResponseInterface`.

View File

@ -0,0 +1,22 @@
.. title:: Overview
Overview
########
The package contains an implementation of `PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_
in a queue-based variant. A :doc:`queuerequesthandler` handles an incoming HTTP request by passing it through a queue
of one or more middlewares. The :doc:`middlewarequeue` provides the middlewares in first-in, first-out (FIFO) order,
i.e. the HTTP request is passed from middleware to middleware preserving the order in which the middlewares were added
to the queue. An :doc:`abstractmiddleware` helps developing your own middlewares, but you can also use any middleware
implementing the `Psr\Http\Server\MiddlewareInterface <https://packagist.org/packages/psr/http-server-middleware>`_.
All files share the highest coding standards of `PHPStan <https://phpstan.org/>`_ and `Psalm <https://psalm.dev/>`_,
and full `PSR-12 <https://www.php-fig.org/psr/psr-12/>`_ compliance to make sure they can be combined and easily used
in other projects.
.. toctree::
:maxdepth: 2
queuerequesthandler
middlewarequeue
abstractmiddleware

View File

@ -0,0 +1,66 @@
.. title:: MiddlewareQueue
MiddlewareQueue
###############
.. sidebar:: Table of Contents
.. contents::
The `MiddlewareQueue` manages the middlewares involved in processing a server request. It makes sure they are called in
first-in, first-out (FIFO) order, i.e. the same order they were added to the queue. It also ensures all middlewares are
implementing the `PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_ specification for the
`Psr\Http\Server\MiddlewareInterface`.
When instantiating a `MiddlewareQueue` it defaults to being empty. But you can optionally pass an iterable set of
middlewares to the constructor which are then put into the queue. To demonstrate, the following examples both have
exactly the same result.
Examples:
.. code-block:: php
use OCC\PSR15\MiddlewareQueue;
$middlewares = [
new MiddlewareOne(),
new MiddlewareTwo()
];
$queue = new MiddlewareQueue($middlewares);
.. code-block:: php
use OCC\PSR15\MiddlewareQueue;
$queue = new MiddlewareQueue();
$queue->enqueue(new MiddlewareOne());
$queue->enqueue(new MiddlewareTwo());
The `MiddlewareQueue` is based on a `OCC\Basics\DataStructures\StrictQueue`.
Methods
=======
The `MiddlewareQueue` provides a set of API methods, with `MiddlewareQueue::enqueue()` and `MiddlewareQueue::dequeue()`
being the most relevant ones. The former will add a new item at the end of the queue while the latter removes and
returns the first item from the queue.
For a complete API documentation have a look at the
`StrictQueue <https://opencultureconsulting.github.io/php-basics/classes/OCC-Basics-DataStructures-StrictQueue.html>`_.
Adding a Middleware
-------------------
Invoking `MiddlewareQueue::enqueue()` will add a middleware at the end of the queue. The only argument must be a
middleware object implementing the `Psr\Http\Server\MiddlewareInterface`. If the given argument does not meet the
criterion an `OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException` is thrown.
Have a look at the :doc:`abstractmiddleware` for an easy way to create your own middlewares!
Fetching the next in line
-------------------------
Calling `MiddlewareQueue::dequeue()` will return the first middleware from the queue, i.e. the oldest one on the queue.
Also, this middleware is removed from the queue.
If the queue is empty a `RuntimeException` is thrown, so make sure to check the queue's length (e.g. with `count()`)
before trying to dequeue an item!

View File

@ -0,0 +1,108 @@
.. title:: QueueRequestHandler
QueueRequestHandler
###################
.. sidebar:: Table of Contents
.. contents::
The `QueueRequestHandler` is the core piece of this package. It fetches incoming HTTP requests, passes them through a
queue of middlewares and finally sends the response back to the client. It also catches any exceptions not handled by
a middleware and turns them into a proper HTTP error response.
The `QueueRequestHandler` implements the `Psr\Http\Server\RequestHandlerInterface` following PHP-FIG's recommendation
`PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_.
For a minimal working example have a look at :doc:`../usage/usage`.
Properties
==========
The `QueueRequestHandler` has three **read-only** properties. They are initially set at instantiation and can be
directly accessed from the object via magic methods (e.g. `$requestHandler->queue`).
Middleware Queue
----------------
The queue of middlewares can be accessed as `QueueRequestHandler::queue` and offers a handy API to `enqueue()`,
`dequeue()` or otherwise manipulate its contents. All middlewares must implement `Psr\Http\Server\MiddlewareInterface`.
Have a look at :doc:`middlewarequeue` for more details.
When instantiating a `QueueRequestHandler` the queue defaults to being empty. But you can optionally pass an iterable
set of middlewares to the constructor which are then put into the queue. To demonstrate, the following examples both
have exactly the same result.
Examples:
.. code-block:: php
use OCC\PSR15\QueueRequestHandler;
$middlewares = [
new MiddlewareOne(),
new MiddlewareTwo()
];
$requestHandler = new QueueRequestHandler($middlewares);
.. code-block:: php
use OCC\PSR15\QueueRequestHandler;
$requestHandler = new QueueRequestHandler();
$requestHandler->queue->enqueue(new MiddlewareOne());
$requestHandler->queue->enqueue(new MiddlewareTwo());
HTTP Server Request
-------------------
The server request is always available as `QueueRequestHandler::request`. It follows PHP-FIG's standard recommendation
`PSR-7: HTTP Message Interfaces <https://www.php-fig.org/psr/psr-7/>`_ and implements the
`Psr\Http\Message\ServerRequestInterface`.
When instantiating a `QueueRequestHandler` the `$request` property is initially set by fetching the actual server
request data from superglobals. The property is reset each time the request is passed through a middleware and thus
always represents the current state of the request.
HTTP Response
-------------
The response can be read as `QueueRequestHandler::response`. It also follows PHP-FIG's standard recommendation
`PSR-7: HTTP Message Interfaces <https://www.php-fig.org/psr/psr-7/>`_ and implements the
`Psr\Http\Message\ResponseInterface`.
When instantiating a `QueueRequestHandler` the `$response` property is initially set as a blank HTTP response with
status code `200`. The property is reset each time the response is passed through a middleware and thus
always represents the latest state of the response.
Both, request and response, use the awesome implementations of `Guzzle <https://github.com/guzzle/psr7>`_.
Methods
=======
The `QueueRequestHandler` provides two public API methods, :php:method:`OCC\PSR15\QueueRequestHandler::handle()` and
:php:method:`OCC\PSR15\QueueRequestHandler::respond()`. As their names suggest, the former handles the server request
while the latter sends the response back to the client. Invoking the request handler object directly does the same as
calling the `handle()` method.
Handling a Server Request
-------------------------
After adding at least one middleware to the queue, you can start handling a request by simply calling
:php:method:`OCC\PSR15\QueueRequestHandler::handle()`. Optionally, you can pass a request object as argument, but since
the actual server request was already fetched in the constructor and will be used by default, most of the time you
don't need to. All request objects must implement `Psr\Http\Message\ServerRequestInterface`.
The `handle()` method returns the final response after passing it through all middlewares. The response object always
implements `Psr\Http\Message\ResponseInterface`.
In case of an error the request handler catches any exception and creates a response with the exception code as status
code (if it's within the valid range of HTTP status codes, otherwise it's set to `500 (Internal Server Error)`), and
the exception message as body.
Sending the Response
--------------------
Sending the final response to the client is as easy as calling :php:method:`OCC\PSR15\QueueRequestHandler::respond()`.
Optionally, you can provide an exit code as argument (an integer in the range `0` to `254`). If you do so, script
execution is stopped after sending out the response and the given exit status is set. The status `0` means the request
was handled successfully, every other status is considered an error.

View File

@ -0,0 +1,15 @@
.. title:: User Guide
User Guide
##########
The *Queue-based HTTP Server Request Handler* is a library package, not a stand-alone application. The following
documentation of requirements and installation procedures describes how to make use of the classes within your own
application. For a detailed description of the package's contents have a look at the :doc:`../overview/index` page.
.. toctree::
:maxdepth: 2
requirements
installation
usage

View File

@ -0,0 +1,59 @@
.. title:: Installation
Installation
############
.. sidebar:: Table of Contents
.. contents::
Composer
========
The intended and recommended way of re-using this package is via `Composer <https://getcomposer.org/>`_. The following
command will get you the latest version and make it a dependency of your project. It will also request all dependencies
and register all classes with the autoloader to make them available inside the application.
.. code-block:: shell
# This will install the latest stable version suitable for your project
composer require "opencultureconsulting/psr15"
If you want to use a specific version other than the latest available for your environment, you can do so by appending
the desired version constraint:
.. code-block:: shell
# This will install the latest patch level version of 1.1 (i. e. >=1.1.0 && <1.2.0)
composer require "opencultureconsulting/psr15:~1.1"
All available versions as well as further information about :doc:`requirements` and dependencies can be found on
`Packagist <https://packagist.org/packages/opencultureconsulting/psr15>`_.
Git
===
Alternatively, you can fetch the files from `GitHub <https://github.com/opencultureconsulting/psr-15>`_ and add them to
your project manually. The best way is by cloning the repository, because then you can easily update to a newer version
by just pulling the changes and checking out a different version tag.
.. code-block:: shell
# This will clone the repository into the "psr15" directory
git clone https://github.com/opencultureconsulting/psr-15.git psr15
If you want to use a specific version other than the latest development state, you have to specify the desired tag as
well:
.. code-block:: shell
# This will clone the repository state at version "1.1.0" into the "psr15" directory
git clone --branch=v1.1.0 https://github.com/opencultureconsulting/psr-15.git psr15
Be aware that you also need to make the classes available in your application by either adding them to your autoloader
or by including all files individually in PHP. Also don't forget to do the same for all :doc:`requirements`.
Download
========
As a last resort you can also just download the files. You can find all available versions as well as the current
development state on the `GitHub release page <https://github.com/opencultureconsulting/psr-15/releases>`_.

View File

@ -0,0 +1,27 @@
.. title:: Requirements
Requirements
############
Environment
===========
This package requires at least **PHP 8.1**.
It is highly recommended to use `Composer <https://getcomposer.org/>`_ for dependency management and autoloading,
although it is technically not strictly required for using any of these classes. But it certainly makes it a lot
easier!
Dependencies
============
This package obviously depends on `psr/http-server-handler <https://packagist.org/packages/psr/http-server-handler>`_
and `psr/http-server-middleware <https://packagist.org/packages/psr/http-server-middleware>`_ which define the standard
`PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_ interfaces.
It uses the `PSR-7: HTTP Message <https://www.php-fig.org/psr/psr-7/>`_ implementations for server request and response
of the great `guzzlehttp/psr7 <https://packagist.org/packages/guzzlehttp/psr7>`_ library.
The middleware queue is based on a `StrictQueue <https://opencultureconsulting.github.io/php-basics/guides/overview/datastructures.html#strictqueue>`_
of the `opencultureconsulting/basics <https://packagist.org/packages/opencultureconsulting/basics>`_ package which also
provides some useful traits.

View File

@ -0,0 +1,157 @@
.. title:: Usage
Usage
#####
.. sidebar:: Table of Contents
.. contents::
The following example shows a very basic *Queue-based HTTP Server Request Handler* using just two simple middlewares
(called `MiddlewareOne` and `MiddlewareTwo`).
Middlewares
===========
First of all, we need some middlewares to process our server request. Although we could use any middleware implementing
the `Psr/Http/Server/MiddlewareInterface` (e.g. from `this great collection <https://github.com/middlewares>`_), we
will write our own using the :doc:`../overview/abstractmiddleware` provided by this package.
The abstract middleware already implements a complete middleware, but it will just pass requests through without doing
anything. In order to have it do something, we need to implement our own :php:method:`OCC\PSR15\AbstractMiddleware::processRequest()`
or :php:method:`OCC\PSR15\AbstractMiddleware::processResponse()` method, or both of them.
The logic here is the same as with every `PSR-15: HTTP Server Request Handlers <https://www.php-fig.org/psr/psr-15/>`_
middleware: The request gets passed through all middlewares' `processRequest()` methods in order of their addition to
the queue, then a response is created and passed through all `processResponse()` methods, **but in reverse order**! So
the first middleware in the queue gets the request first, but the response last.
Our first middleware is very simple and just adds an attribute to the server request.
.. code-block:: php
use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareOne extends AbstractMiddleware
{
/**
* Process an incoming server request before delegating to next middleware.
*
* @param ServerRequest $request The incoming server request
*
* @return ServerRequest The processed server request
*/
protected function processRequest(ServerRequest $request): ServerRequest
{
// Let's just add a new attribute to the request to later check
// which middleware was passed last.
return $request->withAttribute('LastMiddlewarePassed', 'MiddlewareOne');
}
}
For a queue to make sense we need at least a second middleware, so let's create another one. Again, we will add an
attribute to the request, but with the same name. So, whichever middleware handles the request last overwrites the
attribute with its value. This way we can later check if our middlewares were passed in the correct order.
.. code-block:: php
use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareTwo extends AbstractMiddleware
{
/**
* Process an incoming server request before delegating to next middleware.
*
* @param ServerRequest $request The incoming server request
*
* @return ServerRequest The processed server request
*/
protected function processRequest(ServerRequest $request): ServerRequest
{
// We add the same request attribute as in MiddlewareOne, effectively
// overwriting its value.
return $request->withAttribute('LastMiddlewarePassed', 'MiddlewareTwo');
}
}
Also, we want to set the status code of the response according to the final value of our request attribute. Therefore,
we need to implement `processResponse()` as well. We can do that in either one of our middlewares because it's the only
response manipulation in our example, so the order of processing doesn't make a difference (remember: `MiddlewareTwo`
gets to handle the response before `MiddlewareOne`). Let's go with `MiddlewareTwo`.
.. code-block:: php
use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareTwo extends AbstractMiddleware
{
// MiddlewareTwo::processRequest() remains unchanged (see above).
/**
* Process an incoming response before returning it to previous middleware.
*
* @param Response $response The incoming response
*
* @return Response The processed response
*/
protected function processResponse(Response $response): Response
{
// First we need to get the request attribute.
$lastMiddlewarePassed = $this->requestHandler->request->getAttribute('LastMiddlewarePassed');
if ($lastMiddlewarePassed === 'MiddlewareTwo') {
// Great, MiddlewareTwo was passed after MiddlewareOne,
// let's return status code 200!
return $response->withStatus(200);
} else {
// Oh no, something went wrong! We'll send status code 500.
return $response->withStatus(500);
}
}
}
Well done! We now have two middlewares.
Request Handler
===============
Let's use a :doc:`../overview/queuerequesthandler` to pass a server request through both of our middlewares in the
correct order.
.. code-block:: php
use OCC\PSR15\QueueRequestHandler;
// First of all, we instantiate the request handler.
// At this point we could already provide an array of middlewares as argument and
// skip the next step, but then we wouldn't learn how to use the MiddlewareQueue.
$requestHandler = new QueueRequestHandler();
// We can access the MiddlewareQueue as a property of the request handler.
// Let's add both of our middlewares, MiddlewareOne and MiddlewareTwo. Since
// this is a FIFO queue, the order is very important!
$requestHandler->queue->enqueue(new MiddlewareOne());
$requestHandler->queue->enqueue(new MiddlewareTwo());
// And we are ready to handle incoming requests!
// We don't even need to pass the server request to this method, because
// the constructor already took care of that!
$finalResponse = $requestHandler->handle();
// Now we can pass the final response back to our application.
// Alternatively, we can also return it directly to the client.
$requestHandler->respond();
// If we did everything right, the client should now receive an HTTP response
// with status code 200 (OK).
And that's it!
Diving Deeper
=============
To familiarize yourself with the FIFO principle of the middleware queue, you can try to exchange the two lines adding
the middlewares to the queue, i.e. add `MiddlewareTwo` first and `MiddlewareOne` second. This will result in an HTTP
response with status code `500 (Internal Server Error)`.
This is exactly what we intended: Have a look at `MiddlewareTwo::processResponse()` again! If `$lastMiddlewarePassed`
is not `MiddlewareTwo` (which it isn't when `MiddlewareOne` is added to the queue after `MiddlewareTwo`), we set the
response status code to `500`.

View File

@ -0,0 +1,31 @@
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
{% for version in project.versions %}
{% for toc in version.tableOfContents %}
<section class="phpdocumentor-sidebar__category -{{ toc.name|lower }}">
<h2 class="phpdocumentor-sidebar__category-header">{{ toc.name|title }}</h2>
{% for root in toc.roots %}
{{ toc(root, 'components/menu.html.twig', 1) }}
{% endfor %}
</section>
{% endfor %}
{% endfor %}
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
{% if project.settings.custom['graphs.enabled'] %}
<h3 class="phpdocumentor-sidebar__root-package"><a href="graphs/classes.html">Class Diagram</a></h3>
{% endif %}
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>

View File

@ -0,0 +1,19 @@
{% for version in project.versions %}
{% for toc in version.tableOfContents|filter(toc => toc.name|lower == "documentation" or toc.name|lower == "packages") %}
<h4 id="toc-{{ toc.name|lower }}">{{ toc.name|title }}</h4>
<dl class="phpdocumentor-table-of-contents">
{% for root in toc.roots %}
<dt class="phpdocumentor-table-of-contents__entry -{{ toc.name|lower|trim('s', 'right') }}">
<a href="{{ root.url }}">{{ root.title|shortFQSEN }}</a>
</dt>
{% if root.children.count > 0 %}
<dd>
{% for child in root.children %}
<a href="{{ child.url }}">{{ child.title|shortFQSEN }}</a><br/>
{% endfor %}
</dd>
{% endif %}
{% endfor %}
</dl>
{% endfor %}
{% endfor %}

View File

@ -0,0 +1,30 @@
{%
set topMenu = {
"menu": [
{ "iconClass": "fab fa-php", "url": "https://packagist.org/packages/opencultureconsulting/basics"},
{ "iconClass": "fab fa-github", "url": "https://github.com/opencultureconsulting/php-basics"}
]
}
%}
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
{% for key,menu in topMenu|default([]) %}
{% for menuitem in menu %}
<li class="phpdocumentor-topnav__menu-item -{{ key }}">
<a href="{{ menuitem.url }}">
<span>
{% if menuitem.icon %}
<i class="fab fa-{{ menuitem.icon }}">{{ menuitem.icon }}</i>
{% endif %}
{% if menuitem.iconClass %}
<i class="{{ menuitem.iconClass }}"></i>
{% endif %}
{{ menuitem.name }}
</span>
</a>
</li>
{% endfor %}
{% endfor %}
</ul>
</nav>

View File

@ -0,0 +1,134 @@
aside.phpdocumentor-sidebar
{
display: flex;
flex-direction: column;
}
aside.phpdocumentor-sidebar
section.-documentation
{
order: 1;
}
aside.phpdocumentor-sidebar
section.-packages
{
order: 2;
}
aside.phpdocumentor-sidebar
section.-namespaces
{
order: 3;
}
aside.phpdocumentor-sidebar
section.-reports
{
order: 4;
}
aside.phpdocumentor-sidebar
section.-indices
{
order: 5;
}
aside.phpdocumentor-sidebar
ul.phpdocumentor-list
{
padding: 0 var(--spacing-md) !important;
}
p > code,
li > code,
code.prettyprint
{
background-color: var(--code-background-color);
border: 1px solid #f0f0f0;
border-radius: var(--border-radius-base-size);
box-sizing: border-box;
font-size: var(--text-sm);
padding: var(--spacing-xxxs);
}
@media (max-width: 999px) {
div.admonition-wrapper
{
display: none;
}
}
@media (min-width: 1000px) {
div.admonition-wrapper
{
display: block;
float: right;
padding: var(--spacing-md);
margin: 0 0 var(--spacing-md) var(--spacing-md);
width: auto;
font-size: var(--text-sm);
border: 1px solid var(--primary-color-lighten);
}
}
div.admonition-wrapper
p.sidebar-title
{
font-weight: bold;
}
div.contents
ul.phpdocumentor-list
{
margin-bottom: 0;
}
div.phpdocumentor-content
div.section
ul
{
padding-left: var(--spacing-lg);
}
div.phpdocumentor-content
div.section
ul
li
{
padding-bottom: 0;
}
dl.phpdocumentor-table-of-contents
dt.phpdocumentor-table-of-contents__entry.-documentation:before
{
content: 'D';
}
h2.phpdocumentor-content__title
{
display: flex;
flex-direction: column;
}
h2.phpdocumentor-content__title
div.phpdocumentor-element__package
{
order: 1;
}
h2.phpdocumentor-content__title
span.phpdocumentor-element__extends,
h2.phpdocumentor-content__title
span.phpdocumentor-element__implements
{
font-size: calc(var(--text-xxs) / 1.2 / 1.2);
order: 2;
}
h2.phpdocumentor-content__title
span:first-letter
{
text-transform: lowercase;
}

View File

@ -0,0 +1,30 @@
{% extends 'base.html.twig' %}
{% block content %}
<section>
<ul class="phpdocumentor-breadcrumbs">
<li><a href>Home</a></li>
</ul>
<h2 class="phpdocumentor-content__title">Queue-based HTTP Server Request Handler</h2>
<p class="phpdocumentor-summary">An implementation of <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP
Server Request Handlers</a>.</p>
<p>The PHP Standard Recommendation PSR-15 defines interfaces for server request handlers and proposes a queue-based
implementation using different middlewares for processing requests and preparing responses. This package follows
those guidelines and provides a <a href="guides/overview/queuerequesthandler.html">HTTP server request handler</a>
implementation using a <a href="guides/overview/middlewarequeue.html">middleware queue</a>. It also contains an
<a href="guides/overview/abstractmiddleware.html">abstract class for middlewares</a> to ease the process of writing
your own middleware, but you can just as well use any middleware that implements the middleware interface specified
by PSR-15 (e.g. from the awesome <a href="https://github.com/middlewares">PSR-15 HTTP Middlewares</a> project).</p>
<p>All components of this package follow the highest coding standards of <a href="https://phpstan.org/">PHPStan</a>
and <a href="https://psalm.dev/">Psalm</a>, and comply to <a href="https://www.php-fig.org/psr/psr-12/">PSR-12</a>
code style guidelines to make sure they can be combined and easily re-used in other projects.</p>
<h3 id="toc">Table of Contents</h3>
{% include('components/toc.html.twig') %}
</section>
{% endblock %}

View File

@ -1,6 +1,29 @@
# Queue-based HTTP Server Request Handler
[![PHPStan](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpstan.yml/badge.svg)](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpstan.yml)
***An implementation of [PSR-15: HTTP Server Request Handlers](https://www.php-fig.org/psr/psr-15/).***
The PHP Standard Recommendation PSR-15 defines interfaces for server request handlers and proposes a queue-based implementation using different middlewares for processing requests and preparing responses. This package follows those guidelines and provides a [HTTP server request handler](src/QueueRequestHandler.php) implementation using a [middleware queue](src/MiddlewareQueue.php). It also contains an [abstract class for middlewares](src/AbstractMiddleware.php) to ease the process of writing your own middleware, but you can just as well use any middleware that implements `Psr\Http\Server\MiddlewareInterface` specified by PSR-15 (e.g. from the awesome [PSR-15 HTTP Middlewares](https://github.com/middlewares) project).
All components of this package follow the highest coding standards of [PHPStan](https://phpstan.org/) and [Psalm](https://psalm.dev/), and comply to [PSR-12](https://www.php-fig.org/psr/psr-12/) code style guidelines to make sure they can be combined and easily used in other projects.
## Quick Start
The intended and recommended way of using this package is via [Composer](https://getcomposer.org/). The following command will get you the latest version:
```shell
composer require opencultureconsulting/psr15
```
All available versions as well as further information about requirements and dependencies can be found on [Packagist](https://packagist.org/packages/opencultureconsulting/psr15).
## Full Documentation
The full documentation is available on [GitHub Pages](https://opencultureconsulting.github.io/psr-15/) or alternatively in [doc/](doc/).
## Quality Gates
[![PHPCS](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpcs.yml/badge.svg)](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpcs.yml)
[![PHPMD](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpmd.yml/badge.svg)](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpmd.yml)
This is a queue-based implementation of [PSR-15: HTTP Server Request Handler](https://www.php-fig.org/psr/psr-15/) for your PHP projects.
[![PHPStan](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpstan.yml/badge.svg)](https://github.com/opencultureconsulting/psr-15/actions/workflows/phpstan.yml)
[![Psalm](https://github.com/opencultureconsulting/psr-15/actions/workflows/psalm.yml/badge.svg)](https://github.com/opencultureconsulting/psr-15/actions/workflows/psalm.yml)

View File

@ -31,16 +31,17 @@
"require": {
"php": "^8.1",
"guzzlehttp/psr7": "^2.6",
"opencultureconsulting/basics": "^2.0",
"opencultureconsulting/basics": "^2.1",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-strict-rules": "^1.5",
"friendsofphp/php-cs-fixer": "^3.52",
"squizlabs/php_codesniffer": "^3.9",
"vimeo/psalm": "^5.23"
"phpdocumentor/shim": "^3.5",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-strict-rules": "^1.6",
"friendsofphp/php-cs-fixer": "^3.59",
"squizlabs/php_codesniffer": "^3.10",
"vimeo/psalm": "^5.25"
},
"provide": {
"psr/http-server-handler-implementation": "1.0",
@ -50,5 +51,38 @@
"psr-4": {
"OCC\\PSR15\\": "src/"
}
},
"config": {
"allow-plugins": {
"phpdocumentor/shim": true
}
},
"scripts": {
"php-cs-fixer:check": [
"@php vendor/bin/php-cs-fixer check"
],
"php-cs-fixer:fix": [
"@php vendor/bin/php-cs-fixer fix"
],
"phpcs:check": [
"@php vendor/bin/phpcs"
],
"phpdoc:build": [
"@php vendor/bin/phpdoc"
],
"phpstan:check": [
"@php vendor/bin/phpstan"
],
"psalm:check": [
"@php vendor/bin/psalm"
]
},
"scripts-descriptions": {
"php-cs-fixer:check": "Runs a code check with PHP Coding Standards Fixer and reports problems. If a custom configuration file '.php-cs-fixer.php' exists, it will be used instead of the default settings in '.php-cs-fixer.dist.php'.",
"php-cs-fixer:fix": "Runs a code check with PHP Coding Standards Fixer and tries to fix all issues. If a custom configuration file '.php-cs-fixer.php' exists, it will be used instead of the default settings in '.php-cs-fixer.dist.php'.",
"phpcs:check": "Runs a code check with PHP_CodeSniffer and reports problems. If a custom configuration file '.phpcs.xml' exists, it will be used instead of the default settings in '.phpcs.xml.dist'.",
"phpdoc:build": "Builds the documentation from source files in ./src and additional templates in .phpdoc/. If a custom configuration file 'phpdoc.xml' exists, it will be used instead of the default settings in 'phpdoc.dist.xml'.",
"phpstan:check": "Runs a code check with PHPStan static code analyzer and reports problems. If a custom configuration file 'phpstan.neon' exists, it will be used instead of the default settings in 'phpstan.dist.neon'.",
"psalm:check": "Runs a code check with Psalm static code analyzer and reports problems. If a custom configuration file 'psalm.xml' exists, it will be used instead of the default settings in 'psalm.xml.dist'."
}
}

View File

@ -0,0 +1,679 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ.html">OCC</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-psr15.html">PSR15</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
AbstractMiddleware
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/PSR15.html">PSR15</a></li>
</ul>
</div>
<span class="phpdocumentor-element__implements">
implements
<abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr> </span>
</h2>
<div class="phpdocumentor-label-line">
<div class="phpdocumentor-label phpdocumentor-label--success"><span>Abstract</span><span>Yes</span></div>
</div>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/AbstractMiddleware.php"><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">36</span>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#source-view.36" class="phpdocumentor-element-found-in__source" data-line="36" data-modal="source-view" data-src="files/src/AbstractMiddleware.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Abstract class implementing \Psr\Http\Server\MiddlewareInterface.</p>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="classes/OCC-PSR15-AbstractMiddleware.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>Sebastian Meyer <a href="mailto:sebastian.meyer@opencultureconsulting.com">sebastian.meyer@opencultureconsulting.com</a></p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="classes/OCC-PSR15-AbstractMiddleware.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-interfaces">
Interfaces
<a href="classes/OCC-PSR15-AbstractMiddleware.html#toc-interfaces" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -interface"><abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr></dt> </dl>
<h4 id="toc-methods">
Methods
<a href="classes/OCC-PSR15-AbstractMiddleware.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-AbstractMiddleware.html#method___invoke">__invoke()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
<dd>Allow the middleware to be invoked directly.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-AbstractMiddleware.html#method_process">process()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
<dd>Process an incoming server request and produce a response.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a class="" href="classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest">processRequest()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr> </span>
</dt>
<dd>Process an incoming server request before delegating to next middleware.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a class="" href="classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse">processResponse()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
<dd>Process an incoming response before returning it to previous middleware.</dd>
</dl>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/OCC-PSR15-AbstractMiddleware.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
-final "
>
<h4 class="phpdocumentor-element__name" id="method___invoke">
__invoke()
<a href="classes/OCC-PSR15-AbstractMiddleware.html#method___invoke" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/AbstractMiddleware.php"><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">103</span>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#source-view.103" class="phpdocumentor-element-found-in__source" data-line="103" data-modal="source-view" data-src="files/src/AbstractMiddleware.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Allow the middleware to be invoked directly.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__final">final</span> <span class="phpdocumentor-signature__name">__invoke</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$request</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$handler</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$request</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The server request to process</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$handler</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The request handler to delegate to</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>The response object</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
-final "
>
<h4 class="phpdocumentor-element__name" id="method_process">
process()
<a href="classes/OCC-PSR15-AbstractMiddleware.html#method_process" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/AbstractMiddleware.php"><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">57</span>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#source-view.57" class="phpdocumentor-element-found-in__source" data-line="57" data-modal="source-view" data-src="files/src/AbstractMiddleware.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Process an incoming server request and produce a response.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__final">final</span> <span class="phpdocumentor-signature__name">process</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$request</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$handler</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
<div class="phpdocumentor-label phpdocumentor-label--success"><span>API</span><span>Yes</span></div>
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$request</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The server request to process</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$handler</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The request handler to delegate to</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>The response object</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_processRequest">
processRequest()
<a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/AbstractMiddleware.php"><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">78</span>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#source-view.78" class="phpdocumentor-element-found-in__source" data-line="78" data-modal="source-view" data-src="files/src/AbstractMiddleware.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Process an incoming server request before delegating to next middleware.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">processRequest</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$request</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$request</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The incoming server request</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>The processed server request</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_processResponse">
processResponse()
<a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/AbstractMiddleware.php"><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">90</span>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#source-view.90" class="phpdocumentor-element-found-in__source" data-line="90" data-modal="source-view" data-src="files/src/AbstractMiddleware.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Process an incoming response before returning it to previous middleware.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">processResponse</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$response</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$response</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The incoming response</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>The processed response</p>
</section>
</section>
</article>
</section>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/AbstractMiddleware.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="classes/OCC-PSR15-AbstractMiddleware.html#toc-methods">Methods</a></li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Methods</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/OCC-PSR15-AbstractMiddleware.html#method___invoke">__invoke()</a></li>
<li class=""><a href="classes/OCC-PSR15-AbstractMiddleware.html#method_process">process()</a></li>
<li class=""><a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest">processRequest()</a></li>
<li class=""><a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse">processResponse()</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="classes/OCC-PSR15-AbstractMiddleware.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,509 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ.html">OCC</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-psr15.html">PSR15</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
MiddlewareQueue
<span class="phpdocumentor-element__extends">
extends <abbr title="\OCC\Basics\DataStructures\StrictQueue">StrictQueue</abbr>
</span>
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/PSR15.html">PSR15</a></li>
</ul>
</div>
<span class="phpdocumentor-element__extends">
uses
<abbr title="\OCC\Basics\Traits\Singleton">Singleton</abbr> </span>
</h2>
<div class="phpdocumentor-label-line">
</div>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/MiddlewareQueue.php"><a href="files/src-middlewarequeue.html"><abbr title="src/MiddlewareQueue.php">MiddlewareQueue.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">39</span>
<a href="classes/OCC-PSR15-MiddlewareQueue.html#source-view.39" class="phpdocumentor-element-found-in__source" data-line="39" data-modal="source-view" data-src="files/src/MiddlewareQueue.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Queue of PSR-15 Middlewares to process HTTP Server Requests.</p>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="classes/OCC-PSR15-MiddlewareQueue.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>Sebastian Meyer <a href="mailto:sebastian.meyer@opencultureconsulting.com">sebastian.meyer@opencultureconsulting.com</a></p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="classes/OCC-PSR15-MiddlewareQueue.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-methods">
Methods
<a href="classes/OCC-PSR15-MiddlewareQueue.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-MiddlewareQueue.html#method_getInstance">getInstance()</a>
<span>
&nbsp;: static </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -method -private">
<a class="" href="classes/OCC-PSR15-MiddlewareQueue.html#method___construct">__construct()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Create a queue of PSR-15 compatible middlewares.</dd>
</dl>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/OCC-PSR15-MiddlewareQueue.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
-static "
>
<h4 class="phpdocumentor-element__name" id="method_getInstance">
getInstance()
<a href="classes/OCC-PSR15-MiddlewareQueue.html#method_getInstance" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/MiddlewareQueue.php"><a href="files/src-middlewarequeue.html"><abbr title="src/MiddlewareQueue.php">MiddlewareQueue.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">0</span>
<a href="classes/OCC-PSR15-MiddlewareQueue.html#source-view.0" class="phpdocumentor-element-found-in__source" data-line="0" data-modal="source-view" data-src="files/src/MiddlewareQueue.php.txt"></a>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">getInstance</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$middlewares</span><span> = </span><span class="phpdocumentor-signature__argument__default-value"></span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">static</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$middlewares</span>
: <span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;</span>
= <span class="phpdocumentor-signature__argument__default-value"></span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">static</span>
</section>
</article>
<article
class="phpdocumentor-element
-method
-private
"
>
<h4 class="phpdocumentor-element__name" id="method___construct">
__construct()
<a href="classes/OCC-PSR15-MiddlewareQueue.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/MiddlewareQueue.php"><a href="files/src-middlewarequeue.html"><abbr title="src/MiddlewareQueue.php">MiddlewareQueue.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">50</span>
<a href="classes/OCC-PSR15-MiddlewareQueue.html#source-view.50" class="phpdocumentor-element-found-in__source" data-line="50" data-modal="source-view" data-src="files/src/MiddlewareQueue.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Create a queue of PSR-15 compatible middlewares.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$middlewares</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">[]</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$middlewares</span>
: <span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;</span>
= <span class="phpdocumentor-signature__argument__default-value">[]</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Initial set of PSR-15 middlewares</p>
</section>
</dd>
</dl>
</article>
</section>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/MiddlewareQueue.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="classes/OCC-PSR15-MiddlewareQueue.html#toc-methods">Methods</a></li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Methods</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/OCC-PSR15-MiddlewareQueue.html#method_getInstance">getInstance()</a></li>
<li class=""><a href="classes/OCC-PSR15-MiddlewareQueue.html#method___construct">__construct()</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="classes/OCC-PSR15-MiddlewareQueue.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,818 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ.html">OCC</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-psr15.html">PSR15</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
QueueRequestHandler
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/PSR15.html">PSR15</a></li>
</ul>
</div>
<span class="phpdocumentor-element__implements">
implements
<abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr> </span>
<span class="phpdocumentor-element__extends">
uses
<abbr title="\OCC\Basics\Traits\Getter">Getter</abbr> </span>
</h2>
<div class="phpdocumentor-label-line">
</div>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">54</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.54" class="phpdocumentor-element-found-in__source" data-line="54" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">A queue-based PSR-15 HTTP Server Request Handler.</p>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="classes/OCC-PSR15-QueueRequestHandler.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>Sebastian Meyer <a href="mailto:sebastian.meyer@opencultureconsulting.com">sebastian.meyer@opencultureconsulting.com</a></p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="classes/OCC-PSR15-QueueRequestHandler.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-interfaces">
Interfaces
<a href="classes/OCC-PSR15-QueueRequestHandler.html#toc-interfaces" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -interface"><abbr title="\Psr\Http\Server\RequestHandlerInterface">RequestHandlerInterface</abbr></dt> </dl>
<h4 id="toc-properties">
Properties
<a href="classes/OCC-PSR15-QueueRequestHandler.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -property -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#property_queue">$queue</a>
<span>
&nbsp;: <a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a> </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -property -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#property_request">$request</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr> </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -property -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#property_response">$response</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
</dl>
<h4 id="toc-methods">
Methods
<a href="classes/OCC-PSR15-QueueRequestHandler.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#method___construct">__construct()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Create a queue-based PSR-15 HTTP Server Request Handler.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#method___invoke">__invoke()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
<dd>Allow the request handler to be invoked directly.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#method_handle">handle()</a>
<span>
&nbsp;: <abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr> </span>
</dt>
<dd>Handles a request by invoking a queue of middlewares.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond">respond()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Return the current response to the client.</dd>
</dl>
<section class="phpdocumentor-properties">
<h3 class="phpdocumentor-elements__header" id="properties">
Properties
<a href="classes/OCC-PSR15-QueueRequestHandler.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="
phpdocumentor-element
-property
-public
-read-only "
>
<h4 class="phpdocumentor-element__name" id="property_queue">
$queue
<a href="classes/OCC-PSR15-QueueRequestHandler.html#property_queue" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
<small class="phpdocumentor-element__modifier">read-only</small> </span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">0</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.0" class="phpdocumentor-element-found-in__source" data-line="0" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__type"><a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a></span>
<span class="phpdocumentor-signature__name">$queue</span>
</code>
</article>
<article
class="
phpdocumentor-element
-property
-public
-read-only "
>
<h4 class="phpdocumentor-element__name" id="property_request">
$request
<a href="classes/OCC-PSR15-QueueRequestHandler.html#property_request" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
<small class="phpdocumentor-element__modifier">read-only</small> </span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">0</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.0" class="phpdocumentor-element-found-in__source" data-line="0" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr></span>
<span class="phpdocumentor-signature__name">$request</span>
</code>
</article>
<article
class="
phpdocumentor-element
-property
-public
-read-only "
>
<h4 class="phpdocumentor-element__name" id="property_response">
$response
<a href="classes/OCC-PSR15-QueueRequestHandler.html#property_response" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
<small class="phpdocumentor-element__modifier">read-only</small> </span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">0</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.0" class="phpdocumentor-element-found-in__source" data-line="0" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
<span class="phpdocumentor-signature__name">$response</span>
</code>
</article>
</section>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/OCC-PSR15-QueueRequestHandler.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method___construct">
__construct()
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">225</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.225" class="phpdocumentor-element-found-in__source" data-line="225" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Create a queue-based PSR-15 HTTP Server Request Handler.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$middlewares</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">[]</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$middlewares</span>
: <span class="phpdocumentor-signature__argument__return-type">iterable&lt;string|int, <abbr title="\Psr\Http\Server\MiddlewareInterface">MiddlewareInterface</abbr>&gt;</span>
= <span class="phpdocumentor-signature__argument__default-value">[]</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Initial set of middlewares</p>
</section>
</dd>
</dl>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method___invoke">
__invoke()
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method___invoke" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">239</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.239" class="phpdocumentor-element-found-in__source" data-line="239" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Allow the request handler to be invoked directly.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">__invoke</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$request</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$request</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>|null</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The PSR-7 server request to handle</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>A PSR-7 compatible HTTP response</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_handle">
handle()
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method_handle" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">94</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.94" class="phpdocumentor-element-found-in__source" data-line="94" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Handles a request by invoking a queue of middlewares.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">handle</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$request</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span></code>
<div class="phpdocumentor-label-line">
<div class="phpdocumentor-label phpdocumentor-label--success"><span>API</span><span>Yes</span></div>
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$request</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\ServerRequestInterface">ServerRequestInterface</abbr>|null</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The PSR-7 server request to handle</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><abbr title="\Psr\Http\Message\ResponseInterface">ResponseInterface</abbr></span>
&mdash;
<section class="phpdocumentor-description"><p>A PSR-7 compatible HTTP response</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_respond">
respond()
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/QueueRequestHandler.php"><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">141</span>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#source-view.141" class="phpdocumentor-element-found-in__source" data-line="141" data-modal="source-view" data-src="files/src/QueueRequestHandler.php.txt"></a>
</aside>
<p class="phpdocumentor-summary">Return the current response to the client.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">respond</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">int|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$exitCode</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<div class="phpdocumentor-label-line">
<div class="phpdocumentor-label phpdocumentor-label--success"><span>API</span><span>Yes</span></div>
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$exitCode</span>
: <span class="phpdocumentor-signature__argument__return-type">int|null</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Exit status after sending out the response or NULL to continue</p>
<p>Must be in the range 0 to 254. The status 0 is used to terminate the program successfully.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><abbr title="\RuntimeException">RuntimeException</abbr></span>
<section class="phpdocumentor-description"><p>if headers were already sent</p>
</section>
</dd>
</dl>
</article>
</section>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/QueueRequestHandler.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="classes/OCC-PSR15-QueueRequestHandler.html#toc-properties">Properties</a></li>
<li><a href="classes/OCC-PSR15-QueueRequestHandler.html#toc-methods">Methods</a></li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Properties</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#property_queue">$queue</li>
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#property_request">$request</li>
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#property_response">$response</li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Methods</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#method___construct">__construct()</a></li>
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#method___invoke">__invoke()</a></li>
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#method_handle">handle()</a></li>
<li class=""><a href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond">respond()</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="classes/OCC-PSR15-QueueRequestHandler.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

1236
doc/css/base.css Normal file

File diff suppressed because it is too large Load Diff

427
doc/css/normalize.css vendored Normal file
View File

@ -0,0 +1,427 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none !important;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: var(--font-monospace);
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

409
doc/css/template.css Normal file
View File

@ -0,0 +1,409 @@
.phpdocumentor-content {
position: relative;
display: flex;
gap: var(--spacing-md);
}
.phpdocumentor-content > section:first-of-type {
width: 75%;
flex: 1 1 auto;
}
@media (min-width: 1900px) {
.phpdocumentor-content > section:first-of-type {
width: 100%;
flex: 1 1 auto;
}
}
.phpdocumentor .phpdocumentor-content__title {
margin-top: 0;
}
.phpdocumentor-summary {
font-style: italic;
}
.phpdocumentor-description {
margin-bottom: var(--spacing-md);
}
.phpdocumentor-element {
position: relative;
}
.phpdocumentor-element .phpdocumentor-element {
border: 1px solid var(--primary-color-lighten);
margin-bottom: var(--spacing-md);
padding: var(--spacing-xs);
border-radius: 5px;
}
.phpdocumentor-element.-deprecated .phpdocumentor-element__name {
text-decoration: line-through;
}
@media (min-width: 550px) {
.phpdocumentor-element .phpdocumentor-element {
margin-bottom: var(--spacing-lg);
padding: var(--spacing-md);
}
}
.phpdocumentor-element__modifier {
font-size: var(--text-xxs);
padding: calc(var(--spacing-base-size) / 4) calc(var(--spacing-base-size) / 2);
color: var(--text-color);
background-color: var(--light-gray);
border-radius: 3px;
text-transform: uppercase;
}
.phpdocumentor .phpdocumentor-elements__header {
margin-top: var(--spacing-xxl);
margin-bottom: var(--spacing-lg);
}
.phpdocumentor .phpdocumentor-element__name {
line-height: 1;
margin-top: 0;
font-weight: 300;
font-size: var(--text-lg);
word-break: break-all;
margin-bottom: var(--spacing-sm);
}
@media (min-width: 550px) {
.phpdocumentor .phpdocumentor-element__name {
font-size: var(--text-xl);
margin-bottom: var(--spacing-xs);
}
}
@media (min-width: 1200px) {
.phpdocumentor .phpdocumentor-element__name {
margin-bottom: var(--spacing-md);
}
}
.phpdocumentor-element__package,
.phpdocumentor-element__extends,
.phpdocumentor-element__implements {
display: block;
font-size: var(--text-xxs);
font-weight: normal;
opacity: .7;
}
.phpdocumentor-element__package .phpdocumentor-breadcrumbs {
display: inline;
}
.phpdocumentor .phpdocumentor-signature {
display: block;
font-size: var(--text-sm);
border: 1px solid #f0f0f0;
}
.phpdocumentor .phpdocumentor-signature.-deprecated .phpdocumentor-signature__name {
text-decoration: line-through;
}
@media (min-width: 550px) {
.phpdocumentor .phpdocumentor-signature {
margin-left: calc(var(--spacing-xl) * -1);
width: calc(100% + var(--spacing-xl));
}
}
.phpdocumentor-table-of-contents {
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry {
margin-bottom: var(--spacing-xxs);
margin-left: 2rem;
display: flex;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > a {
flex: 0 1 auto;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > a.-deprecated {
text-decoration: line-through;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > span {
flex: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry:after {
content: '';
height: 12px;
width: 12px;
left: 16px;
position: absolute;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-private:after {
background: url('data:image/svg+xml;utf8,<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="4" width="8" height="6" rx="1.4" fill="%23EE6749"/><path d="M2 4C2 3 2.4 1 4 1C5.6 1 6 3 6 4" stroke="%23EE6749" stroke-width="1.4"/></svg>') no-repeat;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-protected:after {
left: 13px;
background: url('data:image/svg+xml;utf8,<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="8" height="6" rx="1.4" fill="%23EE9949"/><path d="M5 4C5 3 4.6 1 3 1C1.4 1 1 3 1 4" stroke="%23EE9949" stroke-width="1.4"/></svg>') no-repeat;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry:before {
width: 1.25rem;
height: 1.25rem;
line-height: 1.25rem;
background: transparent url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="hsl( 36, 57%, 60%)"/></svg>') no-repeat center center;
content: '';
position: absolute;
left: 0;
border-radius: 50%;
font-weight: 600;
color: white;
text-align: center;
font-size: .75rem;
margin-top: .2rem;
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-method:before {
content: 'M';
color: '';
background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="hsl( 36, 57%, 60%)"/></svg>');
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-function:before {
content: 'M';
color: ' 36';
background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="hsl( 36, 57%, 60%)"/></svg>');
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-property:before {
content: 'P'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-constant:before {
content: 'C';
background-color: transparent;
background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="-3.05176e-05" y="9.99998" width="14.1422" height="14.1422" transform="rotate(-45 -3.05176e-05 9.99998)" fill="hsl( 36, 57%, 60%)"/></svg>');
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-class:before {
content: 'C'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-interface:before {
content: 'I'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-trait:before {
content: 'T'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-namespace:before {
content: 'N'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-package:before {
content: 'P'
}
.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-enum:before {
content: 'E'
}
.phpdocumentor-table-of-contents dd {
font-style: italic;
margin-left: 2rem;
}
.phpdocumentor-element-found-in {
display: none;
}
@media (min-width: 550px) {
.phpdocumentor-element-found-in {
display: block;
font-size: var(--text-sm);
color: gray;
margin-bottom: 1rem;
}
}
@media (min-width: 1200px) {
.phpdocumentor-element-found-in {
position: absolute;
top: var(--spacing-sm);
right: var(--spacing-sm);
font-size: var(--text-sm);
margin-bottom: 0;
}
}
.phpdocumentor-element-found-in .phpdocumentor-element-found-in__source {
flex: 0 1 auto;
display: inline-flex;
}
.phpdocumentor-element-found-in .phpdocumentor-element-found-in__source:after {
width: 1.25rem;
height: 1.25rem;
line-height: 1.25rem;
background: transparent url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="gray"><path d="M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8l3.147-3.146zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8l-3.147-3.146z" stroke="gray" stroke-width="1.4"/></svg>') no-repeat center center;
content: '';
left: 0;
border-radius: 50%;
font-weight: 600;
text-align: center;
font-size: .75rem;
margin-top: .2rem;
}
.phpdocumentor-class-graph {
width: 100%; height: 600px; border:1px solid black; overflow: hidden
}
.phpdocumentor-class-graph__graph {
width: 100%;
}
.phpdocumentor-tag-list__definition {
display: flex;
}
.phpdocumentor-tag-link {
margin-right: var(--spacing-sm);
}
aside.phpdocumentor-sidebar
{
display: flex;
flex-direction: column;
}
aside.phpdocumentor-sidebar
section.-documentation
{
order: 1;
}
aside.phpdocumentor-sidebar
section.-packages
{
order: 2;
}
aside.phpdocumentor-sidebar
section.-namespaces
{
order: 3;
}
aside.phpdocumentor-sidebar
section.-reports
{
order: 4;
}
aside.phpdocumentor-sidebar
section.-indices
{
order: 5;
}
aside.phpdocumentor-sidebar
ul.phpdocumentor-list
{
padding: 0 var(--spacing-md) !important;
}
p > code,
li > code,
code.prettyprint
{
background-color: var(--code-background-color);
border: 1px solid #f0f0f0;
border-radius: var(--border-radius-base-size);
box-sizing: border-box;
font-size: var(--text-sm);
padding: var(--spacing-xxxs);
}
@media (max-width: 999px) {
div.admonition-wrapper
{
display: none;
}
}
@media (min-width: 1000px) {
div.admonition-wrapper
{
display: block;
float: right;
padding: var(--spacing-md);
margin: 0 0 var(--spacing-md) var(--spacing-md);
width: auto;
font-size: var(--text-sm);
border: 1px solid var(--primary-color-lighten);
}
}
div.admonition-wrapper
p.sidebar-title
{
font-weight: bold;
}
div.contents
ul.phpdocumentor-list
{
margin-bottom: 0;
}
div.phpdocumentor-content
div.section
ul
{
padding-left: var(--spacing-lg);
}
div.phpdocumentor-content
div.section
ul
li
{
padding-bottom: 0;
}
dl.phpdocumentor-table-of-contents
dt.phpdocumentor-table-of-contents__entry.-documentation:before
{
content: 'D';
}
h2.phpdocumentor-content__title
{
display: flex;
flex-direction: column;
}
h2.phpdocumentor-content__title
div.phpdocumentor-element__package
{
order: 1;
}
h2.phpdocumentor-content__title
span.phpdocumentor-element__extends,
h2.phpdocumentor-content__title
span.phpdocumentor-element__implements
{
font-size: calc(var(--text-xxs) / 1.2 / 1.2);
order: 2;
}
h2.phpdocumentor-content__title
span:first-letter
{
text-transform: lowercase;
}

View File

@ -0,0 +1,347 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -file">
<h2 class="phpdocumentor-content__title">AbstractMiddleware.php</h2>
<p class="phpdocumentor-summary">Queue-based PSR-15 HTTP Server Request Handler
Copyright (C) 2023 Sebastian Meyer &lt;sebastian.meyer@opencultureconsulting.com&gt;</p>
<section class="phpdocumentor-description"><p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
</section>
<h3 id="toc">
Table of Contents
<a href="files/src-abstractmiddleware.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="files/src-abstractmiddleware.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-AbstractMiddleware.html"><abbr title="\OCC\PSR15\AbstractMiddleware">AbstractMiddleware</abbr></a></dt><dd>Abstract class implementing \Psr\Http\Server\MiddlewareInterface.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/AbstractMiddleware.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="files/src-abstractmiddleware.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="files/src-abstractmiddleware.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,347 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -file">
<h2 class="phpdocumentor-content__title">MiddlewareQueue.php</h2>
<p class="phpdocumentor-summary">Queue-based PSR-15 HTTP Server Request Handler
Copyright (C) 2023 Sebastian Meyer &lt;sebastian.meyer@opencultureconsulting.com&gt;</p>
<section class="phpdocumentor-description"><p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
</section>
<h3 id="toc">
Table of Contents
<a href="files/src-middlewarequeue.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="files/src-middlewarequeue.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a></dt><dd>Queue of PSR-15 Middlewares to process HTTP Server Requests.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/MiddlewareQueue.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="files/src-middlewarequeue.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="files/src-middlewarequeue.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,347 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -file">
<h2 class="phpdocumentor-content__title">QueueRequestHandler.php</h2>
<p class="phpdocumentor-summary">Queue-based PSR-15 HTTP Server Request Handler
Copyright (C) 2023 Sebastian Meyer &lt;sebastian.meyer@opencultureconsulting.com&gt;</p>
<section class="phpdocumentor-description"><p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
</section>
<h3 id="toc">
Table of Contents
<a href="files/src-queuerequesthandler.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="files/src-queuerequesthandler.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-QueueRequestHandler.html"><abbr title="\OCC\PSR15\QueueRequestHandler">QueueRequestHandler</abbr></a></dt><dd>A queue-based PSR-15 HTTP Server Request Handler.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/QueueRequestHandler.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="files/src-queuerequesthandler.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="files/src-queuerequesthandler.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,107 @@
<?php
/**
* Queue-based PSR-15 HTTP Server Request Handler
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace OCC\PSR15;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
/**
* Abstract class implementing \Psr\Http\Server\MiddlewareInterface.
*
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
* @package PSR15
*/
abstract class AbstractMiddleware implements MiddlewareInterface
{
/**
* The PSR-15 Server Request Handler.
*
* @var QueueRequestHandler
*
* @internal
*/
protected QueueRequestHandler $requestHandler;
/**
* Process an incoming server request and produce a response.
*
* @param ServerRequest $request The server request to process
* @param RequestHandler $handler The request handler to delegate to
*
* @return Response The response object
*
* @api
*/
final public function process(ServerRequest $request, RequestHandler $handler): Response
{
/** @var QueueRequestHandler $handler */
$this->requestHandler = $handler;
// Manipulate request if necessary.
$request = $this->processRequest($request);
// Delegate request to next middleware and get response.
$response = $handler->handle($request);
// Manipulate response if necessary.
$response = $this->processResponse($response);
// Return response to previous middleware.
return $response;
}
/**
* Process an incoming server request before delegating to next middleware.
*
* @param ServerRequest $request The incoming server request
*
* @return ServerRequest The processed server request
*/
protected function processRequest(ServerRequest $request): ServerRequest
{
return $request;
}
/**
* Process an incoming response before returning it to previous middleware.
*
* @param Response $response The incoming response
*
* @return Response The processed response
*/
protected function processResponse(Response $response): Response
{
return $response;
}
/**
* Allow the middleware to be invoked directly.
*
* @param ServerRequest $request The server request to process
* @param RequestHandler $handler The request handler to delegate to
*
* @return Response The response object
*/
final public function __invoke(ServerRequest $request, RequestHandler $handler): Response
{
return $this->process($request, $handler);
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* Queue-based PSR-15 HTTP Server Request Handler
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace OCC\PSR15;
use OCC\Basics\DataStructures\StrictQueue;
use OCC\Basics\Traits\Singleton;
use Psr\Http\Server\MiddlewareInterface as Middleware;
/**
* Queue of PSR-15 Middlewares to process HTTP Server Requests.
*
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
* @package PSR15
*
* @method static static getInstance(iterable<\Psr\Http\Server\MiddlewareInterface> $middlewares)
*
* @extends StrictQueue<Middleware>
*/
class MiddlewareQueue extends StrictQueue
{
use Singleton;
/**
* Create a queue of PSR-15 compatible middlewares.
*
* @param iterable<array-key, Middleware> $middlewares Initial set of PSR-15 middlewares
*
* @return void
*/
private function __construct(iterable $middlewares = [])
{
parent::__construct([Middleware::class]);
$this->append(...$middlewares);
}
}

View File

@ -0,0 +1,243 @@
<?php
/**
* Queue-based PSR-15 HTTP Server Request Handler
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace OCC\PSR15;
use Exception;
use RuntimeException;
use GuzzleHttp\Psr7\Response as GuzzleResponse;
use GuzzleHttp\Psr7\ServerRequest as GuzzleRequest;
use OCC\Basics\Traits\Getter;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
use Psr\Http\Server\MiddlewareInterface as Middleware;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
use function array_keys;
use function count;
use function filter_var;
use function get_debug_type;
use function header;
use function headers_sent;
use function is_null;
use function sprintf;
/**
* A queue-based PSR-15 HTTP Server Request Handler.
*
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
* @package PSR15
*
* @property-read MiddlewareQueue $queue
* @property-read ServerRequest $request
* @property-read Response $response
*/
class QueueRequestHandler implements RequestHandler
{
use Getter;
/**
* The PSR-7 HTTP Server Request.
*
* @var ServerRequest
*
* @internal
*/
protected ServerRequest $request;
/**
* The queue of middlewares to process the server request.
*
* @var MiddlewareQueue
*
* @internal
*/
protected MiddlewareQueue $queue;
/**
* The PSR-7 HTTP Response.
*
* @var Response
*
* @internal
*/
protected Response $response;
/**
* Handles a request by invoking a queue of middlewares.
*
* @param ?ServerRequest $request The PSR-7 server request to handle
*
* @return Response A PSR-7 compatible HTTP response
*
* @api
*/
public function handle(?ServerRequest $request = null): Response
{
$this->request = $request ?? $this->request;
if (count($this->queue) > 0) {
$middleware = $this->queue->dequeue();
// It is RECOMMENDED that any application using middleware includes a
// component that catches exceptions and converts them into responses.
// This middleware SHOULD be the first component executed and wrap all
// further processing to ensure that a response is always generated.
try {
$this->response = $middleware->process($this->request, $this);
} catch (Exception $exception) {
$options = [
'options' => [
'default' => 500,
'min_range' => 100,
'max_range' => 599
]
];
$statusCode = filter_var($exception->getCode(), FILTER_VALIDATE_INT, $options);
$this->response = new GuzzleResponse(
$statusCode,
[],
sprintf(
'Exception thrown in middleware %s: %s',
get_debug_type($middleware),
$exception->getMessage()
)
);
}
}
return $this->response;
}
/**
* Return the current response to the client.
*
* @param ?int $exitCode Exit status after sending out the response or NULL to continue
*
* Must be in the range 0 to 254. The status 0 is used to terminate the program successfully.
*
* @return void
*
* @throws RuntimeException if headers were already sent
*
* @api
*/
public function respond(?int $exitCode = null): void
{
$file = 'unknown file';
$line = 0;
if (headers_sent($file, $line)) {
throw new RuntimeException(
sprintf(
'Headers already sent in %s on line %d',
$file,
$line
)
);
}
header(
sprintf(
'HTTP/%s %d %s',
$this->response->getProtocolVersion(),
$this->response->getStatusCode(),
$this->response->getReasonPhrase()
),
true
);
foreach (array_keys($this->response->getHeaders()) as $name) {
/** @var string $name */
$header = sprintf('%s: %s', $name, $this->response->getHeaderLine($name));
header($header, false);
}
echo $this->response->getBody();
if (!is_null($exitCode)) {
$options = [
'options' => [
'default' => 1,
'min_range' => 0,
'max_range' => 254
]
];
$exitCode = filter_var($exitCode, FILTER_VALIDATE_INT, $options);
exit($exitCode);
}
}
/**
* Magic getter method for $this->queue.
*
* @return MiddlewareQueue The queue of PSR-15 middlewares
*
* @internal
*/
protected function _magicGetQueue(): MiddlewareQueue
{
return $this->queue;
}
/**
* Magic getter method for $this->request.
*
* @return ServerRequest The PSR-7 server request
*
* @internal
*/
protected function _magicGetRequest(): ServerRequest
{
return $this->request;
}
/**
* Magic getter method for $this->response.
*
* @return Response The PSR-7 response
*
* @internal
*/
protected function _magicGetResponse(): Response
{
return $this->response;
}
/**
* Create a queue-based PSR-15 HTTP Server Request Handler.
*
* @param iterable<array-key, Middleware> $middlewares Initial set of middlewares
*
* @return void
*/
public function __construct(iterable $middlewares = [])
{
$this->request = GuzzleRequest::fromGlobals();
$this->queue = MiddlewareQueue::getInstance($middlewares);
$this->response = new GuzzleResponse(200);
}
/**
* Allow the request handler to be invoked directly.
*
* @param ?ServerRequest $request The PSR-7 server request to handle
*
* @return Response A PSR-7 compatible HTTP response
*/
public function __invoke(?ServerRequest $request = null): Response
{
return $this->handle($request);
}
}

176
doc/graphs/classes.html Normal file
View File

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<script src='https://unpkg.com/panzoom@8.7.3/dist/panzoom.min.js'></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="phpdocumentor-class-graph">
<img class="phpdocumentor-class-graph__graph" src="graphs/classes.svg" id="scene" />
</div>
<script type="text/javascript">
var element = document.querySelector('#scene');
// And pass it to panzoom
panzoom(element, {
smoothScroll: false
})
</script>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="graphs/classes.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

274
doc/guides/changelog.html Normal file
View File

@ -0,0 +1,274 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="changelog">
<h1>Changelog</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/changelog.html#v1-1-0">v1.1.0</a>
</li>
<li class="toc-item">
<a href="guides/changelog.html#v1-0-1">v1.0.1</a>
</li>
<li class="toc-item">
<a href="guides/changelog.html#v1-0-0">v1.0.0</a>
</li>
</ul>
</div>
</div>
</div>
<div class="section" id="v1-1-0">
<h2>v1.1.0</h2>
<p><strong>New Features:</strong>
</p>
<ul>
<li>Extended <a href="https://opencultureconsulting.github.io/psr-15/">documentation</a></li>
</ul>
<p><strong>Minor Changes:</strong>
</p>
<ul>
<li>Added Composer commands for development tools (PHP_CodeSniffer, PHP-CS-Fixer, PHPStan, Psalm and phpDocumentor)</li>
</ul>
<p><strong>Maintencance:</strong>
</p>
<ul>
<li>Updated dependencies</li>
</ul>
</div>
<div class="section" id="v1-0-1">
<h2>v1.0.1</h2>
<p><strong>Maintenance:</strong>
</p>
<ul>
<li>Updated dependencies</li>
</ul>
</div>
<div class="section" id="v1-0-0">
<h2>v1.0.0</h2>
<p><strong>Initial Release</strong>
</p>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

263
doc/guides/index.html Normal file
View File

@ -0,0 +1,263 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="documentation">
<h1>Documentation</h1>
<div class="toc">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/overview/index.html#overview">Overview</a>
<ul class="menu-level-1">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler">QueueRequestHandler</a>
</li>
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#middlewarequeue">MiddlewareQueue</a>
</li>
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware">AbstractMiddleware</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/usage/index.html#user-guide">User Guide</a>
<ul class="menu-level-1">
<li class="toc-item">
<a href="guides/usage/requirements.html#requirements">Requirements</a>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#installation">Installation</a>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#usage">Usage</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/changelog.html#changelog">Changelog</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/changelog.html#v1-1-0">v1.1.0</a>
</li>
<li class="toc-item">
<a href="guides/changelog.html#v1-0-1">v1.0.1</a>
</li>
<li class="toc-item">
<a href="guides/changelog.html#v1-0-0">v1.0.0</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,292 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="abstractmiddleware">
<h1>AbstractMiddleware</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#properties">Properties</a>
</li>
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#methods">Methods</a>
<ul class="section-level-2">
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#processing-a-request">Processing a Request</a>
</li>
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#processing-a-response">Processing a Response</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<p>The <code>AbstractMiddleware</code>
is a little helper for creating your own middlewares. It processes the incoming request before
handing it over to the next middleware in line, and later processes the response before returning it to the previous
middleware. Originally both methods just return their argument unchanged, so you should implement either one of them or
both as needed.</p>
<p>The <code>AbstractMiddleware</code>
implements the
<a href="https://www.php-fig.org/psr/psr-15/#22-psrhttpservermiddlewareinterface">Psr\Http\Server\MiddlewareInterface</a>
following PHP-FIG&#039;s recommendation <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a>.</p>
<div class="section" id="properties">
<h2>Properties</h2>
<p>The <code>AbstractMiddleware</code>
has a single protected property <code>AbstractMiddleware::requestHandler</code>
referencing the request
handler which called the middleware. This can be used to access the request and/or response object (as properties of
<a href="guides/overview/queuerequesthandler.html">QueueRequestHandler</a>) when they are otherwise not available.</p>
</div>
<div class="section" id="methods">
<h2>Methods</h2>
<p>The <code>AbstractMiddleware</code>
provides one public API method and two protected methods. While the former is final and makes
sure it implements the <code>Psr\Http\Server\MiddlewareInterface</code>
, the latter are intended to be extended in your own class.</p>
<p>The main <a href="classes/OCC-PSR15-AbstractMiddleware.html#method_process"><abbr title="\OCC\PSR15\AbstractMiddleware::process()">AbstractMiddleware::process()</abbr></a>
method implements the interface and is also called when
invoking the middleware object directly. It first passes the incoming request to the
<a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest"><abbr title="\OCC\PSR15\AbstractMiddleware::processRequest()">AbstractMiddleware::processRequest()</abbr></a>
method, then hands over the result to the request handler
to receive a response, which is then processed by <a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse"><abbr title="\OCC\PSR15\AbstractMiddleware::processResponse()">AbstractMiddleware::processResponse()</abbr></a>
before
returning it back to the request handler again.</p>
<div class="section" id="processing-a-request">
<h3>Processing a Request</h3>
<p>The default method of <code>AbstractMiddleware</code>
just returns the request unchanged. If you need to process the request, you
have to implement your own <code>processRequest()</code>
method. It takes a request object as only argument and must return a
valid request object as well. Just make sure it follows PHP-FIG&#039;s standard recommendation
<a href="https://www.php-fig.org/psr/psr-7/">PSR-7: HTTP Message Interfaces</a> and implements the
<a href="https://www.php-fig.org/psr/psr-7/#321-psrhttpmessageserverrequestinterface">Psr\Http\Message\ServerRequestInterface</a>.</p>
</div>
<div class="section" id="processing-a-response">
<h3>Processing a Response</h3>
<p>The default method of <code>AbstractMiddleware</code>
just returns the response unchanged. If you need to process the response,
you have to implement your own <code>processResponse()</code>
method. It takes a response object as only argument and must return
a valid response object as well. Just make sure it follows PHP-FIG&#039;s standard recommendation
<a href="https://www.php-fig.org/psr/psr-7/">PSR-7: HTTP Message Interfaces</a> and implements the
<a href="https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface">Psr\Http\Message\ResponseInterface</a>.</p>
</div>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,252 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="overview">
<h1>Overview</h1>
<p>The package contains an implementation of <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a>
in a queue-based variant. A <a href="guides/overview/queuerequesthandler.html">QueueRequestHandler</a> handles an incoming HTTP request by passing it through a queue
of one or more middlewares. The <a href="guides/overview/middlewarequeue.html">MiddlewareQueue</a> provides the middlewares in first-in, first-out (FIFO) order,
i.e. the HTTP request is passed from middleware to middleware preserving the order in which the middlewares were added
to the queue. An <a href="guides/overview/abstractmiddleware.html">AbstractMiddleware</a> helps developing your own middlewares, but you can also use any middleware
implementing the <a href="https://packagist.org/packages/psr/http-server-middleware">Psr\Http\Server\MiddlewareInterface</a>.</p>
<p>All files share the highest coding standards of <a href="https://phpstan.org/">PHPStan</a> and <a href="https://psalm.dev/">Psalm</a>,
and full <a href="https://www.php-fig.org/psr/psr-12/">PSR-12</a> compliance to make sure they can be combined and easily used
in other projects.</p>
<div class="toc">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler">QueueRequestHandler</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#properties">Properties</a>
</li>
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#methods">Methods</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#middlewarequeue">MiddlewareQueue</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#methods">Methods</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware">AbstractMiddleware</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#properties">Properties</a>
</li>
<li class="toc-item">
<a href="guides/overview/abstractmiddleware.html#methods">Methods</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,297 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="middlewarequeue">
<h1>MiddlewareQueue</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#methods">Methods</a>
<ul class="section-level-2">
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#adding-a-middleware">Adding a Middleware</a>
</li>
<li class="toc-item">
<a href="guides/overview/middlewarequeue.html#fetching-the-next-in-line">Fetching the next in line</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<p>The <code>MiddlewareQueue</code>
manages the middlewares involved in processing a server request. It makes sure they are called in
first-in, first-out (FIFO) order, i.e. the same order they were added to the queue. It also ensures all middlewares are
implementing the <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a> specification for the
<a href="https://www.php-fig.org/psr/psr-15/#22-psrhttpservermiddlewareinterface">Psr\Http\Server\MiddlewareInterface</a>.</p>
<p>When instantiating a <code>MiddlewareQueue</code>
it defaults to being empty. But you can optionally pass an iterable set of
middlewares to the constructor which are then put into the queue. To demonstrate, the following examples both have
exactly the same result.</p>
<blockquote>
<p>Examples:</p>
<pre><code class="language-php">use OCC\PSR15\MiddlewareQueue;
$middlewares = [
new MiddlewareOne(),
new MiddlewareTwo()
];
$queue = new MiddlewareQueue($middlewares);</code></pre>
<pre><code class="language-php">use OCC\PSR15\MiddlewareQueue;
$queue = new MiddlewareQueue();
$queue-&gt;enqueue(new MiddlewareOne());
$queue-&gt;enqueue(new MiddlewareTwo());</code></pre>
</blockquote>
<p>The <code>MiddlewareQueue</code>
is based on a
<a href="https://opencultureconsulting.github.io/php-basics/guides/overview/datastructures.html#strictqueue">OCC\Basics\DataStructures\StrictQueue</a>.</p>
<div class="section" id="methods">
<h2>Methods</h2>
<p>The <code>MiddlewareQueue</code>
provides a set of API methods, with <code>MiddlewareQueue::enqueue()</code>
and <code>MiddlewareQueue::dequeue()</code>
being the most relevant ones. The former will add a new item at the end of the queue while the latter removes and
returns the first item from the queue.</p>
<p>For a complete API documentation have a look at the
<a href="https://opencultureconsulting.github.io/php-basics/classes/OCC-Basics-DataStructures-StrictQueue.html">StrictQueue</a>.</p>
<div class="section" id="adding-a-middleware">
<h3>Adding a Middleware</h3>
<p>Invoking <code>MiddlewareQueue::enqueue()</code>
will add a middleware at the end of the queue. The only argument must be a
middleware object implementing the <code>Psr\Http\Server\MiddlewareInterface</code>
. If the given argument does not meet the
criterion an <code>OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException</code>
is thrown.</p>
<p>Have a look at the <a href="guides/overview/abstractmiddleware.html">AbstractMiddleware</a> for an easy way to create your own middlewares!</p>
</div>
<div class="section" id="fetching-the-next-in-line">
<h3>Fetching the next in line</h3>
<p>Calling <code>MiddlewareQueue::dequeue()</code>
will return the first middleware from the queue, i.e. the oldest one on the queue.
Also, this middleware is removed from the queue.</p>
<p>If the queue is empty a <code>RuntimeException</code>
is thrown, so make sure to check the queue&#039;s length (e.g. with <code>count()</code>
)
before trying to dequeue an item!</p>
</div>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,397 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="queuerequesthandler">
<h1>QueueRequestHandler</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#properties">Properties</a>
<ul class="section-level-2">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#middleware-queue">Middleware Queue</a>
</li>
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#http-server-request">HTTP Server Request</a>
</li>
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#http-response">HTTP Response</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#methods">Methods</a>
<ul class="section-level-2">
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#handling-a-server-request">Handling a Server Request</a>
</li>
<li class="toc-item">
<a href="guides/overview/queuerequesthandler.html#sending-the-response">Sending the Response</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<p>The <code>QueueRequestHandler</code>
is the core piece of this package. It fetches incoming HTTP requests, passes them through a
queue of middlewares and finally sends the response back to the client. It also catches any exceptions not handled by
a middleware and turns them into a proper HTTP error response.</p>
<p>The <code>QueueRequestHandler</code>
implements the
<a href="https://www.php-fig.org/psr/psr-15/#21-psrhttpserverrequesthandlerinterface">Psr\Http\Server\RequestHandlerInterface</a>
following PHP-FIG&#039;s recommendation <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a>.</p>
<p>For a minimal working example have a look at <a href="guides/usage/usage.html">Usage</a>.</p>
<div class="section" id="properties">
<h2>Properties</h2>
<p>The <code>QueueRequestHandler</code>
has three <strong>read-only</strong>
properties. They are initially set at instantiation and can be
directly accessed from the object via magic methods (e.g. <code>$requestHandler-&gt;queue</code>
).</p>
<div class="section" id="middleware-queue">
<h3>Middleware Queue</h3>
<p>The queue of middlewares can be accessed as <code>QueueRequestHandler::queue</code>
and offers a handy API to <code>enqueue()</code>
,
<code>dequeue()</code>
or otherwise manipulate its contents. All middlewares must implement <code>Psr\Http\Server\MiddlewareInterface</code>
.
Have a look at <a href="guides/overview/middlewarequeue.html">MiddlewareQueue</a> for more details.</p>
<p>When instantiating a <code>QueueRequestHandler</code>
the queue defaults to being empty. But you can optionally pass an iterable
set of middlewares to the constructor which are then put into the queue. To demonstrate, the following examples both
have exactly the same result.</p>
<blockquote>
<p>Examples:</p>
<pre><code class="language-php">use OCC\PSR15\QueueRequestHandler;
$middlewares = [
new MiddlewareOne(),
new MiddlewareTwo()
];
$requestHandler = new QueueRequestHandler($middlewares);</code></pre>
<pre><code class="language-php">use OCC\PSR15\QueueRequestHandler;
$requestHandler = new QueueRequestHandler();
$requestHandler-&gt;queue-&gt;enqueue(new MiddlewareOne());
$requestHandler-&gt;queue-&gt;enqueue(new MiddlewareTwo());</code></pre>
</blockquote>
</div>
<div class="section" id="http-server-request">
<h3>HTTP Server Request</h3>
<p>The server request is always available as <code>QueueRequestHandler::request</code>
. It follows PHP-FIG&#039;s standard recommendation
<a href="https://www.php-fig.org/psr/psr-7/">PSR-7: HTTP Message Interfaces</a> and implements the
<a href="https://www.php-fig.org/psr/psr-7/#321-psrhttpmessageserverrequestinterface">Psr\Http\Message\ServerRequestInterface</a>.</p>
<p>When instantiating a <code>QueueRequestHandler</code>
the <code>$request</code>
property is initially set by fetching the actual server
request data from superglobals. The property is reset each time the request is passed through a middleware and thus
always represents the current state of the request.</p>
</div>
<div class="section" id="http-response">
<h3>HTTP Response</h3>
<p>The response can be read as <code>QueueRequestHandler::response</code>
. It also follows PHP-FIG&#039;s standard recommendation
<a href="https://www.php-fig.org/psr/psr-7/">PSR-7: HTTP Message Interfaces</a> and implements the
<a href="https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface">Psr\Http\Message\ResponseInterface</a>.</p>
<p>When instantiating a <code>QueueRequestHandler</code>
the <code>$response</code>
property is initially set as a blank HTTP response with
status code <code>200</code>
. The property is reset each time the response is passed through a middleware and thus
always represents the latest state of the response.</p>
<p>Both, request and response, use the awesome implementations of <a href="https://github.com/guzzle/psr7">Guzzle</a>.</p>
</div>
</div>
<div class="section" id="methods">
<h2>Methods</h2>
<p>The <code>QueueRequestHandler</code>
provides two public API methods, <a href="classes/OCC-PSR15-QueueRequestHandler.html#method_handle"><abbr title="\OCC\PSR15\QueueRequestHandler::handle()">QueueRequestHandler::handle()</abbr></a>
and
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond"><abbr title="\OCC\PSR15\QueueRequestHandler::respond()">QueueRequestHandler::respond()</abbr></a>
. As their names suggest, the former handles the server request
while the latter sends the response back to the client. Invoking the request handler object directly does the same as
calling the <code>handle()</code>
method.</p>
<div class="section" id="handling-a-server-request">
<h3>Handling a Server Request</h3>
<p>After adding at least one middleware to the queue, you can start handling a request by simply calling
<a href="classes/OCC-PSR15-QueueRequestHandler.html#method_handle"><abbr title="\OCC\PSR15\QueueRequestHandler::handle()">QueueRequestHandler::handle()</abbr></a>
. Optionally, you can pass a request object as argument, but since
the actual server request was already fetched in the constructor and will be used by default, most of the time you
don&#039;t need to. All request objects must implement <code>Psr\Http\Message\ServerRequestInterface</code>
.</p>
<p>The <code>handle()</code>
method returns the final response after passing it through all middlewares. The response object always
implements <code>Psr\Http\Message\ResponseInterface</code>
.</p>
<p>In case of an error the request handler catches any exception and creates a response with the exception code as status
code (if it&#039;s within the valid range of HTTP status codes, otherwise it&#039;s set to <code>500 (Internal Server Error)</code>
), and
the exception message as body.</p>
</div>
<div class="section" id="sending-the-response">
<h3>Sending the Response</h3>
<p>Sending the final response to the client is as easy as calling <a href="classes/OCC-PSR15-QueueRequestHandler.html#method_respond"><abbr title="\OCC\PSR15\QueueRequestHandler::respond()">QueueRequestHandler::respond()</abbr></a>
.
Optionally, you can provide an exit code as argument (an integer in the range <code>0</code>
to <code>254</code>
). If you do so, script
execution is stopped after sending out the response and the given exit status is set. The status <code>0</code>
means the request
was handled successfully, every other status is considered an error.</p>
</div>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

263
doc/guides/usage/index.html Normal file
View File

@ -0,0 +1,263 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="user-guide">
<h1>User Guide</h1>
<p>The <em>Queue-based HTTP Server Request Handler</em>
is a library package, not a stand-alone application. The following
documentation of requirements and installation procedures describes how to make use of the classes within your own
application. For a detailed description of the package&#039;s contents have a look at the <a href="guides/overview/index.html">Overview</a> page.</p>
<div class="toc">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/usage/requirements.html#requirements">Requirements</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/usage/requirements.html#environment">Environment</a>
</li>
<li class="toc-item">
<a href="guides/usage/requirements.html#dependencies">Dependencies</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#installation">Installation</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/usage/installation.html#composer">Composer</a>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#git">Git</a>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#download">Download</a>
</li>
</ul>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#usage">Usage</a>
<ul class="section-level-1">
<li class="toc-item">
<a href="guides/usage/usage.html#middlewares">Middlewares</a>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#request-handler">Request Handler</a>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#diving-deeper">Diving Deeper</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,268 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="installation">
<h1>Installation</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/usage/installation.html#composer">Composer</a>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#git">Git</a>
</li>
<li class="toc-item">
<a href="guides/usage/installation.html#download">Download</a>
</li>
</ul>
</div>
</div>
</div>
<div class="section" id="composer">
<h2>Composer</h2>
<p>The intended and recommended way of re-using this package is via <a href="https://getcomposer.org/">Composer</a>. The following
command will get you the latest version and make it a dependency of your project. It will also request all dependencies
and register all classes with the autoloader to make them available inside the application.</p>
<pre><code class="language-shell"># This will install the latest stable version suitable for your project
composer require &quot;opencultureconsulting/psr15&quot;</code></pre>
<p>If you want to use a specific version other than the latest available for your environment, you can do so by appending
the desired version constraint:</p>
<pre><code class="language-shell"># This will install the latest patch level version of 1.1 (i. e. &gt;=1.1.0 &amp;&amp; &lt;1.2.0)
composer require &quot;opencultureconsulting/psr15:~1.1&quot;</code></pre>
<p>All available versions as well as further information about <a href="guides/usage/requirements.html">Requirements</a> and dependencies can be found on
<a href="https://packagist.org/packages/opencultureconsulting/psr15">Packagist</a>.</p>
</div>
<div class="section" id="git">
<h2>Git</h2>
<p>Alternatively, you can fetch the files from <a href="https://github.com/opencultureconsulting/psr-15">GitHub</a> and add them to
your project manually. The best way is by cloning the repository, because then you can easily update to a newer version
by just pulling the changes and checking out a different version tag.</p>
<pre><code class="language-shell"># This will clone the repository into the &quot;psr15&quot; directory
git clone https://github.com/opencultureconsulting/psr-15.git psr15</code></pre>
<p>If you want to use a specific version other than the latest development state, you have to specify the desired tag as
well:</p>
<pre><code class="language-shell"># This will clone the repository state at version &quot;1.1.0&quot; into the &quot;psr15&quot; directory
git clone --branch=v1.1.0 https://github.com/opencultureconsulting/psr-15.git psr15</code></pre>
<p>Be aware that you also need to make the classes available in your application by either adding them to your autoloader
or by including all files individually in PHP. Also don&#039;t forget to do the same for all <a href="guides/usage/requirements.html">Requirements</a>.</p>
</div>
<div class="section" id="download">
<h2>Download</h2>
<p>As a last resort you can also just download the files. You can find all available versions as well as the current
development state on the <a href="https://github.com/opencultureconsulting/psr-15/releases">GitHub release page</a>.</p>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,216 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="requirements">
<h1>Requirements</h1>
<div class="section" id="environment">
<h2>Environment</h2>
<p>This package requires at least <strong>PHP 8.1</strong>
.</p>
<p>It is highly recommended to use <a href="https://getcomposer.org/">Composer</a> for dependency management and autoloading,
although it is technically not strictly required for using any of these classes. But it certainly makes it a lot
easier!</p>
</div>
<div class="section" id="dependencies">
<h2>Dependencies</h2>
<p>This package obviously depends on <a href="https://packagist.org/packages/psr/http-server-handler">psr/http-server-handler</a>
and <a href="https://packagist.org/packages/psr/http-server-middleware">psr/http-server-middleware</a> which define the standard
<a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a> interfaces.</p>
<p>It uses the <a href="https://www.php-fig.org/psr/psr-7/">PSR-7: HTTP Message</a> implementations for server request and response
of the great <a href="https://packagist.org/packages/guzzlehttp/psr7">guzzlehttp/psr7</a> library.</p>
<p>The middleware queue is based on a <a href="https://opencultureconsulting.github.io/php-basics/guides/overview/datastructures.html#strictqueue">StrictQueue</a>
of the <a href="https://packagist.org/packages/opencultureconsulting/basics">opencultureconsulting/basics</a> package which also
provides some useful traits.</p>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

397
doc/guides/usage/usage.html Normal file
View File

@ -0,0 +1,397 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<div class="section" id="usage">
<h1>Usage</h1>
<div class="admonition-wrapper">
<div class="admonition admonition-sidebar"><p class="sidebar-title">Table of Contents</p>
<div class="contents">
<ul class="phpdocumentor-list">
<li class="toc-item">
<a href="guides/usage/usage.html#middlewares">Middlewares</a>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#request-handler">Request Handler</a>
</li>
<li class="toc-item">
<a href="guides/usage/usage.html#diving-deeper">Diving Deeper</a>
</li>
</ul>
</div>
</div>
</div>
<p>The following example shows a very basic <em>Queue-based HTTP Server Request Handler</em>
using just two simple middlewares
(called <code>MiddlewareOne</code>
and <code>MiddlewareTwo</code>
).</p>
<div class="section" id="middlewares">
<h2>Middlewares</h2>
<p>First of all, we need some middlewares to process our server request. Although we could use any middleware implementing
the <code>Psr/Http/Server/MiddlewareInterface</code>
(e.g. from <a href="https://github.com/middlewares">this great collection</a>), we
will write our own using the <a href="guides/overview/abstractmiddleware.html">AbstractMiddleware</a> provided by this package.</p>
<p>The abstract middleware already implements a complete middleware, but it will just pass requests through without doing
anything. In order to have it do something, we need to implement our own <a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest"><abbr title="\OCC\PSR15\AbstractMiddleware::processRequest()">AbstractMiddleware::processRequest()</abbr></a>
or <a href="classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse"><abbr title="\OCC\PSR15\AbstractMiddleware::processResponse()">AbstractMiddleware::processResponse()</abbr></a>
method, or both of them.</p>
<p>The logic here is the same as with every <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP Server Request Handlers</a>
middleware: The request gets passed through all middlewares&#039; <code>processRequest()</code>
methods in order of their addition to
the queue, then a response is created and passed through all <code>processResponse()</code>
methods, <strong>but in reverse order</strong>
! So
the first middleware in the queue gets the request first, but the response last.</p>
<p>Our first middleware is very simple and just adds an attribute to the server request.</p>
<pre><code class="language-php">use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareOne extends AbstractMiddleware
{
/**
* Process an incoming server request before delegating to next middleware.
*
* @param ServerRequest $request The incoming server request
*
* @return ServerRequest The processed server request
*/
protected function processRequest(ServerRequest $request): ServerRequest
{
// Let&#039;s just add a new attribute to the request to later check
// which middleware was passed last.
return $request-&gt;withAttribute(&#039;LastMiddlewarePassed&#039;, &#039;MiddlewareOne&#039;);
}
}</code></pre>
<p>For a queue to make sense we need at least a second middleware, so let&#039;s create another one. Again, we will add an
attribute to the request, but with the same name. So, whichever middleware handles the request last overwrites the
attribute with its value. This way we can later check if our middlewares were passed in the correct order.</p>
<pre><code class="language-php">use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareTwo extends AbstractMiddleware
{
/**
* Process an incoming server request before delegating to next middleware.
*
* @param ServerRequest $request The incoming server request
*
* @return ServerRequest The processed server request
*/
protected function processRequest(ServerRequest $request): ServerRequest
{
// We add the same request attribute as in MiddlewareOne, effectively
// overwriting its value.
return $request-&gt;withAttribute(&#039;LastMiddlewarePassed&#039;, &#039;MiddlewareTwo&#039;);
}
}</code></pre>
<p>Also, we want to set the status code of the response according to the final value of our request attribute. Therefore,
we need to implement <code>processResponse()</code>
as well. We can do that in either one of our middlewares because it&#039;s the only
response manipulation in our example, so the order of processing doesn&#039;t make a difference (remember: <code>MiddlewareTwo</code>
gets to handle the response before <code>MiddlewareOne</code>
). Let&#039;s go with <code>MiddlewareTwo</code>
.</p>
<pre><code class="language-php">use OCC\PSR15\AbstractMiddleware;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
class MiddlewareTwo extends AbstractMiddleware
{
// MiddlewareTwo::processRequest() remains unchanged (see above).
/**
* Process an incoming response before returning it to previous middleware.
*
* @param Response $response The incoming response
*
* @return Response The processed response
*/
protected function processResponse(Response $response): Response
{
// First we need to get the request attribute.
$lastMiddlewarePassed = $this-&gt;requestHandler-&gt;request-&gt;getAttribute(&#039;LastMiddlewarePassed&#039;);
if ($lastMiddlewarePassed === &#039;MiddlewareTwo&#039;) {
// Great, MiddlewareTwo was passed after MiddlewareOne,
// let&#039;s return status code 200!
return $response-&gt;withStatus(200);
} else {
// Oh no, something went wrong! We&#039;ll send status code 500.
return $response-&gt;withStatus(500);
}
}
}</code></pre>
<p>Well done! We now have two middlewares.</p>
</div>
<div class="section" id="request-handler">
<h2>Request Handler</h2>
<p>Let&#039;s use a <a href="guides/overview/queuerequesthandler.html">QueueRequestHandler</a> to pass a server request through both of our middlewares in the
correct order.</p>
<pre><code class="language-php">use OCC\PSR15\QueueRequestHandler;
// First of all, we instantiate the request handler.
// At this point we could already provide an array of middlewares as argument and
// skip the next step, but then we wouldn&#039;t learn how to use the MiddlewareQueue.
$requestHandler = new QueueRequestHandler();
// We can access the MiddlewareQueue as a property of the request handler.
// Let&#039;s add both of our middlewares, MiddlewareOne and MiddlewareTwo. Since
// this is a FIFO queue, the order is very important!
$requestHandler-&gt;queue-&gt;enqueue(new MiddlewareOne());
$requestHandler-&gt;queue-&gt;enqueue(new MiddlewareTwo());
// And we are ready to handle incoming requests!
// We don&#039;t even need to pass the server request to this method, because
// the constructor already took care of that!
$finalResponse = $requestHandler-&gt;handle();
// Now we can pass the final response back to our application.
// Alternatively, we can also return it directly to the client.
$requestHandler-&gt;respond();
// If we did everything right, the client should now receive an HTTP response
// with status code 200 (OK).</code></pre>
<p>And that&#039;s it!</p>
</div>
<div class="section" id="diving-deeper">
<h2>Diving Deeper</h2>
<p>To familiarize yourself with the FIFO principle of the middleware queue, you can try to exchange the two lines adding
the middlewares to the queue, i.e. add <code>MiddlewareTwo</code>
first and <code>MiddlewareOne</code>
second. This will result in an HTTP
response with status code <code>500 (Internal Server Error)</code>
.</p>
<p>This is exactly what we intended: Have a look at <code>MiddlewareTwo::processResponse()</code>
again! If <code>$lastMiddlewarePassed</code>
is not <code>MiddlewareTwo</code>
(which it isn&#039;t when <code>MiddlewareOne</code>
is added to the queue after <code>MiddlewareTwo</code>
), we set the
response status code to <code>500</code>
.</p>
</div>
</div>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

230
doc/index.html generated Normal file
View File

@ -0,0 +1,230 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li><a href>Home</a></li>
</ul>
<h2 class="phpdocumentor-content__title">Queue-based HTTP Server Request Handler</h2>
<p class="phpdocumentor-summary">An implementation of <a href="https://www.php-fig.org/psr/psr-15/">PSR-15: HTTP
Server Request Handlers</a>.</p>
<p>The PHP Standard Recommendation PSR-15 defines interfaces for server request handlers and proposes a queue-based
implementation using different middlewares for processing requests and preparing responses. This package follows
those guidelines and provides a <a href="guides/overview/queuerequesthandler.html">HTTP server request handler</a>
implementation using a <a href="guides/overview/middlewarequeue.html">middleware queue</a>. It also contains an
<a href="guides/overview/abstractmiddleware.html">abstract class for middlewares</a> to ease the process of writing
your own middleware, but you can just as well use any middleware that implements the middleware interface specified
by PSR-15 (e.g. from the awesome <a href="https://github.com/middlewares">PSR-15 HTTP Middlewares</a> project).</p>
<p>All components of this package follow the highest coding standards of <a href="https://phpstan.org/">PHPStan</a>
and <a href="https://psalm.dev/">Psalm</a>, and comply to <a href="https://www.php-fig.org/psr/psr-12/">PSR-12</a>
code style guidelines to make sure they can be combined and easily re-used in other projects.</p>
<h3 id="toc">Table of Contents</h3>
<h4 id="toc-documentation">Documentation</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -documentation">
<a href="guides/overview/index.html#overview">Overview</a>
</dt>
<dd>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler">QueueRequestHandler</a><br/>
<a href="guides/overview/middlewarequeue.html#middlewarequeue">MiddlewareQueue</a><br/>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware">AbstractMiddleware</a><br/>
</dd>
<dt class="phpdocumentor-table-of-contents__entry -documentation">
<a href="guides/usage/index.html#user-guide">User Guide</a>
</dt>
<dd>
<a href="guides/usage/requirements.html#requirements">Requirements</a><br/>
<a href="guides/usage/installation.html#installation">Installation</a><br/>
<a href="guides/usage/usage.html#usage">Usage</a><br/>
</dd>
<dt class="phpdocumentor-table-of-contents__entry -documentation">
<a href="guides/changelog.html#changelog">Changelog</a>
</dt>
</dl>
<h4 id="toc-packages">Packages</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -package">
<a href="packages/PSR15.html">PSR15</a>
</dt>
</dl>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="index.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

193
doc/indices/files.html Normal file
View File

@ -0,0 +1,193 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<h2 class="phpdocumentor-content__title">Files</h2>
<h3>A</h3>
<ul class="phpdocumentor-list">
<li><a href="files/src-abstractmiddleware.html"><abbr title="src/AbstractMiddleware.php">AbstractMiddleware.php</abbr></a></li>
</ul>
<h3>M</h3>
<ul class="phpdocumentor-list">
<li><a href="files/src-middlewarequeue.html"><abbr title="src/MiddlewareQueue.php">MiddlewareQueue.php</abbr></a></li>
</ul>
<h3>Q</h3>
<ul class="phpdocumentor-list">
<li><a href="files/src-queuerequesthandler.html"><abbr title="src/QueueRequestHandler.php">QueueRequestHandler.php</abbr></a></li>
</ul>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="indices/files.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

173
doc/js/search.js Normal file
View File

@ -0,0 +1,173 @@
// Search module for phpDocumentor
//
// This module is a wrapper around fuse.js that will use a given index and attach itself to a
// search form and to a search results pane identified by the following data attributes:
//
// 1. data-search-form
// 2. data-search-results
//
// The data-search-form is expected to have a single input element of type 'search' that will trigger searching for
// a series of results, were the data-search-results pane is expected to have a direct UL child that will be populated
// with rendered results.
//
// The search has various stages, upon loading this stage the data-search-form receives the CSS class
// 'phpdocumentor-search--enabled'; this indicates that JS is allowed and indices are being loaded. It is recommended
// to hide the form by default and show it when it receives this class to achieve progressive enhancement for this
// feature.
//
// After loading this module, it is expected to load a search index asynchronously, for example:
//
// <script defer src="js/searchIndex.js"></script>
//
// In this script the generated index should attach itself to the search module using the `appendIndex` function. By
// doing it like this the page will continue loading, unhindered by the loading of the search.
//
// After the page has fully loaded, and all these deferred indexes loaded, the initialization of the search module will
// be called and the form will receive the class 'phpdocumentor-search--active', indicating search is ready. At this
// point, the input field will also have it's 'disabled' attribute removed.
var Search = (function () {
var fuse;
var index = [];
var options = {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
"fqsen",
"name",
"summary",
"url"
]
};
// Credit David Walsh (https://davidwalsh.name/javascript-debounce-function)
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function executedFunction() {
var context = this;
var args = arguments;
var later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
function close() {
// Start scroll prevention: https://css-tricks.com/prevent-page-scrolling-when-a-modal-is-open/
const scrollY = document.body.style.top;
document.body.style.position = '';
document.body.style.top = '';
window.scrollTo(0, parseInt(scrollY || '0') * -1);
// End scroll prevention
var form = document.querySelector('[data-search-form]');
var searchResults = document.querySelector('[data-search-results]');
form.classList.toggle('phpdocumentor-search--has-results', false);
searchResults.classList.add('phpdocumentor-search-results--hidden');
var searchField = document.querySelector('[data-search-form] input[type="search"]');
searchField.blur();
}
function search(event) {
// Start scroll prevention: https://css-tricks.com/prevent-page-scrolling-when-a-modal-is-open/
document.body.style.position = 'fixed';
document.body.style.top = `-${window.scrollY}px`;
// End scroll prevention
// prevent enter's from autosubmitting
event.stopPropagation();
var form = document.querySelector('[data-search-form]');
var searchResults = document.querySelector('[data-search-results]');
var searchResultEntries = document.querySelector('[data-search-results] .phpdocumentor-search-results__entries');
searchResultEntries.innerHTML = '';
if (!event.target.value) {
close();
return;
}
form.classList.toggle('phpdocumentor-search--has-results', true);
searchResults.classList.remove('phpdocumentor-search-results--hidden');
var results = fuse.search(event.target.value, {limit: 25});
results.forEach(function (result) {
var entry = document.createElement("li");
entry.classList.add("phpdocumentor-search-results__entry");
entry.innerHTML += '<h3><a href="' + document.baseURI + result.url + '">' + result.name + "</a></h3>\n";
entry.innerHTML += '<small>' + result.fqsen + "</small>\n";
entry.innerHTML += '<div class="phpdocumentor-summary">' + result.summary + '</div>';
searchResultEntries.appendChild(entry)
});
}
function appendIndex(added) {
index = index.concat(added);
// re-initialize search engine when appending an index after initialisation
if (typeof fuse !== 'undefined') {
fuse = new Fuse(index, options);
}
}
function init() {
fuse = new Fuse(index, options);
var form = document.querySelector('[data-search-form]');
var searchField = document.querySelector('[data-search-form] input[type="search"]');
var closeButton = document.querySelector('.phpdocumentor-search-results__close');
closeButton.addEventListener('click', function() { close() }.bind(this));
var searchResults = document.querySelector('[data-search-results]');
searchResults.addEventListener('click', function() { close() }.bind(this));
form.classList.add('phpdocumentor-search--active');
searchField.setAttribute('placeholder', 'Search (Press "/" to focus)');
searchField.removeAttribute('disabled');
searchField.addEventListener('keyup', debounce(search, 300));
window.addEventListener('keyup', function (event) {
if (event.key === '/') {
searchField.focus();
}
if (event.code === 'Escape') {
close();
}
}.bind(this));
}
return {
appendIndex,
init
}
})();
window.addEventListener('DOMContentLoaded', function () {
var form = document.querySelector('[data-search-form]');
// When JS is supported; show search box. Must be before including the search for it to take effect immediately
form.classList.add('phpdocumentor-search--enabled');
});
window.addEventListener('load', function () {
Search.init();
});

79
doc/js/searchIndex.js Normal file
View File

@ -0,0 +1,79 @@
Search.appendIndex(
[
{
"fqsen": "\\OCC\\PSR15\\AbstractMiddleware",
"name": "AbstractMiddleware",
"summary": "Abstract\u0020class\u0020implementing\u0020\\Psr\\Http\\Server\\MiddlewareInterface.",
"url": "classes/OCC-PSR15-AbstractMiddleware.html"
}, {
"fqsen": "\\OCC\\PSR15\\AbstractMiddleware\u003A\u003Aprocess\u0028\u0029",
"name": "process",
"summary": "Process\u0020an\u0020incoming\u0020server\u0020request\u0020and\u0020produce\u0020a\u0020response.",
"url": "classes/OCC-PSR15-AbstractMiddleware.html#method_process"
}, {
"fqsen": "\\OCC\\PSR15\\AbstractMiddleware\u003A\u003AprocessRequest\u0028\u0029",
"name": "processRequest",
"summary": "Process\u0020an\u0020incoming\u0020server\u0020request\u0020before\u0020delegating\u0020to\u0020next\u0020middleware.",
"url": "classes/OCC-PSR15-AbstractMiddleware.html#method_processRequest"
}, {
"fqsen": "\\OCC\\PSR15\\AbstractMiddleware\u003A\u003AprocessResponse\u0028\u0029",
"name": "processResponse",
"summary": "Process\u0020an\u0020incoming\u0020response\u0020before\u0020returning\u0020it\u0020to\u0020previous\u0020middleware.",
"url": "classes/OCC-PSR15-AbstractMiddleware.html#method_processResponse"
}, {
"fqsen": "\\OCC\\PSR15\\AbstractMiddleware\u003A\u003A__invoke\u0028\u0029",
"name": "__invoke",
"summary": "Allow\u0020the\u0020middleware\u0020to\u0020be\u0020invoked\u0020directly.",
"url": "classes/OCC-PSR15-AbstractMiddleware.html#method___invoke"
}, {
"fqsen": "\\OCC\\PSR15\\MiddlewareQueue",
"name": "MiddlewareQueue",
"summary": "Queue\u0020of\u0020PSR\u002D15\u0020Middlewares\u0020to\u0020process\u0020HTTP\u0020Server\u0020Requests.",
"url": "classes/OCC-PSR15-MiddlewareQueue.html"
}, {
"fqsen": "\\OCC\\PSR15\\MiddlewareQueue\u003A\u003A__construct\u0028\u0029",
"name": "__construct",
"summary": "Create\u0020a\u0020queue\u0020of\u0020PSR\u002D15\u0020compatible\u0020middlewares.",
"url": "classes/OCC-PSR15-MiddlewareQueue.html#method___construct"
}, {
"fqsen": "\\OCC\\PSR15\\QueueRequestHandler",
"name": "QueueRequestHandler",
"summary": "A\u0020queue\u002Dbased\u0020PSR\u002D15\u0020HTTP\u0020Server\u0020Request\u0020Handler.",
"url": "classes/OCC-PSR15-QueueRequestHandler.html"
}, {
"fqsen": "\\OCC\\PSR15\\QueueRequestHandler\u003A\u003Ahandle\u0028\u0029",
"name": "handle",
"summary": "Handles\u0020a\u0020request\u0020by\u0020invoking\u0020a\u0020queue\u0020of\u0020middlewares.",
"url": "classes/OCC-PSR15-QueueRequestHandler.html#method_handle"
}, {
"fqsen": "\\OCC\\PSR15\\QueueRequestHandler\u003A\u003Arespond\u0028\u0029",
"name": "respond",
"summary": "Return\u0020the\u0020current\u0020response\u0020to\u0020the\u0020client.",
"url": "classes/OCC-PSR15-QueueRequestHandler.html#method_respond"
}, {
"fqsen": "\\OCC\\PSR15\\QueueRequestHandler\u003A\u003A__construct\u0028\u0029",
"name": "__construct",
"summary": "Create\u0020a\u0020queue\u002Dbased\u0020PSR\u002D15\u0020HTTP\u0020Server\u0020Request\u0020Handler.",
"url": "classes/OCC-PSR15-QueueRequestHandler.html#method___construct"
}, {
"fqsen": "\\OCC\\PSR15\\QueueRequestHandler\u003A\u003A__invoke\u0028\u0029",
"name": "__invoke",
"summary": "Allow\u0020the\u0020request\u0020handler\u0020to\u0020be\u0020invoked\u0020directly.",
"url": "classes/OCC-PSR15-QueueRequestHandler.html#method___invoke"
}, {
"fqsen": "\\",
"name": "\\",
"summary": "",
"url": "namespaces/default.html"
}, {
"fqsen": "\\OCC\\PSR15",
"name": "PSR15",
"summary": "",
"url": "namespaces/occ-psr15.html"
}, {
"fqsen": "\\OCC",
"name": "OCC",
"summary": "",
"url": "namespaces/occ.html"
} ]
);

17
doc/js/template.js Normal file
View File

@ -0,0 +1,17 @@
(function(){
window.addEventListener('load', () => {
const el = document.querySelector('.phpdocumentor-on-this-page__content')
if (!el) {
return;
}
const observer = new IntersectionObserver(
([e]) => {
e.target.classList.toggle("-stuck", e.intersectionRatio < 1);
},
{threshold: [1]}
);
observer.observe(el);
})
})();

324
doc/namespaces/default.html Normal file
View File

@ -0,0 +1,324 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -namespace">
<h2 class="phpdocumentor-content__title">API Documentation</h2>
<h3 id="toc">
Table of Contents
<a href="namespaces/default.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="namespaces">
Namespaces
<a href="namespaces/default.html#namespaces" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -namespace"><a href="namespaces/occ.html"><abbr title="\OCC">OCC</abbr></a></dt>
</dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="namespaces/default.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,325 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="-active">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ.html">OCC</a></li>
</ul>
<article class="phpdocumentor-element -namespace">
<h2 class="phpdocumentor-content__title">PSR15</h2>
<h3 id="toc">
Table of Contents
<a href="namespaces/occ-psr15.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="namespaces/occ-psr15.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-AbstractMiddleware.html"><abbr title="\OCC\PSR15\AbstractMiddleware">AbstractMiddleware</abbr></a></dt><dd>Abstract class implementing \Psr\Http\Server\MiddlewareInterface.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a></dt><dd>Queue of PSR-15 Middlewares to process HTTP Server Requests.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-QueueRequestHandler.html"><abbr title="\OCC\PSR15\QueueRequestHandler">QueueRequestHandler</abbr></a></dt><dd>A queue-based PSR-15 HTTP Server Request Handler.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="namespaces/occ-psr15.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="namespaces/occ-psr15.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

324
doc/namespaces/occ.html Normal file
View File

@ -0,0 +1,324 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="-active">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -namespace">
<h2 class="phpdocumentor-content__title">OCC</h2>
<h3 id="toc">
Table of Contents
<a href="namespaces/occ.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="namespaces">
Namespaces
<a href="namespaces/occ.html#namespaces" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -namespace"><a href="namespaces/occ-psr15.html"><abbr title="\OCC\PSR15">PSR15</abbr></a></dt>
</dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="namespaces/occ.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

302
doc/packages/Basics.html Normal file
View File

@ -0,0 +1,302 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/Basics.html" class="-active">Basics</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">Basics</h2>
<h3 id="toc">
Table of Contents
<a href="packages/Basics.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/Basics.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

309
doc/packages/PSR-15.html Normal file
View File

@ -0,0 +1,309 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR.html" class="">PSR</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="packages/PSR-15.html" class="-active">15</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/PSR.html">PSR</a></li>
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">15</h2>
<h3 id="toc">
Table of Contents
<a href="packages/PSR-15.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/PSR-15.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

316
doc/packages/PSR.html Normal file
View File

@ -0,0 +1,316 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR.html" class="-active">PSR</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="packages/PSR-15.html" class="">15</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">PSR</h2>
<h3 id="toc">
Table of Contents
<a href="packages/PSR.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="packages">
Packages
<a href="packages/PSR.html#packages" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -package"><a href="packages/PSR-15.html"><abbr title="\PSR\15">15</abbr></a></dt>
</dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/PSR.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

324
doc/packages/PSR15.html Normal file
View File

@ -0,0 +1,324 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="-active">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">PSR15</h2>
<h3 id="toc">
Table of Contents
<a href="packages/PSR15.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="packages/PSR15.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-AbstractMiddleware.html"><abbr title="\OCC\PSR15\AbstractMiddleware">AbstractMiddleware</abbr></a></dt><dd>Abstract class implementing \Psr\Http\Server\MiddlewareInterface.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a></dt><dd>Queue of PSR-15 Middlewares to process HTTP Server Requests.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-QueueRequestHandler.html"><abbr title="\OCC\PSR15\QueueRequestHandler">QueueRequestHandler</abbr></a></dt><dd>A queue-based PSR-15 HTTP Server Request Handler.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="packages/PSR15.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/PSR15.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

324
doc/packages/default.html Normal file
View File

@ -0,0 +1,324 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">API Documentation</h2>
<h3 id="toc">
Table of Contents
<a href="packages/default.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="packages">
Packages
<a href="packages/default.html#packages" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -package"><a href="packages/PSR15.html"><abbr title="\PSR15">PSR15</abbr></a></dt>
</dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/default.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,310 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PSR-15 Queue</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/Basics.html" class="">Basics</a>
</h4>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/opencultureconsultingpsr15.html" class="-active">opencultureconsultingpsr15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
</ul>
<article class="phpdocumentor-element -package">
<h2 class="phpdocumentor-content__title">opencultureconsultingpsr15</h2>
<h3 id="toc">
Table of Contents
<a href="packages/opencultureconsultingpsr15.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-classes">
Classes
<a href="packages/opencultureconsultingpsr15.html#toc-classes" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-AbstractMiddleware.html"><abbr title="\OCC\PSR15\AbstractMiddleware">AbstractMiddleware</abbr></a></dt><dd>Abstract class implementing Psr\Http\Server\MiddlewareInterface.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-MiddlewareQueue.html"><abbr title="\OCC\PSR15\MiddlewareQueue">MiddlewareQueue</abbr></a></dt><dd>Queue of PSR-15 Middlewares to process HTTP Server Requests.</dd> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/OCC-PSR15-QueueRequestHandler.html"><abbr title="\OCC\PSR15\QueueRequestHandler">QueueRequestHandler</abbr></a></dt><dd>A queue-based PSR-15 HTTP Server Request Handler.</dd> </dl>
<div class="phpdocumentor-modal" id="source-view">
<div class="phpdocumentor-modal-bg" data-exit-button></div>
<div class="phpdocumentor-modal-container">
<div class="phpdocumentor-modal-content">
<pre style="max-height: 500px; overflow-y: scroll" data-src="" class="language-php line-numbers linkable-line-numbers"></pre>
</div>
<button data-exit-button class="phpdocumentor-modal__close">&times;</button>
</div>
</div>
<script type="text/javascript">
(function () {
function loadExternalCodeSnippet(el, url, line) {
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
const language = 'php';
const code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
return;
}
if (xhr.status === 404) {
code.textContent = '✖ Error: File could not be found';
return;
}
if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
return;
}
code.textContent = '✖ Error: An unknown error occurred';
};
xhr.send(null);
});
}
const modalButtons = document.querySelectorAll("[data-modal]");
const openedAsLocalFile = window.location.protocol === 'file:';
if (modalButtons.length > 0 && openedAsLocalFile) {
console.warn(
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
'browsers block XHR requests when a page is opened this way'
);
}
modalButtons.forEach(function (trigger) {
if (openedAsLocalFile) {
trigger.setAttribute("hidden", "hidden");
}
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
if (!modal) {
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
return;
}
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
})();
</script>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="packages/opencultureconsultingpsr15.html#toc-classes">Classes</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="packages/opencultureconsultingpsr15.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

192
doc/reports/deprecated.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> PSR-15 Queue &raquo; Deprecated elements
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li><a href="">Home</a></li>
</ul>
<div class="phpdocumentor-row">
<h2 class="phpdocumentor-content__title">Deprecated</h2>
<div class="phpdocumentor-admonition phpdocumentor-admonition--success">
No deprecated elements have been found in this project.
</div>
</div>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="reports/deprecated.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

191
doc/reports/errors.html Normal file
View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> PSR-15 Queue &raquo; Compilation errors
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li><a href="">Home</a></li>
</ul>
<div class="phpdocumentor-row">
<h2 class="phpdocumentor-content__title">Errors</h2>
<div class="phpdocumentor-admonition phpdocumentor-admonition--success">No errors have been found in this project.</div>
</div>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="reports/errors.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

192
doc/reports/markers.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> PSR-15 Queue &raquo; Markers
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PSR-15 Queue</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://packagist.org/packages/opencultureconsulting/basics">
<span>
<i class="fab fa-php"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://github.com/opencultureconsulting/php-basics">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -documentation">
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/overview/index.html#overview" class="">Overview</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/overview/queuerequesthandler.html#queuerequesthandler" class="">QueueRequestHandler</a>
</li>
<li>
<a href="guides/overview/middlewarequeue.html#middlewarequeue" class="">MiddlewareQueue</a>
</li>
<li>
<a href="guides/overview/abstractmiddleware.html#abstractmiddleware" class="">AbstractMiddleware</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
</li>
<li>
<a href="guides/usage/installation.html#installation" class="">Installation</a>
</li>
<li>
<a href="guides/usage/usage.html#usage" class="">Usage</a>
</li>
</ul>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="guides/changelog.html#changelog" class="">Changelog</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/occ.html" class="">OCC</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/occ-psr15.html" class="">PSR15</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/PSR15.html" class="">PSR15</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li><a href="">Home</a></li>
</ul>
<div class="phpdocumentor-row">
<h2 class="phpdocumentor-content__title">Markers</h2>
<div class="phpdocumentor-admonition phpdocumentor-admonition--success">
No markers have been found in this project.
</div>
</div>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="reports/markers.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

View File

@ -6,7 +6,7 @@
errorLevel="1"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="true"
findUnusedCode="false"
findUnusedVariablesAndParams="true"
>
<issueHandlers>

View File

@ -99,8 +99,6 @@ abstract class AbstractMiddleware implements MiddlewareInterface
* @param RequestHandler $handler The request handler to delegate to
*
* @return Response The response object
*
* @api
*/
final public function __invoke(ServerRequest $request, RequestHandler $handler): Response
{

View File

@ -120,7 +120,6 @@ class QueueRequestHandler implements RequestHandler
$exception->getMessage()
)
);
$this->respond(1);
}
}
return $this->response;
@ -129,7 +128,9 @@ class QueueRequestHandler implements RequestHandler
/**
* Return the current response to the client.
*
* @param ?int $exitCode Exit code after sending out the response or NULL to continue
* @param ?int $exitCode Exit status after sending out the response or NULL to continue
*
* Must be in the range 0 to 254. The status 0 is used to terminate the program successfully.
*
* @return void
*
@ -166,6 +167,14 @@ class QueueRequestHandler implements RequestHandler
}
echo $this->response->getBody();
if (!is_null($exitCode)) {
$options = [
'options' => [
'default' => 1,
'min_range' => 0,
'max_range' => 254
]
];
$exitCode = filter_var($exitCode, FILTER_VALIDATE_INT, $options);
exit($exitCode);
}
}
@ -177,7 +186,7 @@ class QueueRequestHandler implements RequestHandler
*
* @internal
*/
protected function magicGetQueue(): MiddlewareQueue
protected function _magicGetQueue(): MiddlewareQueue
{
return $this->queue;
}
@ -226,8 +235,6 @@ class QueueRequestHandler implements RequestHandler
* @param ?ServerRequest $request The PSR-7 server request to handle
*
* @return Response A PSR-7 compatible HTTP response
*
* @api
*/
public function __invoke(?ServerRequest $request = null): Response
{