Releases: brefphp/bref
0.5.13
0.5.12
Just one thing in this release: PHP 7.4 support 🎉 Contributed by @ondrejmirtes, @mnapoli. Special thanks to @nikic for the review!
Replace php-73
with php-74
in serverless.yml
to switch to PHP 7.4.0.
Bref also got a new sponsor this month! A big thanks to Craft CMS for their support!
Want to help? Your company can sponsor too.
0.5.11
-
#488, #498: Added the xdebug and blackfire extensions to the dev Docker images (not production layers!), by @jenschude
You can now use XDebug and Blackfire when developing locally using Docker. Those extensions have been added to the Bref Docker images (development images only).
The extensions are not loaded by default, have a look at the documentation to use them.
-
#503: Updated the documentation to signal that VPC cold start improvements are now deployed in new regions, by @mchristie.
The new regions are: US West (N. California), South America (San Paulo), EU (Ireland), EU (Paris), EU (Frankfurt), Asia Pacific (Mumbai), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney).
-
#505: Fixed a regression introduced when we added support for binary responses (like images, PDF, etc.).
Those binary responses are now supported correctly, however a small change is necessary for that. One could consider it a breaking change, but this is in some way a revert of the regression: the regression itself was the breaking change. Really sorry about that!
To sum up:
- if you updated Bref to use the new feature that allowed to return binary responses, you should read the documentation to apply the feature correctly now
- if you don't know/care about that, you don't have anything to do
0.5.10
- #452: Add the Imagick PHP extension by @victormacko
- #484: Add the XSL extension by @Kocal
- #494: Fix base64 encoding issue with some JSON responses by @jasonmccallister
- #490: New
bref/build-php-72
andbref/build-php-73
Docker images by @mnapoli
These images can be used to compile custom PHP extensions. The documentation to build custom extensions has been improved (even though it is still raw).
0.5.9
-
Fix #480: errors in the
console
layer are now correctly reported as failures to AWS Lambda and CloudWatch. That means that this will impact the "Failure rate" metric (which is good!). Thanks @Enoptea -
#443 The
AWS_PROFILE
environment variable is now taken into account by thevendor/bin/bref dashboard
command.
New runtimes have been published.
0.5.8
This new release contains documentation improvements and one feature: #476 Add bref.dev short URLs.
A major pain when creating a new application is the API Gateway URL:
https://fd8s8cbq6l.execute-api.us-east-1.amazonaws.com/dev
That URL is long and not friendly. And more importantly, the /dev
prefix breaks routing in most frameworks, like Symfony or Laravel.
I have created a little service called bref.dev. It lets us generate short domains for development. To use it, run:
$ vendor/bin/bref bref.dev
Creating a short URL for https://fd8s8cbq6l.execute-api.us-east-1.amazonaws.com/dev
Short URL created and active for 7 days: https://ca4mb8u.bref.dev
The short URL that is created can be used instead of the API Gateway URL. It is shorter and does not have a directory prefix.
At the moment the service is in beta. It can break at any time. Short URLs are valid for 7 days after which they are disabled. That helps keep the service lean and cost-efficient.
0.5.7
-
Fix #372 with #466 Allow the region to be a variable in
serverless.yml
, by @harmenjanssen -
#288, #457 Support binary responses (images, PDF, etc.) by @victormacko, @shrink, @Guillaume-Rossignol, @italo1983 and @bubba-h57.
It took months but we finally have a solution that requires the least effort from users, and supports the most use cases. Bref will automatically detect if the response is a text response or a binary response, and will behave accordingly (binary responses need to be sent as base64-encoded to API Gateway).
Below is an extract of the new documentation that can be read at https://bref.sh/docs/runtimes/http.html#binary-responses:
By default API Gateway does not support binary HTTP responses like images, PDF, binary files… To achieve this, you need to enable the option for binary responses in serverless.yml
:
provider:
# ...
apiGateway:
binaryMediaTypes:
- '*/*'
This will make API Gateway support binary responses for all responses. Your application can now return binary responses as usual.
However, you must define a Content-Type
header on binary responses. If you don't, you may get the following error: Failed encoding Lambda JSON response: Malformed UTF-8 characters, possibly incorrectly encoded. Symfony's helpers or Laravel's helpers will take care of that for you. If you don't use them, here are some examples:
// Vanilla PHP example with a JPEG image response:
header('Content-Type: image/jpeg');
header('Content-Length: ' . filesize($filename));
fpassthru(fopen($filename, 'rb'));
// PSR-7 example:
return $response
->withHeader('Content-Type', 'image/jpeg')
->withHeader('Content-Length', (string) filesize($filename))
->withBody(new Stream($filename));
0.5.6
0.5.6-beta1
Alpha release to test the GD extension (#396).
0.5.5
- #401, #407: The API Gateway timeout is changed to 28s for new projects, by @linuxjuggler
- #429: Add the
--stage
option for the bref dashboard, by @TiagoBrito