From adfd94e74d23926459cbe1069093eb5b059e9221 Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Tue, 16 Apr 2024 12:21:08 +0300 Subject: [PATCH] Changed line separators for files --- .github/workflows/continuous-integration.yml | 22 ++-- .github/workflows/docs-build.yml | 32 +++--- docs/book/index.md | 2 +- docs/book/v3/configuration.md | 114 +++++++++---------- docs/book/v3/installation.md | 10 +- docs/book/v3/overview.md | 6 +- docs/book/v3/usage.md | 48 ++++---- 7 files changed, 117 insertions(+), 117 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 72dde2f..26c5802 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,11 +1,11 @@ -name: "Continuous Integration" - -on: - pull_request: - push: - branches: - tags: - -jobs: - ci: - uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + tags: + +jobs: + ci: + uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index a18edb1..1a7aa24 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -1,16 +1,16 @@ -name: docs-build - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - build-deploy: - runs-on: ubuntu-latest - steps: - - name: Build Docs - uses: dotkernel/documentation-theme/github-actions/docs@main - env: - DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +name: docs-build + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Build Docs + uses: dotkernel/documentation-theme/github-actions/docs@main + env: + DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/book/index.md b/docs/book/index.md index 4c0539a..ae42a26 100644 --- a/docs/book/index.md +++ b/docs/book/index.md @@ -1 +1 @@ -../../README.md +../../README.md diff --git a/docs/book/v3/configuration.md b/docs/book/v3/configuration.md index 330b18b..64c3e9c 100644 --- a/docs/book/v3/configuration.md +++ b/docs/book/v3/configuration.md @@ -1,57 +1,57 @@ -# Configuration - -## Requirements - -- PHP >= 8.1 - -## Register ConfigProvider - -Next, register the package's `ConfigProvider` to your application config. - -```php -Dot\ResponseHeader\ConfigProvider::class, -``` - -Note : Make sure to register the package under the `// DK packages` section. - -## Add the package to the middleware stack - -After registering the package, add it to the middleware stack in `config/pipeline.php` after `$app->pipe(RouteMiddleware::class);` - -```php -$app->pipe(RouteMiddleware::class); -$app->pipe(\Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware::class); -``` - -## Add configuration in autoload - -Create a new file `response-header.global.php` in `config/autoload` with the below configuration array : - -```php - [ - '*' => [ - 'CustomHeader1' => [ - 'value' => 'CustomHeader1-Value', - 'overwrite' => true, - ], - 'CustomHeader2' => [ - 'value' => 'CustomHeader2-Value', - 'overwrite' => false, - ], - ], - 'home' => [ - 'CustomHeader' => [ - 'value' => 'header3', - ] - ], - 'login' => [ - 'LoginHeader' => [ - 'value' => 'LoginHeader-Value', - 'overwrite' => false - ] - ], - ] -]; -``` +# Configuration + +## Requirements + +- PHP >= 8.1 + +## Register ConfigProvider + +Next, register the package's `ConfigProvider` to your application config. + +```php +Dot\ResponseHeader\ConfigProvider::class, +``` + +Note : Make sure to register the package under the `// DK packages` section. + +## Add the package to the middleware stack + +After registering the package, add it to the middleware stack in `config/pipeline.php` after `$app->pipe(RouteMiddleware::class);` + +```php +$app->pipe(RouteMiddleware::class); +$app->pipe(\Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware::class); +``` + +## Add configuration in autoload + +Create a new file `response-header.global.php` in `config/autoload` with the below configuration array : + +```php + [ + '*' => [ + 'CustomHeader1' => [ + 'value' => 'CustomHeader1-Value', + 'overwrite' => true, + ], + 'CustomHeader2' => [ + 'value' => 'CustomHeader2-Value', + 'overwrite' => false, + ], + ], + 'home' => [ + 'CustomHeader' => [ + 'value' => 'header3', + ] + ], + 'login' => [ + 'LoginHeader' => [ + 'value' => 'LoginHeader-Value', + 'overwrite' => false + ] + ], + ] +]; +``` diff --git a/docs/book/v3/installation.md b/docs/book/v3/installation.md index 7cdd8e0..a1a5edb 100644 --- a/docs/book/v3/installation.md +++ b/docs/book/v3/installation.md @@ -1,5 +1,5 @@ -# Installation - -Install dotkernel/dot-response-header by executing the following Composer command in your project directory: - - composer require dotkernel/dot-response-header +# Installation + +Install dotkernel/dot-response-header by executing the following Composer command in your project directory: + + composer require dotkernel/dot-response-header diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index d57c953..56a80cc 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,3 +1,3 @@ -# Overview - -`dot-response-header` is DotKernel's middleware for setting and overwriting custom response headers. +# Overview + +`dot-response-header` is DotKernel's middleware for setting and overwriting custom response headers. diff --git a/docs/book/v3/usage.md b/docs/book/v3/usage.md index 3e5f8d7..131fe86 100644 --- a/docs/book/v3/usage.md +++ b/docs/book/v3/usage.md @@ -1,24 +1,24 @@ -# Usage - -Because headers are matched with route names, we can have custom response headers for every request, by defining new headers under the `*` key, in the configuration file `response-header.global.php`. - -All headers under `*` will be set for every response. - -To add response headers for a specific set of routes, define a new array using the route name as the array key. - -## Example - -```php -'dot_response_headers' => [ - 'user' => [ - 'UserCustomHeader' => [ - 'value' => 'UserCustomHeader-Value', - 'overwrite' => false - ] - ], -] - -// This will set a new header named UserCustomHeader with the UserCustomHeader-Value value for any route name matching 'user' -``` - -To overwrite an existing header use `overwrite => true`. +# Usage + +Because headers are matched with route names, we can have custom response headers for every request, by defining new headers under the `*` key, in the configuration file `response-header.global.php`. + +All headers under `*` will be set for every response. + +To add response headers for a specific set of routes, define a new array using the route name as the array key. + +## Example + +```php +'dot_response_headers' => [ + 'user' => [ + 'UserCustomHeader' => [ + 'value' => 'UserCustomHeader-Value', + 'overwrite' => false + ] + ], +] + +// This will set a new header named UserCustomHeader with the UserCustomHeader-Value value for any route name matching 'user' +``` + +To overwrite an existing header use `overwrite => true`.