Skip to content
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
12 changes: 12 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ functions:
| Igbinary | `${bref-extra:igbinary-php-81}` |
| Imagick | `${bref-extra:imagick-php-81}` |
| IMAP | `${bref-extra:imap-php-81}` |
| Iconv Extra | `${bref-extra:iconv-extra-php-81}` |
| LDAP | `${bref-extra:ldap-php-81}` |
| Mailparse | `${bref-extra:mailparse-php-81}` |
| MaxMind DB | `${bref-extra:maxminddb-php-81}` |
Expand Down Expand Up @@ -105,6 +106,17 @@ functions:
| xmlrpc | `${bref-extra:xmlrpc-php-81}` |
| Yaml | `${bref-extra:yaml-php-81}` |

### Iconv Extra setup

The Iconv Extra layer provides additional glibc conversion modules for legacy character encodings,
such as Windows-1250. Set `GCONV_PATH` in `serverless.yaml` so glibc can find the modules before PHP starts:

```yaml
provider:
environment:
GCONV_PATH: /opt/lib/gconv
```

### Blackfire installation

The Blackfire layer only have the probe installed.
Expand Down
8 changes: 8 additions & 0 deletions layers/iconv-extra/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG PHP_VERSION
ARG BREF_VERSION

FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

FROM scratch

COPY --from=ext /usr/lib64/gconv/ /opt/lib/gconv/
8 changes: 8 additions & 0 deletions layers/iconv-extra/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"php": [
"82",
"83",
"84",
"85"
]
}
11 changes: 11 additions & 0 deletions layers/iconv-extra/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$input = hex2bin('f5fbc1c9');
$result = iconv('WINDOWS-1250', 'UTF-8', $input);

if ($result !== 'őűÁÉ') {
echo 'FAIL: WINDOWS-1250 conversion is unavailable.', PHP_EOL;
exit(1);
}

exit(0);
1 change: 1 addition & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ FROM bref/php-$PHP_VERSION:3

COPY --from=ext /opt /opt
ENV ODBCSYSINI=/opt/microsoft/conf/
ENV GCONV_PATH=/opt/lib/gconv
Loading