[Buildroot] [PATCH 3/6] php: enable opcache extension in php.ini if selected
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Mon May 18 20:36:09 UTC 2015
Dear Floris Bos,
On Mon, 18 May 2015 21:52:01 +0200, Floris Bos wrote:
> Add a line to load the opcache extension in php.ini, at the
> bottom of the "dynamic extensions" section.
>
> Signed-off-by: Floris Bos <bos at je-eigen-domein.nl>
> ---
> package/php/php.mk | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/package/php/php.mk b/package/php/php.mk
> index c36a80c..65d5015 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -296,6 +296,9 @@ define PHP_INSTALL_FIXUP
> $(TARGET_DIR)/etc/php.ini
> $(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
> $(TARGET_DIR)/etc/php.ini
> + $(if $(BR2_PACKAGE_PHP_EXT_OPCACHE),
> + $(SED) '/;extension=php_xsl.dll/azend_extension=opcache.so' \
Why are you replacing the extension=php_xsl.dll line specifically?
If you're only looking at adding an extension, what about:
$(if $(BR2_PACKAGE_PHP_EXT_OPCACHE),
grep -q ^azend_extension=opcache.so $(TARGET_DIR)/etc/php.ini || \
echo azend_extension=opcache.so >> $(TARGET_DIR)/etc/php.ini)
I don't know it's a few more lines, but it seems more "correct" than
hijacking some random line from php.ini, no?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
More information about the buildroot
mailing list