Skip to content

Commit

Permalink
Merge branch 'PHP-7.4'
Browse files Browse the repository at this point in the history
* PHP-7.4:
  Make bug52820.phpt more robust
  Explicitly start mysql
  Use "set -e" in some pipeline steps
  • Loading branch information
nikic committed Mar 18, 2020
2 parents 70ef2f3 + ba6834f commit e957a8c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions azure/i386/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- script: make -j$(/usr/bin/nproc) >/dev/null
displayName: 'Make Build'
- script: |
set -e
sudo make install
sudo mkdir /etc/php.d
sudo chmod 777 /etc/php.d
Expand All @@ -79,6 +80,8 @@ jobs:
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
displayName: 'Install Build'
- script: |
set -e
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo -u postgres psql -c "CREATE DATABASE test;"
Expand Down
1 change: 1 addition & 0 deletions azure/install.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
steps:
- script: |
set -e
sudo make install
sudo mkdir /etc/php.d
sudo chmod 777 /etc/php.d
Expand Down
2 changes: 2 additions & 0 deletions azure/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
displayName: 'Make Build'
- template: install.yml
- script: |
set -e
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo -u postgres psql -c "CREATE DATABASE test;"
Expand Down
1 change: 1 addition & 0 deletions azure/msan_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
displayName: 'Install Build'
- script: |
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
displayName: 'Setup'
- template: test.yml
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/tests/file/bug52820.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ if (!function_exists('zend_leak_variable'))
/* unfortunately no standard function does a cast to FILE*, so we need
* curl to test this */
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
$handle=curl_init('http://127.0.0.1:37349/');
$handle=curl_init('file:///i_dont_exist/');
curl_setopt($handle, CURLOPT_VERBOSE, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
if (!@curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
die("skip fopencookie not supported on this platform");
--FILE--
<?php
function do_stuff($url) {
$handle=curl_init('http://127.0.0.1:37349/');
$handle=curl_init('file:///i_dont_exist/');
curl_setopt($handle, CURLOPT_VERBOSE, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
Expand All @@ -42,22 +42,22 @@ echo "\nDone.\n";
--EXPECTF--
temp stream (close after):
About to rewind!
* %ATrying 127.0.0.1...%AConnection refused%A
* Couldn't open file /i_dont_exist/
* Closing connection%A%d
memory stream (close after):
About to rewind!
* %ATrying 127.0.0.1...%AConnection refused%A
* Couldn't open file /i_dont_exist/
* Closing connection%A%d

temp stream (leak):
About to rewind!
* %ATrying 127.0.0.1...%AConnection refused%A
* Couldn't open file /i_dont_exist/
* Closing connection%A%d
memory stream (leak):
About to rewind!
* %ATrying 127.0.0.1...%AConnection refused%A
* Couldn't open file /i_dont_exist/
* Closing connection%A%d

Done.

0 comments on commit e957a8c

Please sign in to comment.