Title: [221053] trunk/Websites/perf.webkit.org
Revision
221053
Author
[email protected]
Date
2017-08-22 16:04:19 -0700 (Tue, 22 Aug 2017)

Log Message

Performance Dashboard should be compatible with PHP 7.
https://bugs.webkit.org/show_bug.cgi?id=175813

Reviewed by Ryosuke Niwa.

Use `file_get_contents('php://input')` instead of '$HTTP_RAW_POST_DATA'.
Update test harness script to load right php module in httpd.

* ReadMe.md: JSON example format fix.
* public/api/report-commits.php: Stop using '$HTTP_RAW_POST_DATA'.
* public/api/report.php: Stop using '$HTTP_RAW_POST_DATA'.
* public/api/update-triggerable.php: Stop using '$HTTP_RAW_POST_DATA'.
* public/include/json-header.php: Stop using '$HTTP_RAW_POST_DATA'.
* public/include/report-processor.php: Stop using '$HTTP_RAW_POST_DATA'.
* server-tests/resources/test-server.conf: Load php5 or php7 module conditionally.
* server-tests/resources/test-server.js: Pass PHP version info while launching httpd.
(TestServer.prototype._startApache):
* tools/remote-cache-server.py: Pass PHP version info while launching httpd.
(start_httpd):
* tools/remote-server-relay.conf: Load php5 or php7 module conditionally.
* tools/sync-buildbot.js:
(syncLoop.const.makeTriggerable):
(syncLoop):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (221052 => 221053)


--- trunk/Websites/perf.webkit.org/ChangeLog	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2017-08-22 23:04:19 UTC (rev 221053)
@@ -1,3 +1,29 @@
+2017-08-21  Dewei Zhu  <[email protected]>
+
+        Performance Dashboard should be compatible with PHP 7.
+        https://bugs.webkit.org/show_bug.cgi?id=175813
+
+        Reviewed by Ryosuke Niwa.
+
+        Use `file_get_contents('php://input')` instead of '$HTTP_RAW_POST_DATA'.
+        Update test harness script to load right php module in httpd.
+
+        * ReadMe.md: JSON example format fix.
+        * public/api/report-commits.php: Stop using '$HTTP_RAW_POST_DATA'.
+        * public/api/report.php: Stop using '$HTTP_RAW_POST_DATA'.
+        * public/api/update-triggerable.php: Stop using '$HTTP_RAW_POST_DATA'.
+        * public/include/json-header.php: Stop using '$HTTP_RAW_POST_DATA'.
+        * public/include/report-processor.php: Stop using '$HTTP_RAW_POST_DATA'.
+        * server-tests/resources/test-server.conf: Load php5 or php7 module conditionally.
+        * server-tests/resources/test-server.js: Pass PHP version info while launching httpd.
+        (TestServer.prototype._startApache):
+        * tools/remote-cache-server.py: Pass PHP version info while launching httpd.
+        (start_httpd):
+        * tools/remote-server-relay.conf: Load php5 or php7 module conditionally.
+        * tools/sync-buildbot.js:
+        (syncLoop.const.makeTriggerable):
+        (syncLoop):
+
 2017-08-17  Ryosuke Niwa  <[email protected]>
 
         Number each section in ReadMe.md and add more clarifications

Modified: trunk/Websites/perf.webkit.org/ReadMe.md (221052 => 221053)


--- trunk/Websites/perf.webkit.org/ReadMe.md	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/ReadMe.md	2017-08-22 23:04:19 UTC (rev 221053)
@@ -275,7 +275,7 @@
                 "FrameRate": {
                     "current": [31, 24, 29]
                 }
-            }
+            },
             "tests": {
                 "webkit.org": {
                     "metrics": {
@@ -292,9 +292,9 @@
                         }
                     },
                     "url": "https://www.w3.org/"
-                },
-            },
-        },
+                }
+            }
+        }
     }
 }]
 ```

Modified: trunk/Websites/perf.webkit.org/public/api/report-commits.php (221052 => 221053)


--- trunk/Websites/perf.webkit.org/public/api/report-commits.php	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/public/api/report-commits.php	2017-08-22 23:04:19 UTC (rev 221053)
@@ -99,6 +99,6 @@
     return $inserted_commit_id;
 }
 
-main($HTTP_RAW_POST_DATA);
+main(file_get_contents('php://input'));
 
 ?>

Modified: trunk/Websites/perf.webkit.org/public/api/report.php (221052 => 221053)


--- trunk/Websites/perf.webkit.org/public/api/report.php	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/public/api/report.php	2017-08-22 23:04:19 UTC (rev 221053)
@@ -50,6 +50,6 @@
     exit_with_success();
 }
 
-main($HTTP_RAW_POST_DATA);
+main(file_get_contents('php://input'));
 
 ?>

Modified: trunk/Websites/perf.webkit.org/public/api/update-triggerable.php (221052 => 221053)


--- trunk/Websites/perf.webkit.org/public/api/update-triggerable.php	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/public/api/update-triggerable.php	2017-08-22 23:04:19 UTC (rev 221053)
@@ -142,6 +142,6 @@
     }
 }
 
-main($HTTP_RAW_POST_DATA);
+main(file_get_contents('php://input'));
 
 ?>

Modified: trunk/Websites/perf.webkit.org/public/include/json-header.php (221052 => 221053)


--- trunk/Websites/perf.webkit.org/public/include/json-header.php	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/public/include/json-header.php	2017-08-22 23:04:19 UTC (rev 221053)
@@ -95,7 +95,6 @@
 }
 
 function ensure_privileged_api_data() {
-    global $HTTP_RAW_POST_DATA;
 
     if (config('maintenanceMode'))
         exit_with_error('InMaintenanceMode');
@@ -103,11 +102,8 @@
     if ($_SERVER['REQUEST_METHOD'] != 'POST')
         exit_with_error('InvalidRequestMethod');
 
-    if (!isset($HTTP_RAW_POST_DATA))
-        exit_with_error('InvalidRequestContent');
+    $data = "" true);
 
-    $data = "" true);
-
     if ($data ="" NULL)
         exit_with_error('InvalidRequestContent');
 

Modified: trunk/Websites/perf.webkit.org/public/include/report-processor.php (221052 => 221053)


--- trunk/Websites/perf.webkit.org/public/include/report-processor.php	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/public/include/report-processor.php	2017-08-22 23:04:19 UTC (rev 221053)
@@ -166,7 +166,7 @@
                 array('repository' => $repository_id, 'revision' => $revision_data['revision']), $commit_data, '*');
             if (!$commit_row)
                 $this->exit_with_error('FailedToRecordCommit', $commit_data);
-            if ($commit_data['time'] && abs($commit_row['commit_time'] - $commit_data['time']) > 1.0)
+            if ($commit_data['time'] && abs(floatval($commit_row['commit_time']) - floatval($commit_data['time'])) > 1.0)
                 $this->exit_with_error('MismatchingCommitTime', array('existing' => $commit_row, 'new' => $commit_data));
 
             if (!$this->db->select_or_insert_row('build_commits', null,

Modified: trunk/Websites/perf.webkit.org/server-tests/resources/test-server.conf (221052 => 221053)


--- trunk/Websites/perf.webkit.org/server-tests/resources/test-server.conf	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/server-tests/resources/test-server.conf	2017-08-22 23:04:19 UTC (rev 221053)
@@ -16,8 +16,15 @@
 LoadModule dir_module libexec/apache2/mod_dir.so
 LoadModule alias_module libexec/apache2/mod_alias.so
 LoadModule rewrite_module libexec/apache2/mod_rewrite.so
-LoadModule php5_module libexec/apache2/libphp5.so
 
+<IfDefine PHP5>
+    LoadModule php5_module libexec/apache2/libphp5.so
+</IfDefine>
+
+<IfDefine PHP7>
+    LoadModule php7_module libexec/apache2/libphp7.so
+</IfDefine>
+
 <Directory />
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
@@ -57,4 +64,12 @@
     php_value post_max_size 5M
 </IfModule>
 
+<IfModule php7_module>
+    AddType application/x-httpd-php .php
+    AddType application/x-httpd-php-source .phps
+
+    php_value upload_max_filesize 5M
+    php_value post_max_size 5M
+</IfModule>
+
 Include /private/etc/apache2/extra/httpd-mpm.conf

Modified: trunk/Websites/perf.webkit.org/server-tests/resources/test-server.js (221052 => 221053)


--- trunk/Websites/perf.webkit.org/server-tests/resources/test-server.js	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/server-tests/resources/test-server.js	2017-08-22 23:04:19 UTC (rev 221053)
@@ -170,6 +170,7 @@
         let port = Config.value('testServer.port');
         let errorLog = Config.path('testServer.httpdErrorLog');
         let mutexFile = Config.path('testServer.httpdMutexDir');
+        let phpVersion = childProcess.execFileSync('php', ['-v'], {stdio: ['pipe', 'pipe', 'ignore']}).toString().includes('PHP 5') ? 'PHP5' : 'PHP7';
 
         if (!fs.existsSync(mutexFile))
             fs.mkdirSync(mutexFile, 0o755);
@@ -181,7 +182,8 @@
             '-c', `PidFile ${pidFile}`,
             '-c', `ErrorLog ${errorLog}`,
             '-c', `Mutex file:${mutexFile}`,
-            '-c', `DocumentRoot ${Config.serverRoot()}`];
+            '-c', `DocumentRoot ${Config.serverRoot()}`,
+            '-D', phpVersion];
 
         if (this._shouldLog)
             console.log(args);
@@ -192,7 +194,7 @@
             scheme: 'http',
             host: 'localhost',
             port: port,
-        }
+        };
         this._pidWaitStart = Date.now();
         this._pidFile = pidFile;
 

Modified: trunk/Websites/perf.webkit.org/tools/remote-cache-server.py (221052 => 221053)


--- trunk/Websites/perf.webkit.org/tools/remote-cache-server.py	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/tools/remote-cache-server.py	2017-08-22 23:04:19 UTC (rev 221053)
@@ -37,6 +37,8 @@
     httpd_pid_file = abspath_from_root(remote_server_config['httpdPID'])
     httpd_error_log_file = abspath_from_root(remote_server_config['httpdErrorLog'])
     httpd_mutex_dir = abspath_from_root(remote_server_config['httpdMutexDir'])
+    version_info = subprocess.check_output(['php', '-v'], stderr=subprocess.PIPE)
+    php_version = 'PHP5' if 'PHP 5' in version_info else 'PHP7'
 
     if not os.path.isdir(httpd_mutex_dir):
         os.makedirs(httpd_mutex_dir)
@@ -50,9 +52,9 @@
         '-c', 'PidFile ' + httpd_pid_file,
         '-c', 'Mutex file:' + httpd_mutex_dir,
         '-c', 'DocumentRoot ' + doc_root,
-        '-c', 'ErrorLog ' + httpd_error_log_file])
+        '-c', 'ErrorLog ' + httpd_error_log_file,
+        '-D', php_version])
 
-
 def stop_httpd(remote_server_config):
     httpd_pid_file = abspath_from_root(remote_server_config['httpdPID'])
     if not os.path.isfile(httpd_pid_file):

Modified: trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf (221052 => 221053)


--- trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf	2017-08-22 23:04:19 UTC (rev 221053)
@@ -16,8 +16,15 @@
 LoadModule dir_module libexec/apache2/mod_dir.so
 LoadModule alias_module libexec/apache2/mod_alias.so
 LoadModule rewrite_module libexec/apache2/mod_rewrite.so
-LoadModule php5_module libexec/apache2/libphp5.so
 
+<IfDefine PHP5>
+    LoadModule php5_module libexec/apache2/libphp5.so
+</IfDefine>
+
+<IfDefine PHP7>
+    LoadModule php7_module libexec/apache2/libphp7.so
+</IfDefine>
+
 <Directory />
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
@@ -58,4 +65,9 @@
 	AddType application/x-httpd-php-source .phps
 </IfModule>
 
+<IfModule php7_module>
+	AddType application/x-httpd-php .php
+	AddType application/x-httpd-php-source .phps
+</IfModule>
+
 Include /private/etc/apache2/extra/httpd-mpm.conf

Modified: trunk/Websites/perf.webkit.org/tools/sync-buildbot.js (221052 => 221053)


--- trunk/Websites/perf.webkit.org/tools/sync-buildbot.js	2017-08-22 22:43:08 UTC (rev 221052)
+++ trunk/Websites/perf.webkit.org/tools/sync-buildbot.js	2017-08-22 23:04:19 UTC (rev 221053)
@@ -32,7 +32,7 @@
 
     const makeTriggerable = function () {
         return new BuildbotTriggerable(buildbotConfig, global.RemoteAPI, buildbotRemote, serverConfig.slave, console)
-    }
+    };
 
     Manifest.fetch().then(() => {
         return makeTriggerable().updateTriggerable();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to