brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.14k stars 364 forks source link

Add the xsl extension #455

Closed JGamboa closed 5 years ago

JGamboa commented 5 years ago

do anyone knows how to add xsl extension?

mnapoli commented 5 years ago

The xsl extension isn't installed in Bref layers (see https://bref.sh/docs/environment/php.html#extensions).

However it seems that it is an extension that is usually installed by default (see https://www.php.net/manual/en/xsl.installation.php). If that's the case and it doesn't add too much size to the layers, we should probably add it.

Could you (or anyone else) confirm that the xsl extension is installed and enabled by default in classic distributions of PHP, for example on Debian?

italo1983 commented 5 years ago

libxml and libxslt are very useful, used also in SOAP webservices or in XLST transformation (XML to PDF/HTML), please we also need those extensions. Maybe libxml + libxslt + GD will be available on the next release?

JGamboa commented 5 years ago

@mnapoli i know that for the install you have to do sudo apt-get install php5-xsl and thats all :B

JGamboa commented 5 years ago

any news :D? @mnapoli

mnapoli commented 5 years ago

@JGamboa any news will be displayed in this issue.

We are still waiting to learn if this extension is installed by default in most distributions (Debian, Ubuntu, official PHP Docker image…).

JGamboa commented 5 years ago

@mnapoli im really sorry i cant answer that because i really dont know about docker, but i will try to learn about it

italo1983 commented 5 years ago

It's not enabled by default but installed in a tipically LAMP environment. For example: http://devilbox.org/ but also installed and enabled by default with most used hosting control panels like VestaCP. Please can you add it? Installed filesize is +/- 100Kb but i think that's is very useful for application transforming XML or working with xsl files for import/export purpose.

JGamboa commented 5 years ago

@mnapoli i have a laradock environment to test laravel apps, and i look at the dockerfile and for the xsl extension this is what is written

###########################################################################

XSL:

###########################################################################

USER root

ARG INSTALL_XSL=false

RUN if [ ${INSTALL_XSL} = true ]; then \

Install the PHP XSL extension

apt-get -y install libxslt-dev php${LARADOCK_PHP_VERSION}-xsl \ ;fi

JGamboa commented 5 years ago

###########################################################################

ARG INSTALL_XSL=false

RUN if [ ${INSTALL_XSL} = true ]; then \

Install the xsl extension

apt-get -y install libxslt-dev && \
docker-php-ext-install xsl \

;fi

###########################################################################

tristanbes commented 5 years ago

@mnapoli XSL is required by pinky, which could be required in the new Symfony Mailer component (twig/extra-bundle twig/inky-extra) when you want to write your emails in Inky templating language;

https://symfony.com/doc/current/mailer.html#inky-email-templating-language

So, I think it would be worth adding to the bref layer; WDYT ?

Kocal commented 5 years ago

XSL extension is required by pinky, a package which is required by Symfony Twig Inky extra library for sending emails which use Inky.

See https://symfony.com/doc/current/mailer.html#inky-email-templating-language

It would be really nice to have it shipped natively, what do you think?

Could you (or anyone else) confirm that the xsl extension is installed and enabled by default in classic distributions of PHP, for example on Debian?

XSL extension is enabled by default on Debian 9.11 and PHP 7.2.23:

➜  ~ php -v                           
PHP 7.2.23-1+0~20191008.27+debian9~1.gbp021266 (cli) (built: Oct  8 2019 05:48:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.23-1+0~20191008.27+debian9~1.gbp021266, Copyright (c) 1999-2018, by Zend Technologies

➜  ~ php -i | grep xsl
/etc/php/7.2/cli/conf.d/20-xsl.ini,
xsl
libxslt Version => 1.1.29
libxslt compiled against libxml Version => 2.9.4
libexslt Version => 1.1.29

Thanks!

JGamboa commented 5 years ago

@Kocal do you know the vapor project of laravel? do you know how to add xsl to the vapor layer?

Kocal commented 5 years ago

I've heard of Laravel Vapor but no I don't know how to add/enable extension XSL with Vapor. Try to ask to their support.

JGamboa commented 5 years ago

@Kocal i ask but they are not going to add more extension lol

Kocal commented 5 years ago

I'm gonna try to open a PR by using #452 as model :sweat_smile:

mnapoli commented 5 years ago

Hi everyone, thanks for confirming, I think it makes sense to include the extension then. We will have to check that it doesn't add too much to the layer.

If anyone of you wants to open a PR 👍

Kocal commented 5 years ago

A PR has been opened #484

JGamboa commented 5 years ago

@Kocal nice! thanks you