Skip to content

Commit

Permalink
Merge pull request LM-Commons#75 from visto9259/laminas-ci
Browse files Browse the repository at this point in the history
Moved to Laminas CI
  • Loading branch information
visto9259 authored Nov 26, 2024
2 parents c79b03e + d0fe843 commit 94c8dd1
Show file tree
Hide file tree
Showing 32 changed files with 711 additions and 771 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/build-test.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Continuous Integration"

on:
pull_request:
push:
branches:
tags:

jobs:
ci:
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/
/.idea/
.phpunit*
#/composer.lock
/.phpcs-cache
5 changes: 5 additions & 0 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ignore_php_platform_requirements": {
"8.4": true
}
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# LmcCors


![Build Status](https://github.com/lm-commons/lmccors/actions/workflows/build-test.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/LM-Commons/LmcCors/badge.svg?branch=master)](https://coveralls.io/github/LM-Commons/LmcCors?branch=master)
[![Latest Stable Version](https://poser.pugx.org/lm-commons/lmc-cors/v)](//packagist.org/packages/lm-commons/lmc-cors)
Expand Down Expand Up @@ -45,8 +44,8 @@ With CORS, you can allow your server to reply to such requests.

You can find better documentation on how CORS works on the web:

* [Mozilla documentation about CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS)
* [CORS server flowchart](http://www.html5rocks.com/static/images/cors_server_flowchart.png)
* [Mozilla documentation about CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS)
* [CORS server flowchart](http://www.html5rocks.com/static/images/cors_server_flowchart.png)

### Event registration

Expand All @@ -57,20 +56,20 @@ of 2. This means that this listener is executed BEFORE the route has been matche

As by default, all the various options are set globally for all routes:

- `allowed_origins`: (array) List of allowed origins. To allow any origin, you can use the wildcard (`*`) character. If
* `allowed_origins`: (array) List of allowed origins. To allow any origin, you can use the wildcard (`*`) character. If
multiple origins are specified, LmcCors will automatically check the `"Origin"` header's value, and only return the
allowed domain (if any) in the `"Allow-Access-Control-Origin"` response header. To allow any sub-domain, you can prefix
allowed domain (if any) in the `"Allow-Access-Control-Origin"` response header. To allow any sub-domain, you can prefix
the domain with the wildcard character (i.e. `*.example.com`). Please note that you don't need to
add your host URI (so if your website is hosted as "example.com", "example.com" is automatically allowed.
- `allowed_methods`: (array) List of allowed HTTP methods. Those methods will be returned for the preflight request to
* `allowed_methods`: (array) List of allowed HTTP methods. Those methods will be returned for the preflight request to
indicate which methods are allowed to the user agent. You can even specify custom HTTP verbs.
- `allowed_headers`: (array) List of allowed headers that will be returned for the preflight request. This indicates
* `allowed_headers`: (array) List of allowed headers that will be returned for the preflight request. This indicates
to the user agent which headers are permitted to be sent when doing the actual request.
- `max_age`: (int) Maximum age (seconds) the preflight request should be cached by the user agent. This prevents the
* `max_age`: (int) Maximum age (seconds) the preflight request should be cached by the user agent. This prevents the
user agent from sending a preflight request for each request.
- `exposed_headers`: (array) List of response headers that are allowed to be read in the user agent. Please note that
* `exposed_headers`: (array) List of response headers that are allowed to be read in the user agent. Please note that
some browsers do not implement this feature correctly.
- `allowed_credentials`: (boolean) If true, it allows the browser to send cookies along with the request.
* `allowed_credentials`: (boolean) If true, it allows the browser to send cookies along with the request.

If you want to configure specific routes, you can add `LmcCors\Options\CorsOptions::ROUTE_PARAM` to your route configuration:

Expand Down Expand Up @@ -178,6 +177,7 @@ testing your API with some Google Chrome extensions), you need to add support fo
the `UriFactory` config (please [refer to the doc](https://docs.laminas.dev/laminas-uri/usage/#creating-a-new-custom-class-uri)).

### Example

To register the `chrome-extension` custom scheme in your API, simply add:

```php
Expand Down
14 changes: 6 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"laminas/laminas-eventmanager": "^2.6.4 || ^3.2.1",
"laminas/laminas-eventmanager": "^3.2.1",
"laminas/laminas-http": "^2.10",
"laminas/laminas-mvc": "^2.7.15 || ^3.1.1",
"laminas/laminas-servicemanager": "^2.7.9 || ^3.4.0"
"laminas/laminas-mvc": "^3.1.1",
"laminas/laminas-servicemanager": "^3.4.0"
},
"require-dev": {
"laminas/laminas-i18n": "^2.9",
"laminas/laminas-log": "^2.10",
"laminas/laminas-modulemanager": "^2.7.2",
"laminas/laminas-view": "^2.8.1",
"phpunit/phpunit": "^10.5 || ^11.0",
"laminas/laminas-coding-standard": "^2.5",
"laminas/laminas-coding-standard": "^3.0",
"vimeo/psalm": "^5.26.0",
"psalm/plugin-phpunit": "^0.19.0"
},
Expand All @@ -69,7 +66,8 @@
"cs-fix": "phpcbf",
"test": "phpunit",
"test-coverage": "phpunit --colors=always --coverage-clover build/logs/clover.xml",
"test-coverage-html": "phpunit --colors=always --coverage-html build/html"
"test-coverage-html": "phpunit --colors=always --coverage-html build/html",
"static-analysis": "psalm --shepherd --stats"
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit 94c8dd1

Please sign in to comment.