1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00

Reverted changes in connect.inc based on Ulf's feedback

- Moved the ini_set() entries into a separate script 'setupdefault.inc'
- Let mysql_affected_rows and mysql_insert_id test cases use the newly created script

With the ini_set() statements inside connect.inc, some test cases would be forced to 'undo' them in order to test other scenarios.

Tested on all three dev lines with and without passing db credentials. No changes detected.
This commit is contained in:
Tjerk Anne Meesters
2011-09-12 14:35:45 +00:00
parent 019e96a7f6
commit e29302576c
4 changed files with 12 additions and 5 deletions

View File

@@ -65,11 +65,6 @@ $port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
// added so that mysql_connect() without args works as well (required in some tests that rely on a default connection being opened implicitly)
ini_set('mysql.default_host', $host);
ini_set('mysql.default_user', $user);
ini_set('mysql.default_password', $passwd);
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;

View File

@@ -8,6 +8,7 @@ require_once('skipifconnectfailure.inc');
--FILE--
<?php
include_once("connect.inc");
include_once('setupdefault.inc');
$tmp = NULL;
$link = NULL;

View File

@@ -8,6 +8,7 @@ require_once('skipifconnectfailure.inc');
--FILE--
<?php
include "connect.inc";
include 'setupdefault.inc';
$tmp = NULL;
$link = NULL;

View File

@@ -0,0 +1,10 @@
<?php
// copy variables from connect.inc into mysql default connection ini settings, so that implicit mysql_connect() behaviour can be tested where needed
// must be loaded AFTER connect.inc
ini_set('mysql.default_host', $host);
ini_set('mysql.default_user', $user);
ini_set('mysql.default_password', $passwd);
?>