]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
php.ini: set date.timezone
authorFloris Bos <bos@je-eigen-domein.nl>
Sat, 2 May 2015 15:10:15 +0000 (17:10 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 2 May 2015 17:18:11 +0000 (19:18 +0200)
Set date.timezone in php.ini to match time zone settings.
Prevents a warning being logged about it not being set
each time a PHP date/time method is used.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/php/php.mk

index 3b9a1176b883023fea8026e3dadb4006558a0fe3..47811fff76ea23a375b4e3751cf4f365d742e3f8 100644 (file)
@@ -24,6 +24,12 @@ PHP_CONF_ENV = \
        ac_cv_func_strcasestr=yes \
        EXTRA_LIBS="$(PHP_EXTRA_LIBS)"
 
+ifeq ($(BR2_TARGET_LOCALTIME),)
+PHP_LOCALTIME = UTC
+else
+PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
+endif
+
 # PHP can't be AUTORECONFed the standard way unfortunately
 PHP_DEPENDENCIES += host-autoconf host-automake host-libtool
 define PHP_BUILDCONF
@@ -288,6 +294,8 @@ define PHP_INSTALL_FIXUP
        rm -f $(TARGET_DIR)/usr/bin/phpize
        $(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
                $(TARGET_DIR)/etc/php.ini
+       $(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
+               $(TARGET_DIR)/etc/php.ini
 endef
 
 PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP