From: <abe...@us...> - 2014-08-19 20:37:36
|
Revision: 6639 http://sourceforge.net/p/astlinux/code/6639 Author: abelbeck Date: 2014-08-19 20:37:32 +0000 (Tue, 19 Aug 2014) Log Message: ----------- php, dynamically define /etc/php.ini so 'date.timezone' is specified, manually define with /mnt/kd/php.ini.conf Modified Paths: -------------- branches/1.0/package/lighttpd/lighttpd.init branches/1.0/package/lighttpd/lighttpd.mk branches/1.0/package/php/php.mk branches/1.0/package/webinterface/webinterface.mk branches/1.0/project/astlinux/target_skeleton/etc/rc Added Paths: ----------- branches/1.0/package/lighttpd/php.ini.conf Modified: branches/1.0/package/lighttpd/lighttpd.init =================================================================== --- branches/1.0/package/lighttpd/lighttpd.init 2014-08-18 22:11:27 UTC (rev 6638) +++ branches/1.0/package/lighttpd/lighttpd.init 2014-08-19 20:37:32 UTC (rev 6639) @@ -2,6 +2,23 @@ . /etc/rc.conf +gen_php_ini() { + + if [ -f /mnt/kd/php.ini.conf ]; then + echo "; Autogenerated. Edit /mnt/kd/php.ini.conf file. +" >/tmp/etc/php.ini + cat /mnt/kd/php.ini.conf >>/tmp/etc/php.ini + else + echo "; Autogenerated. Do not edit. +; A manually generated php.ini will use /mnt/kd/php.ini.conf if it exists. +" >/tmp/etc/php.ini + cat /stat/etc/php.ini.conf >>/tmp/etc/php.ini + fi + + sed -i -e "s|@TIMEZONE@|${TIMEZONE}|g" \ + /tmp/etc/php.ini +} + init () { mkdir -p /var/log/lighttpd @@ -12,6 +29,9 @@ ln -snf /stat/var/www /var/www fi + # Genearate /etc/php.ini PHP initialization file + gen_php_ini + # Genearate /etc/lighttpd.conf configuration file if [ -f /mnt/kd/lighttpd.conf ]; then echo "# Autogenerated. Edit /mnt/kd/lighttpd.conf file. Modified: branches/1.0/package/lighttpd/lighttpd.mk =================================================================== --- branches/1.0/package/lighttpd/lighttpd.mk 2014-08-18 22:11:27 UTC (rev 6638) +++ branches/1.0/package/lighttpd/lighttpd.mk 2014-08-19 20:37:32 UTC (rev 6639) @@ -51,6 +51,7 @@ define LIGHTTPD_INSTALL_INITSCRIPT $(INSTALL) -D -m 0644 package/lighttpd/lighttpd.conf $(TARGET_DIR)/stat/etc/lighttpd.conf + $(INSTALL) -D -m 0644 package/lighttpd/php.ini.conf $(TARGET_DIR)/stat/etc/php.ini.conf $(INSTALL) -D -m 0755 package/lighttpd/lighttpd.init $(TARGET_DIR)/etc/init.d/lighttpd $(INSTALL) -D -m 0644 package/lighttpd/lighttpd.logrotate $(TARGET_DIR)/etc/logrotate.d/lighttpd ln -sf /tmp/etc/lighttpd.conf $(TARGET_DIR)/etc/lighttpd.conf Added: branches/1.0/package/lighttpd/php.ini.conf =================================================================== --- branches/1.0/package/lighttpd/php.ini.conf (rev 0) +++ branches/1.0/package/lighttpd/php.ini.conf 2014-08-19 20:37:32 UTC (rev 6639) @@ -0,0 +1,19 @@ +display_errors = Off +display_startup_errors = Off +error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +log_errors = Off +error_log = syslog + +output_buffering = 4096 +post_max_size = 10M +upload_max_filesize = 8M +session.gc_maxlifetime = 1440 +session.gc_probability = 100 +session.gc_divisor = 100 +max_execution_time = 300 + +date.timezone = @TIMEZONE@ + +; Required for PHP 5.3 and earlier +magic_quotes_gpc = Off + Modified: branches/1.0/package/php/php.mk =================================================================== --- branches/1.0/package/php/php.mk 2014-08-18 22:11:27 UTC (rev 6638) +++ branches/1.0/package/php/php.mk 2014-08-19 20:37:32 UTC (rev 6639) @@ -199,6 +199,7 @@ rm -rf $(TARGET_DIR)/usr/lib/php rm -f $(TARGET_DIR)/usr/bin/phpize rm -f $(TARGET_DIR)/usr/bin/php-config + ln -sf /tmp/etc/php.ini $(TARGET_DIR)/etc/php.ini endef PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP Modified: branches/1.0/package/webinterface/webinterface.mk =================================================================== --- branches/1.0/package/webinterface/webinterface.mk 2014-08-18 22:11:27 UTC (rev 6638) +++ branches/1.0/package/webinterface/webinterface.mk 2014-08-19 20:37:32 UTC (rev 6639) @@ -28,7 +28,6 @@ ifeq ($(strip $(BR2_PACKAGE_WEBINTERFACE_v2)),y) rsync -a --exclude=".svn" package/webinterface/altweb/ $(TARGET_DIR)/stat/var/www/ - $(INSTALL) -D -m 644 package/webinterface/altweb/php.ini $(TARGET_DIR)/etc/php.ini $(INSTALL) -D -m 644 package/webinterface/www/admin/.htpasswd $(TARGET_DIR)/stat/var/www/admin/.htpasswd ifeq ($(strip $(BR2_PACKAGE_ASTERISK)),y) @@ -51,7 +50,6 @@ webinterface-clean: rm -rf $(TARGET_DIR)/stat/var/www rm -f $(TARGET_DIR)/usr/sbin/ast-vmpass - rm -f $(TARGET_DIR)/etc/php.ini ifeq ($(strip $(BR2_PACKAGE_ASTERISK)),y) $(SED) '/^\[general\]$$/,/^$$/{s/^enabled = yes$$/enabled = no/}' \ -e '/^\[webinterface\]$$/,/^$$/d' \ Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2014-08-18 22:11:27 UTC (rev 6638) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2014-08-19 20:37:32 UTC (rev 6639) @@ -333,6 +333,7 @@ if [ -f "/usr/share/zoneinfo/$TIMEZONE" ]; then ln -sf "/usr/share/zoneinfo/$TIMEZONE" /tmp/etc/localtime echo "$TIMEZONE" > /tmp/etc/timezone + echo "date.timezone = $TIMEZONE" > /tmp/etc/php.ini else echo "Invalid Timezone: $TIMEZONE" >&2 fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |