Browse Source

Revert "php/peachpie test updated and fixed (#5718)" (#5719)

This reverts commit 05554654849a260011d1d8e9fcdd20ea06d9c703.
Nate 5 years ago
parent
commit
c495247623

+ 24 - 26
frameworks/PHP/peachpie/Benchmarks.sln

@@ -1,10 +1,11 @@
+
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30114.105
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
 MinimumVisualStudioVersion = 15.0.26124.0
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Website", "Website\Website.msbuildproj", "{A271793F-72BF-429D-9EC8-83C03559CBD6}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "Website\Website.msbuildproj", "{A271793F-72BF-429D-9EC8-83C03559CBD6}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{AF5D53C1-32B5-473F-9229-817608068701}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{AF5D53C1-32B5-473F-9229-817608068701}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,36 +16,33 @@ Global
 		Release|x64 = Release|x64
 		Release|x86 = Release|x86
 	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x64.Build.0 = Debug|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x86.Build.0 = Debug|Any CPU
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x64.ActiveCfg = Debug|x64
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x64.Build.0 = Debug|x64
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x86.ActiveCfg = Debug|x86
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Debug|x86.Build.0 = Debug|x86
 		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|Any CPU.Build.0 = Release|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x64.ActiveCfg = Release|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x64.Build.0 = Release|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x86.ActiveCfg = Release|Any CPU
-		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x86.Build.0 = Release|Any CPU
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x64.ActiveCfg = Release|x64
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x64.Build.0 = Release|x64
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x86.ActiveCfg = Release|x86
+		{A271793F-72BF-429D-9EC8-83C03559CBD6}.Release|x86.Build.0 = Release|x86
 		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x64.Build.0 = Debug|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x86.Build.0 = Debug|Any CPU
+		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x64.ActiveCfg = Debug|x64
+		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x64.Build.0 = Debug|x64
+		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x86.ActiveCfg = Debug|x86
+		{AF5D53C1-32B5-473F-9229-817608068701}.Debug|x86.Build.0 = Debug|x86
 		{AF5D53C1-32B5-473F-9229-817608068701}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{AF5D53C1-32B5-473F-9229-817608068701}.Release|Any CPU.Build.0 = Release|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x64.ActiveCfg = Release|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x64.Build.0 = Release|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x86.ActiveCfg = Release|Any CPU
-		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x86.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {B594A287-1B0F-4DDC-A815-2CF24C23E9DC}
+		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x64.ActiveCfg = Release|x64
+		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x64.Build.0 = Release|x64
+		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x86.ActiveCfg = Release|x86
+		{AF5D53C1-32B5-473F-9229-817608068701}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 EndGlobal

+ 0 - 12
frameworks/PHP/peachpie/Server/Program.cs

@@ -2,8 +2,6 @@ using System;
 using System.Threading;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Http.Features;
 using Microsoft.Extensions.Hosting;
 
 namespace PeachpieBenchmarks.Server
@@ -29,16 +27,6 @@ namespace PeachpieBenchmarks.Server
     {
         public void Configure(IApplicationBuilder app)
         {
-            //// disable response buffering and chunked transfer
-            //app.Use((httpcontext, next) =>
-            //{
-            //    var responsefeature = httpcontext.Features.Get<IHttpResponseBodyFeature>();
-            //    responsefeature?.DisableBuffering();
-
-            //    //
-            //    return next();
-            //});
-
             // app.UseResponseBuffering();
             app.UsePhp(new PhpRequestOptions(scriptAssemblyName: "Website"));
             // app.UseDefaultFiles();

+ 1 - 1
frameworks/PHP/peachpie/Website/Website.msbuildproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <OutputType>Library</OutputType>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>netstandard2.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 0 - 24
frameworks/PHP/peachpie/Website/db.php

@@ -1,24 +0,0 @@
-<?php
-//
-// Database Test
-//
-
-function db() {
-  
-  // Set content type
-  header("Content-type: application/json");
-
-  // Database connection (TODO: When it works, use PDO instead)
-  $link = mysql_pconnect('tfb-database', 'benchmarkdbuser', 'benchmarkdbpass');
-  mysql_select_db('hello_world', $link);
-
-  $id = mt_rand(1, 10000);
-  $result = mysql_query("SELECT id,randomNumber FROM World WHERE id=$id", $link);
-
-  // Store result in array.
-  echo json_encode( mysql_fetch_assoc($result) );
-
-  mysql_close($link);
-}
-
-db();

+ 54 - 0
frameworks/PHP/peachpie/Website/dbraw.php

@@ -0,0 +1,54 @@
+<?php
+//
+// Database Test
+//
+
+function dbraw() {
+  // Database connection (TODO: When it works, use PDO instead)
+  $link = mysql_pconnect('tfb-database', 'benchmarkdbuser', 'benchmarkdbpass');
+  mysql_select_db('hello_world', $link);
+
+  // Read number of queries to run from URL parameter
+  $query_count = 1;
+  $is_multi = isset($_GET['queries']);
+  if ($is_multi) {
+    $query_count = (int)$_GET['queries'];
+    if ($query_count > 500) {
+      $query_count = 500;
+    } else if ($query_count < 1) {
+      $query_count = 1;
+    }
+  }
+
+  // Create an array with the response string.
+  $arr = array();
+  $id = mt_rand(1, 10000);
+
+  // For each query, store the result set values in the response array
+  while ($query_count--) {
+    $result = mysql_query("SELECT id, randomNumber FROM World WHERE id = $id", $link);
+
+    // Store result in array.
+    $arr[] = array('id' => $id, 'randomNumber' => mysql_result($result, 0));
+    $id = mt_rand(1, 10000);
+  }
+
+  mysql_close($link);
+
+  // Set content type
+  header("Content-type: application/json");
+
+  // Use the PHP standard JSON encoder.
+  // http://www.php.net/manual/en/function.json-encode.php
+  if ($is_multi) {
+    $output = json_encode($arr);
+  } else {
+    $output = json_encode($arr[0]);
+  }
+  // Set content length
+  header("Content-Length: {strlen($output)}");
+
+  echo $output;
+}
+
+dbraw();

+ 0 - 37
frameworks/PHP/peachpie/Website/query.php

@@ -1,37 +0,0 @@
-<?php
-//
-// Database Test
-//
-
-function query() {
-  
-  // Set content type
-  header("Content-type: application/json");
-  
-  // Database connection (TODO: When it works, use PDO instead)
-  $link = mysql_pconnect('tfb-database', 'benchmarkdbuser', 'benchmarkdbpass');
-  mysql_select_db('hello_world', $link);
-
-  // Read number of queries to run from URL parameter
-  $query_count = max(1, min(500, (int)$_GET['queries']));
-
-  // Create an array with the response string.
-  $arr = [];
-  
-  // For each query, store the result set values in the response array
-  while ($query_count--) {
-    $id = mt_rand(1, 10000);
-    $result = mysql_query("SELECT id,randomNumber FROM World WHERE id=$id", $link);
-
-    // Store result in array.
-    $arr[] = mysql_fetch_assoc($result);
-  }
-
-  mysql_close($link);
-
-  // Use the PHP standard JSON encoder.
-  // http://www.php.net/manual/en/function.json-encode.php
-  echo json_encode($arr);
-}
-
-query();

+ 3 - 3
frameworks/PHP/peachpie/benchmark_config.json

@@ -4,8 +4,8 @@
     "default": {
       "json_url": "/json.php",
       "plaintext_url": "/plaintext.php",
-      "db_url": "/db.php",
-      "query_url": "/query.php?queries=",
+      "db_url": "/dbraw.php",
+      "query_url": "/dbraw.php?queries=",
       "fortune_url": "/fortune.php",
       "update_url": "/updateraw.php?queries=",
       "port": 8080,
@@ -23,7 +23,7 @@
       "display_name": "peachpie",
       "notes": "",
       "versus": "php",
-      "tags": []
+      "tags": ["broken"]
     }
   }]
 }

+ 1 - 1
frameworks/PHP/peachpie/global.json

@@ -1,5 +1,5 @@
 {
     "msbuild-sdks": {
-        "Peachpie.NET.Sdk": "0.9.981"
+        "Peachpie.NET.Sdk": "0.9.910"
     }
 }