Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify redirects of legacy docs #23

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/book/api.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/creating-middleware.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/error-handlers.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/executing-middleware.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/install.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/middleware.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/book/migration.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/book/migration/preparing-for-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ no longer support operation directly within a double-pass architecture, this
class will be removed.

Methods that produce an instance include:

- `MiddlewarePipe::__invoke()`
- `NotFoundHandler::__invoke()`
- `ErrorHandler::__invoke()`
Expand Down
8 changes: 0 additions & 8 deletions docs/book/usage.md

This file was deleted.

5 changes: 2 additions & 3 deletions docs/book/v1/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ you will need to:
- Create and return a concrete response type, OR
- Operate on a response returned by invoking the delegate.

### Providing an altered request:
### Providing an altered request

```php
// Standard invokable:
Expand Down Expand Up @@ -267,7 +267,6 @@ return $delegate->process($request);
**Middleware should always return a response, and, if it cannot, return the
result of delegation.**


### Raising an error condition

- Deprecated as of 1.3.0; please use exceptions and a error handling middleware
Expand Down Expand Up @@ -379,7 +378,7 @@ Additionally, it provides access to the original response created by the server

Stratigility provides several concrete middleware implementations.

#### ErrorHandler and NotFoundHandler
### ErrorHandler and NotFoundHandler

These two middleware allow you to provide handle PHP errors and exceptions, and
404 conditions, respectively. You may read more about them in the
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v1/creating-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function (
) : Psr\Http\Message\ResponseInterface
```

### Legacy error middleware
## Legacy error middleware

- Deprecated since 1.3.0; to be removed in version 2.0.0. Please use the the
`NotFoundHandler` and `ErrorHandler` detailed in the
Expand Down
1 change: 1 addition & 0 deletions docs/book/v1/executing-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $app = new MiddlewarePipe(); // Middleware representing the application
$app->pipe('/api', $api); // API middleware attached to the path "/api"
```

<!-- markdownlint-disable-next-line header-increment -->
> ### Request path changes when path matched
>
> When you pipe middleware using a path (other than '' or '/'), the middleware
Expand Down
1 change: 1 addition & 0 deletions docs/book/v1/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ this point, a "final handler" is composed by default to report 404 status.
So, concisely put, _middleware are PHP callables that accept a request and
response object, and do something with it_.

<!-- markdownlint-disable-next-line header-increment -->
> ### http-interop middleware
>
> The above example demonstrates the legacy (pre-1.3.0) signature for
Expand Down
8 changes: 3 additions & 5 deletions docs/book/v2/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The `MiddlewarePipe` is itself middleware, and can be executed in stacks that
expect the `__invoke()` signature (via the `__invoke()` signature), or stacks
expecting http-interop middleware signatures (via the `process()` method).


When using `__invoke()`, the callable `$out` argument should either implement
delegator/request handler interface from `http-interop/http-middleware`
(depends on version you are using), or use the signature:
Expand Down Expand Up @@ -170,7 +169,7 @@ you will need to:
- Create and return a concrete response type, OR
- Operate on a response returned by invoking the delegate.

### Providing an altered request:
### Providing an altered request

```php
// Standard invokable:
Expand All @@ -195,7 +194,7 @@ function ($request, DelegateInterface $delegate) use ($bodyParser)
}
```

### Providing an altered request and operating on the returned response:
### Providing an altered request and operating on the returned response

```php
function ($request, $response, $next) use ($bodyParser)
Expand Down Expand Up @@ -276,7 +275,6 @@ return $delegate->process($request);
**Middleware should always return a response, and, if it cannot, return the
result of delegation.**


### Raising an error condition

If your middleware cannot complete &mdash; perhaps a database error occurred, a
Expand Down Expand Up @@ -304,7 +302,7 @@ your users.

Stratigility provides several concrete middleware implementations.

#### ErrorHandler and NotFoundHandler
### ErrorHandler and NotFoundHandler

These two middleware allow you to provide handle PHP errors and exceptions, and
404 conditions, respectively. You may read more about them in the
Expand Down
1 change: 1 addition & 0 deletions docs/book/v2/executing-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $app = new MiddlewarePipe(); // Middleware representing the application
$app->pipe('/api', $api); // API middleware attached to the path "/api"
```

<!-- markdownlint-disable-next-line header-increment -->
> ### Request path changes when path matched
>
> When you pipe middleware using a path (other than '' or '/'), the middleware
Expand Down
1 change: 1 addition & 0 deletions docs/book/v2/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ this point, a "final handler" is composed by default to report 404 status.
So, concisely put, _middleware are PHP callables that accept a request object,
and do something with it_.

<!-- markdownlint-disable-next-line header-increment -->
> ### http-interop middleware
>
> The above example demonstrates the using the interfaces from the http-interop
Expand Down
8 changes: 4 additions & 4 deletions docs/book/v2/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ recommend the following:
- Pipe `Laminas\Stratigility\Middleware\OriginalMessages` as the outermost layer of
your application. This will inject the following request attributes into
layers beneath it:
- `originalRequest`, mapping to the request provided to it at invocation.
- `originalResponse`, mapping to the response provided to it at invocation.
- `originalUri`, mapping to the URI composed by the request provided to it at
invocation.
- `originalRequest`, mapping to the request provided to it at invocation.
- `originalResponse`, mapping to the response provided to it at invocation.
- `originalUri`, mapping to the URI composed by the request provided to it at
invocation.

You can then access these values within other middleware:

Expand Down
4 changes: 2 additions & 2 deletions docs/book/v3/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Since your middleware needs to return a response, the instance receives the
handler; if the last middleware in the queue calls on its handler, `Next` will
execute the fallback request handler to generate a response to return.

### Providing an altered request:
### Providing an altered request

```php
function ($request, RequestHandlerInterface $handler) use ($bodyParser)
Expand All @@ -72,7 +72,7 @@ function ($request, RequestHandlerInterface $handler) use ($bodyParser)
}
```

### Providing an altered request and operating on the returned response:
### Providing an altered request and operating on the returned response

```php
function ($request, RequestHandlerInterface $handler) use ($bodyParser)
Expand Down
1 change: 1 addition & 0 deletions docs/book/v3/executing-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $app = new MiddlewarePipe(); // Middleware representing the application
$app->pipe(new PathMiddlewareDecorator('/api', $api)); // API middleware attached to the path "/api"
```

<!-- markdownlint-disable-next-line header-increment -->
> ### Request path changes when path matched
>
> When you use the `PathMiddlewareDecorator` using a path (other than '' or
Expand Down
1 change: 1 addition & 0 deletions docs/book/v3/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Middleware is code that exists between the request and response, and which can
take the incoming request, perform actions based on it, and either complete the
response or pass delegation on to the next middleware in the queue.

<!-- markdownlint-disable-next-line header-increment -->
> ### Installation requirements
>
> The following example depends on the [laminas-httphandlerrunner](http://docs.laminas.dev/laminas-httphandlerrunner)
Expand Down
1 change: 1 addition & 0 deletions docs/book/v3/usage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Usage

<!-- markdownlint-disable-next-line header-increment -->
> ### Installation requirements
>
> The following example depends on the [laminas-httphandlerrunner](http://docs.laminas.dev/laminas-httphandlerrunner)
Expand Down
21 changes: 12 additions & 9 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ nav:
- "Creating Middleware": v1/creating-middleware.md
- "Executing and composing middleware": v1/executing-middleware.md
- "API Reference": v1/api.md
- "_hidden-legacy-page-links":
- "_install": install.md
- "_usage": usage.md
- "_middleware": middleware.md
- "_error-handlers": error-handlers.md
- "_creating-middleware": creating-middleware.md
- "_executing-middleware": executing-middleware.md
- "_api": api.md
- "_migration": migration.md
site_name: laminas-stratigility
site_description: laminas-stratigility
repo_url: 'https://github.com/laminas/laminas-stratigility'
plugins:
- search
- redirects:
redirect_maps:
install.md: v3/install.md
usage.md: v3/usage.md
middleware.md: v3/middleware.md
error-handlers.md: v3/error-handlers.md
creating-middleware.md: v3/creating-middleware.md
executing-middleware.md: v3/executing-middleware.md
api.md: v3/api.md
migration.md: v3/migration.md