Open thekid opened 2 years ago
However, all these increase the PHP binary size, it might be valuable looking into providing these as extra layers like Bref does, but instead of hosting them somewhere, providing a xp lambda layer
command to create them from scratch
libxml, dom, xml, xmlreader, xmlwriter - for processing XML and HTML
See #11
mbstring - prerequisite for exif anyways
See #12
https://packagist.org/packages/aws/aws-sdk-php and https://packagist.org/packages/async-aws/core require SimpleXML
https://packagist.org/packages/aws/aws-sdk-php and https://packagist.org/packages/async-aws/core require SimpleXML
Rolled out in https://github.com/xp-forge/lambda/releases/tag/v3.1.0
ZLib could be implemented via https://gist.github.com/chobie/6659137 as a fallback:
"You can use my implementation freely even for commercial purpose ..."
ZLib could be implemented
...but on the other hand, simply adding the --with-zlib
configure option doesn't yield a big difference!
Before:
[+] Creating runtime-8.0.21.zip
=> create --name 62d00678ec295 lambda-xp-runtime:8.0.21
aeb956bff0da38d5254234ca63e3594a5f6f9dff9ed485353cd08557194d4fef
=> cp 62d00678ec295:/opt/php/runtime.zip runtime-8.0.21.zip
=> rm -f 62d00678ec295
aeb956bff0da38d5254234ca63e3594a5f6f9dff9ed485353cd08557194d4fef
Wrote 2,530,040 bytes
After:
[+] Creating runtime-8.0.21.zip
=> create --name 62d008947c97a lambda-xp-runtime:8.0.21
bd517bac950db0f3542c93ba2ef63faeeb991b5873b5b083b3c8282ebb5094d8
=> cp 62d008947c97a:/opt/php/runtime.zip runtime-8.0.21.zip
=> rm -f 62d008947c97a
bd517bac950db0f3542c93ba2ef63faeeb991b5873b5b083b3c8282ebb5094d8
Wrote 2,542,744 bytes
(~12 Kilobytes)
zlib - if we want to create ZIP files, HTTP compression
Rolled out in https://github.com/xp-forge/lambda/releases/tag/v4.1.0
The configure line used is:
./configure \
--prefix=/opt/php/ \
--without-sqlite3 \
--with-zlib \
--with-openssl \
--enable-bcmath \
--disable-pdo
Currently, we compile with the following extensions enabled:
Looking at https://bref.sh/docs/environment/php.html#extensions-installed-and-enabled and from scanning through use cases, the following could be interesting:
zlib - if we want to create ZIP files, HTTP compression- see https://github.com/xp-forge/lambda/issues/8#issuecomment-1184378957libxml, dom, xml, xmlreader, xmlwriter - for processing XML and HTML- see #11The following extensions don't seem to make sense for an AWS lambda enviromment:
SimpleXML - covered by XP Framework's XML APIs- used by AWS SDK, see https://github.com/xp-forge/lambda/issues/8#issuecomment-966497081