https://bugs.webkit.org/show_bug.cgi?id=166839
authorlforschler@apple.com <lforschler@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2017 17:39:14 +0000 (17:39 +0000)
committerlforschler@apple.com <lforschler@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2017 17:39:14 +0000 (17:39 +0000)
Add php7 support for macOS.
Tools:

Mirror the debian logic to look for a php7 module on disk, and return the appropriate apache config file.

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/base.py:
(Port._is_darwin_php_version_7):
(Port._debian_php_version):
(Port):
(Port._darwin_php_version):
(Port._apache_config_file_name_for_platform):

LayoutTests:

This patch mirrors the solution that debian uses, by adding a php7 specific apache conf file.

Reviewed by Alexey Proskuryakov.

* http/conf/apache2.4-php7-httpd.conf: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210510 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/conf/apache2.4-php7-httpd.conf
Tools/ChangeLog
Tools/Scripts/webkitpy/port/base.py

index 605eca5..ba2c845 100644 (file)
@@ -1,3 +1,13 @@
+2017-01-09  Lucas Forschler  <lforschler@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=166839
+        Add php7 support for macOS.
+        This patch mirrors the solution that debian uses, by adding a php7 specific apache conf file.
+
+        Reviewed by Alexey Proskuryakov.
+
+        * http/conf/apache2.4-php7-httpd.conf: Added.
+
 2017-01-09  Ryan Haddad  <ryanhaddad@apple.com>
 
         Marking inspector/debugger/breakpoint-action-log.html as flaky on macOS.
index 1abb51f..f03d009 100644 (file)
@@ -33,7 +33,7 @@ LoadModule negotiation_module libexec/apache2/mod_negotiation.so
 LoadModule actions_module libexec/apache2/mod_actions.so
 LoadModule alias_module libexec/apache2/mod_alias.so
 LoadModule rewrite_module libexec/apache2/mod_rewrite.so
-LoadModule php5_module        libexec/apache2/libphp5.so
+LoadModule php7_module        libexec/apache2/libphp7.so
 
 ServerName 127.0.0.1
 
@@ -123,7 +123,7 @@ ServerSignature On
     AddHandler send-as-is asis
 </IfModule>
 
-<IfModule mod_php5.c>
+<IfModule mod_php7.c>
     AddType application/x-httpd-php .php
     AddType application/x-httpd-php .bat
     AddType application/x-httpd-php-source .phps
index 0a99f58..954e24b 100644 (file)
@@ -1,3 +1,18 @@
+2017-01-09  Lucas Forschler  <lforschler@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=166839
+        Add php7 support for macOS.
+        Mirror the debian logic to look for a php7 module on disk, and return the appropriate apache config file.
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/port/base.py:
+        (Port._is_darwin_php_version_7):
+        (Port._debian_php_version):
+        (Port):
+        (Port._darwin_php_version):
+        (Port._apache_config_file_name_for_platform):
+
 2017-01-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         [GTK] Should support key and code properties on keyboard events
index 6175598..94ded6f 100644 (file)
@@ -1164,6 +1164,11 @@ class Port(object):
             return True
         return False
 
+    def _is_darwin_php_version_7(self):
+        if self._filesystem.exists("/usr/libexec/apache2/libphp7.so"):
+            return True
+        return False
+
     # FIXME: This belongs on some platform abstraction instead of Port.
     def _is_redhat_based(self):
         return self._filesystem.exists('/etc/redhat-release')
@@ -1183,6 +1188,11 @@ class Port(object):
             return "-php7"
         return ""
 
+    def _darwin_php_version(self):
+        if self._is_darwin_php_version_7():
+            return "-php7"
+        return ""
+
     def _fedora_php_version(self):
         if self._is_fedora_php_version_7():
             return "-php7"
@@ -1192,6 +1202,8 @@ class Port(object):
     def _apache_config_file_name_for_platform(self, sys_platform):
         if sys_platform == 'cygwin' or sys_platform.startswith('win'):
             return 'apache' + self._apache_version() + '-httpd-win.conf'
+        if sys_platform == 'darwin':
+            return 'apache' + self._apache_version() + self._darwin_php_version() + '-httpd.conf'
         if sys_platform.startswith('linux'):
             if self._is_redhat_based():
                 return 'fedora-httpd-' + self._apache_version() + self._fedora_php_version() + '.conf'