Skip to content

Commit c56dfe3

Browse files
committed
Patch pgo01org training initialization
Cf. <intel/php_pgo_training_scripts#5>.
1 parent 33bbf07 commit c56dfe3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pgo/cases/pgo01org/TrainingCaseHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ protected function setupDist() : void
103103
$standard_calls = preg_replace(",parse_str\(\\\$var1\),", "parse_str(\$var1, \$dummy)", $standard_calls);
104104
file_put_contents($fl, $standard_calls);
105105

106+
// patch <https://github.com/intel/php_pgo_training_scripts/pull/5>
107+
$fl = $htdocs . DIRECTORY_SEPARATOR . "init.php";
108+
$standard_calls = file_get_contents($fl);
109+
$standard_calls = preg_replace(",^initDB\(\);$,m", "mysqli_report(MYSQLI_REPORT_OFF);\n$0", $standard_calls);
110+
file_put_contents($fl, $standard_calls);
111+
106112
//$php->exec($cmd, NULL, $env);
107113
/* TODO check status or switch to cli. */
108114
$out = file_get_contents("http://$http_host:$http_port/init.php");

0 commit comments

Comments
 (0)