Skip to content
Open

Bref v3 #1953

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
ef62cbc
Start a v3 branch
mnapoli May 24, 2025
77357ce
Update version
mnapoli May 24, 2025
d5f2a8b
Update layer versions
mnapoli May 24, 2025
8ca5a81
Merge pull request #1951 from brefphp/new-layer-versions
mnapoli May 24, 2025
c7b9628
Add ap-southeast-3 and me-central-1 regions
mnapoli May 24, 2025
e89481e
Merge pull request #1952 from brefphp/add-new-regions
mnapoli May 24, 2025
650155b
Remove support for PHP 8.0 and 8.1 in Bref v3 (#1954)
mnapoli May 24, 2025
e9b513c
Improve v3 upgrade documentation
mnapoli May 25, 2025
ec475d5
Upgrade documentation
mnapoli May 25, 2025
17e130c
Switch to a single layer (#1950)
mnapoli May 25, 2025
b19fe71
Update layer versions (#1955)
github-actions[bot] May 25, 2025
4ca7450
Update layer versions (#1957)
github-actions[bot] May 25, 2025
24d73a2
Separate branch for v3 pull requests
mnapoli May 26, 2025
b66fa18
Update layer versions (#1959)
github-actions[bot] May 26, 2025
5e0447b
Force `opcache.file_cache_only=0` for PHP-FPM
mnapoli May 27, 2025
388f187
Update layer versions
mnapoli Aug 21, 2025
118c37c
Merge pull request #1987 from brefphp/new-layer-versions-v3
mnapoli Aug 21, 2025
4b23220
Fix PHPStan error
mnapoli Aug 22, 2025
7bc9e52
Support PHP 8.5
mnapoli Aug 22, 2025
c08cc3e
Merge pull request #1988 from brefphp/php-85
mnapoli Aug 22, 2025
7b0bb03
Update layer versions
mnapoli Aug 22, 2025
8aa284d
Merge pull request #1989 from brefphp/new-layer-versions-v3
mnapoli Aug 22, 2025
a5ff4dd
Update layer versions
mnapoli Aug 22, 2025
0375ef4
Merge pull request #1990 from brefphp/new-layer-versions-v3
mnapoli Aug 24, 2025
da8ed08
Update layer versions
mnapoli Aug 24, 2025
3db9fc9
Merge pull request #1992 from brefphp/new-layer-versions-v3
mnapoli Aug 24, 2025
d500a5b
Support PHP 8.5 in `layers.json`
mnapoli Aug 24, 2025
4218f48
Fix runtime validation
mnapoli Aug 24, 2025
673f4b3
Switch to AL2023
mnapoli Aug 24, 2025
015861e
Run tests on v3
mnapoli Aug 25, 2025
5196c64
Fix tests
mnapoli Aug 25, 2025
d902f2d
Merge branch 'master' into v3
mnapoli Aug 25, 2025
8596f37
Document extension changes for Bref v3
mnapoli Sep 12, 2025
6baa763
Merge pull request #2000 from brefphp/v3-document-extension-changes
mnapoli Sep 12, 2025
d27458d
Update layer versions
mnapoli Sep 12, 2025
44c3b21
Merge pull request #2001 from brefphp/new-layer-versions-v3
mnapoli Sep 12, 2025
2a043ae
Update layer versions
mnapoli Oct 5, 2025
996519b
Merge pull request #2008 from brefphp/new-layer-versions-v3
mnapoli Oct 5, 2025
0606e46
Merge branch 'master' into v3
mnapoli Oct 24, 2025
128d192
Update all documentation to point to provided.al2023 instead of provi…
mnapoli Oct 24, 2025
e6f6c6e
Merge pull request #2011 from brefphp/docs-al2023
mnapoli Oct 24, 2025
d8b0546
Remove the deprecated "hooks" system
mnapoli Oct 24, 2025
50d187c
Fix
mnapoli Oct 24, 2025
9fe6e06
Fix
mnapoli Oct 24, 2025
afda801
Merge pull request #2012 from brefphp/remove-deprecated-hooks
mnapoli Oct 24, 2025
9dbd028
Fix PHP 8.5 deprecations
mnapoli Oct 26, 2025
8a102f2
Merge pull request #2015 from brefphp/fix-php85-deprecations
mnapoli Oct 26, 2025
91812ba
Update layer versions
mnapoli Oct 27, 2025
19685eb
Merge pull request #2017 from brefphp/new-layer-versions-v3
mnapoli Oct 28, 2025
978cec5
Merge branch 'master' into v3
mnapoli Nov 12, 2025
b3594c7
Delete the `bref` CLI
mnapoli Nov 25, 2025
096b8b4
Merge branch 'master' into v3
mnapoli Dec 1, 2025
b253d14
Drop support for unmaintained Symfony versions
mnapoli Dec 1, 2025
a38f487
Fix
mnapoli Dec 1, 2025
b5f759d
Merge pull request #2030 from brefphp/delete-bref-cli
mnapoli Dec 1, 2025
9630b6d
v3 release notes
mnapoli Dec 5, 2025
5dce7a8
Update layer versions
mnapoli Dec 8, 2025
648ab70
Merge pull request #2038 from brefphp/new-layer-versions-v3
mnapoli Dec 9, 2025
05697b6
Update layer versions
mnapoli Dec 15, 2025
135bf2a
Merge pull request #2040 from brefphp/new-layer-versions-v3
mnapoli Dec 15, 2025
02d16d4
Follow-up of https://github.com/brefphp/aws-lambda-layers/pull/303
mnapoli Dec 15, 2025
1c9f122
Fix release notes for Redis
mnapoli Dec 17, 2025
9b2e070
Update layer versions
mnapoli Dec 19, 2025
f77fb85
Merge pull request #2041 from brefphp/new-layer-versions-v3
mnapoli Dec 19, 2025
f544804
Improve logs
mnapoli Dec 25, 2025
8ee5534
Merge branch 'master' into v3
mnapoli Dec 25, 2025
ee89bc3
Remove flag
mnapoli Dec 25, 2025
fa963cb
Improve upgrade guide
mnapoli Jan 9, 2026
e4f32af
Improve
mnapoli Jan 9, 2026
9b85d98
Merge pull request #2036 from brefphp/release-notes
mnapoli Jan 9, 2026
7f490d2
Fix #2048
mnapoli Jan 13, 2026
b5441e9
Fix
mnapoli Jan 13, 2026
5656165
Merge pull request #2051 from brefphp/fix-2048
mnapoli Jan 13, 2026
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
4 changes: 2 additions & 2 deletions .github/aws/github-role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Resources:
- Effect: Allow
Action: sts:AssumeRoleWithWebIdentity
Principal:
Federated: arn:aws:iam::534081306603:oidc-provider/token.actions.githubusercontent.com
Federated: arn:aws:iam::873528684822:oidc-provider/token.actions.githubusercontent.com
Condition:
StringLike:
token.actions.githubusercontent.com:sub: !Sub repo:${FullRepoName}:*
Policies:
- PolicyName: RetrieveLayersForLayerJsRole
- PolicyName: RetrieveLayersForLayerRole
PolicyDocument:
Statement:
- Effect: Allow
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ['master']
branches: ['master', 'v3']
pull_request:
branches: ['*']
schedule:
Expand All @@ -16,11 +16,11 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
php: [ '8.4', '8.3', '8.2', '8.1', '8.0' ]
php: [ '8.5', '8.4', '8.3', '8.2' ]
dependency-version: [ '' ]
platform-reqs: [ '' ]
include:
- php: '8.0'
- php: '8.2'
dependency-version: '--prefer-lowest'
steps:
- name: Checkout
Expand All @@ -40,7 +40,7 @@ jobs:
coverage: none
ini-values: expose_php=1
- name: Install dependencies
run: 'composer update ${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress --no-security-blocking ${{ matrix.platform-reqs }}'
run: 'composer update ${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress ${{ matrix.platform-reqs }}'
- name: Execute Unit Tests
run: 'vendor/bin/phpunit --testsuite small'

Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/update-layer-versions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update layer versions (Bref v2)
name: Update layer versions

# Triggered manually or automatically when new Bref layers published
on:
Expand Down Expand Up @@ -26,12 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: master
ref: v3 # temporary until v3 becomes the main branch

- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::534081306603:role/bref-github-actions
role-to-assume: arn:aws:iam::873528684822:role/bref-github-actions
role-session-name: bref-github-actions
aws-region: us-east-1

Expand All @@ -47,10 +47,10 @@ jobs:
- run: make layers.json

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update layer versions
title: Update Lambda layers [${{ inputs.release_name }}](${{ inputs.release_html_url }})
title: Update v3 layers [${{ inputs.release_name }}](${{ inputs.release_html_url }})
body: |
New AWS Lambda layers [have been released](https://github.com/brefphp/aws-lambda-layers/releases):

Expand All @@ -60,8 +60,6 @@ jobs:
After merging, a new Bref release needs to be created.

If you are using AWS Lambda layer ARNs, check out [runtimes.bref.sh](https://runtimes.bref.sh/) to see the latest ARNs.
branch: new-layer-versions
branch: new-layer-versions-v3
base: v3 # temporary until v3 becomes the main branch
delete-branch: true # delete after merging or closing the PR
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 change: 0 additions & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!-- Show sniff names -->
<arg value="s"/>

<file>bref</file>
<file>src</file>
<file>tests</file>

Expand Down
132 changes: 0 additions & 132 deletions bref

This file was deleted.

9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
}
},
"bin": [
"bref",
"src/bref-local"
],
"require": {
"php": ">=8.0",
"php": ">=8.2",
"ext-curl": "*",
"ext-json": "*",
"crwlr/query-string": "^1.0.3",
Expand All @@ -30,7 +29,7 @@
"psr/http-message": "^1.0|^2.0",
"psr/http-server-handler": "^1.0",
"riverline/multipart-parser": "^2.1.2",
"symfony/process": "^4.4|^5.0|^6.0|^7.0|^8.0"
"symfony/process": "^5.4|^6.4|^7.0|^8.0"
},
"require-dev": {
"async-aws/core": "^1.0",
Expand All @@ -42,8 +41,8 @@
"guzzlehttp/guzzle": "^7.5",
"phpstan/phpstan": "^1.10.26",
"phpunit/phpunit": "^9.6.10",
"symfony/console": "^4.4|^5.0|^6.0|^7.0|^8.0",
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0|^8.0"
"symfony/console": "^5.4|^6.4|^7.0|^8.0",
"symfony/yaml": "^5.4|^6.4|^7.0|^8.0"
},
"scripts": {
"test": [
Expand Down
4 changes: 4 additions & 0 deletions demo/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

require __DIR__ . '/../vendor/autoload.php';

if (isset($_GET['crash'])) {
throw new \Exception('Crash!');
}

if (isset($_GET['sleep'])) {
error_log('This is a log');
sleep(10);
Expand Down
2 changes: 1 addition & 1 deletion docs/default/cli-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We can run CLI commands and scripts on AWS Lambda by deploying a "console" funct
functions:
cli:
handler: the-php-script-to-run.php
runtime: php-81-console
runtime: php-84-console
```

The function uses the [Console runtime](../runtimes/console.mdx).
Expand Down
45 changes: 28 additions & 17 deletions docs/default/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,29 @@ Next, in an empty directory, install Bref using Composer:
composer require bref/bref
```

Make sure that the version of Bref that was installed is 1.0 or greater.
Make sure that the version of Bref that was installed is 3.0 or greater.

Then let's start by initializing a new project by running:
Then, create a `serverless.yml` file. This file will describe how to deploy your application.

```bash
vendor/bin/bref init
```

Accept all the defaults by pressing "Enter". The following files will be created in your project:

- `index.php` contains the code of your application
- `serverless.yml` contains the configuration for deploying on AWS

You are free to edit `index.php`.
```yml filename="serverless.yml"
service: app # your application name (lowercase without spaces)

To deploy an existing application, you can delete `index.php` and edit `serverless.yml` to point to your existing index file (for example it may be another file like `public/index.php`). You can also create the `serverless.yml` file manually:
bref:
# Uncomment and set your team ID if you are using Bref Cloud
#team: bref-team-id

```yml filename="serverless.yml"
service: app
provider:
name: aws
region: us-east-1
region: us-east-1 # AWS region to deploy to
environment: # Environment variables
APP_ENV: prod

functions:
web:
# `index.php` is the entrypoint of your application
handler: index.php
runtime: php-81-fpm
runtime: php-84-fpm
timeout: 28 # in seconds (API Gateway has a max timeout of 29 seconds)
events:
- httpApi: '*'

Expand All @@ -66,6 +62,21 @@ plugins:
- ./vendor/bref/bref
```

If your `index.php` entrypoint is in a different folder, feel free to adjust the `handler` key. For example if it is in `public/index.php`:

```yml
handler: public/index.php
```

If this is a new application, you can create a very simple `index.php` file to test things out, for example:

```php
<?php
echo 'Hello world!';
```

You will also want to add `.serverless` to your `.gitignore`.

## Deployment

To deploy, run:
Expand Down
Loading
Loading