Skip to content

Commit 0e616e9

Browse files
committed
Remove php_error_docref1 and convert usage to standard docref
1 parent 175c7bf commit 0e616e9

File tree

96 files changed

+242
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+242
-253
lines changed

Zend/tests/bug30998.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
1515
?>
1616
===DONE===
1717
--EXPECTF--
18-
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
18+
fopen(): failed to open stream (/tmp/blah): %s (2) in %s:%d
1919

20-
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
20+
Warning: fopen(): failed to open stream (/tmp/blah): %s in %s on line %d
2121
===DONE===

Zend/tests/bug60909_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
1010

1111
require 'notfound.php';
1212
--EXPECTF--
13-
error(require(notfound.php): failed to open stream: %s)
13+
error(require(): failed to open stream (notfound.php): %s)
1414
Warning: Uncaught Exception: Foo in %sbug60909_1.php:5
1515
Stack trace:
1616
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)

Zend/tests/debug_backtrace_with_include_and_this.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ try {
2828
echo $e."\n";
2929
}
3030
--EXPECTF--
31-
ERR#2: include(class://non.existent.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
31+
ERR#2: include(): failed to open stream (class://non.existent.Class): "CLWrapper::stream_open" call failed @ include
3232
ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
3333

3434
Fatal error: Uncaught Exception: Failed loading class://non.existent.Class in %s

ext/dba/dba_flatfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DBA_UPDATE_FUNC(flatfile)
9191
case 1:
9292
return FAILURE;
9393
case -1:
94-
php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
94+
php_error_docref(NULL, E_WARNING, "Operation impossible with key %s", key);
9595
return FAILURE;
9696
default:
9797
php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value");

ext/dba/dba_inifile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ DBA_UPDATE_FUNC(inifile)
9393
INIFILE_DONE;
9494
switch(res) {
9595
case -1:
96-
php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
96+
php_error_docref(NULL, E_WARNING, "Operation impossible with key %s", key);
9797
return FAILURE;
9898
default:
9999
case 0:

ext/dba/dba_lmdb.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ DBA_FETCH_FUNC(lmdb)
112112
rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn));
113113
}
114114
if (rc) {
115-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
115+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
116116
return NULL;
117117
}
118118

@@ -122,7 +122,7 @@ DBA_FETCH_FUNC(lmdb)
122122
rc = mdb_get(LMDB_IT(txn), LMDB_IT(dbi), &k, &v);
123123
if (rc) {
124124
if (MDB_NOTFOUND != rc) {
125-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
125+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
126126
}
127127
mdb_txn_abort(LMDB_IT(txn));
128128
return NULL;
@@ -188,7 +188,7 @@ DBA_EXISTS_FUNC(lmdb)
188188
rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn));
189189
}
190190
if (rc) {
191-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
191+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
192192
return FAILURE;
193193
}
194194

@@ -198,7 +198,7 @@ DBA_EXISTS_FUNC(lmdb)
198198
rc = mdb_get(LMDB_IT(txn), LMDB_IT(dbi), &k, &v);
199199
if (rc) {
200200
if (MDB_NOTFOUND != rc) {
201-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
201+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
202202
}
203203
mdb_txn_abort(LMDB_IT(txn));
204204
return FAILURE;
@@ -220,7 +220,7 @@ DBA_DELETE_FUNC(lmdb)
220220

221221
rc = mdb_txn_begin(LMDB_IT(env), NULL, 0, &LMDB_IT(txn));
222222
if (rc) {
223-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
223+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
224224
return FAILURE;
225225
}
226226

@@ -231,14 +231,14 @@ DBA_DELETE_FUNC(lmdb)
231231
if (!rc) {
232232
rc = mdb_txn_commit(LMDB_IT(txn));
233233
if (rc) {
234-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
234+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
235235
mdb_txn_abort(LMDB_IT(txn));
236236
return FAILURE;
237237
}
238238
return SUCCESS;
239239
}
240240

241-
php_error_docref1(NULL, key, E_WARNING, "%s", mdb_strerror(rc));
241+
php_error_docref(NULL, E_WARNING, "Error %s on key %s", mdb_strerror(rc), key);
242242

243243
return FAILURE;
244244
}

ext/exif/exif.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
+----------------------------------------------------------------------+
1515
| Authors: Rasmus Lerdorf <rasmus@php.net> |
1616
| Marcus Boerger <helly@php.net> |
17+
| Marcus Boerger <helly@php.net> |
1718
+----------------------------------------------------------------------+
1819
*/
1920

@@ -4559,7 +4560,8 @@ PHP_FUNCTION(exif_read_data)
45594560
exif_discard_imageinfo(&ImageInfo);
45604561

45614562
#ifdef EXIF_DEBUG
4562-
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
4563+
php_error_docref(NULL, E_NOTICE, "Done for %s",
4564+
(Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)));
45634565
#endif
45644566
}
45654567
/* }}} */
@@ -4642,7 +4644,9 @@ PHP_FUNCTION(exif_thumbnail)
46424644
exif_discard_imageinfo(&ImageInfo);
46434645

46444646
#ifdef EXIF_DEBUG
4645-
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
4647+
4648+
php_error_docref(NULL, E_NOTICE, "Done for %s",
4649+
(Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)));
46464650
#endif
46474651
}
46484652
/* }}} */

ext/exif/tests/exif_imagetype_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ NULL
4040

4141
-- Testing exif_imagetype() function with an unknown file --
4242

43-
Warning: exif_imagetype(%s/foo.jpg): failed to open stream: No such file or directory in %s on line %d
43+
Warning: exif_imagetype(): failed to open stream (%s/foo.jpg): No such file or directory in %s on line %d
4444
bool(false)
4545
===Done===

ext/hash/tests/hash_file_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool(false)
5050

5151
-- Testing hash_file() function with a non-existent file --
5252

53-
Warning: hash_file(%s): failed to open stream: No such file or directory in %s on line %d
53+
Warning: hash_file(): failed to open stream (%s): No such file or directory in %s on line %d
5454
bool(false)
5555

5656
-- Testing hash_file() function with less than expected no. of arguments --

ext/standard/tests/dir/dir_variation5.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ echo "Done";
3030
--EXPECTF--
3131
*** Testing dir() : open a file instead of a directory ***
3232

33-
Warning: dir(%s): failed to open dir: %s in %s on line %d
33+
Warning: dir(): failed to open dir (%s): %s in %s on line %d
3434
bool(false)
3535
Done

ext/standard/tests/dir/dir_variation6.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ echo "Done";
4848
*** Testing dir() : open a non-existent directory ***
4949
-- opening previously removed directory --
5050

51-
Warning: dir(%s): failed to open dir: %s in %s on line %d
51+
Warning: dir(): failed to open dir (%s): %s in %s on line %d
5252
bool(false)
5353
-- opening non-existent directory --
5454

55-
Warning: dir(%s): failed to open dir: %s in %s on line %d
55+
Warning: dir(): failed to open dir (%s): %s in %s on line %d
5656
bool(false)
5757
Done

ext/standard/tests/dir/dir_variation7.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ rmdir($parent_dir_path);
8585
*** Testing dir() : remove execute permission from the parent dir ***
8686
-- After restricting 1st level parent directory --
8787

88-
Warning: dir(%s/dir_variation7/sub_dir/child_dir): failed to open dir: %s in %s on line %d
88+
Warning: dir(): failed to open dir (%s/dir_variation7/sub_dir/child_dir): %s in %s on line %d
8989
bool(false)
9090
-- After restricting parent directory --
9191

92-
Warning: dir(%s/dir_variation7/sub_dir/child_dir): failed to open dir: %s in %s on line %d
92+
Warning: dir(): failed to open dir (%s/dir_variation7/sub_dir/child_dir): %s in %s on line %d
9393
bool(false)
9494
Done

ext/standard/tests/dir/dir_variation8.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ echo "Done";
4545
*** Testing dir() : checking with wildcard characters ***
4646
-- wildcard = '*' --
4747

48-
Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
48+
Warning: dir(): failed to open dir (%s/dir_var*): %s in %s on line %d
4949
bool(false)
5050

51-
Warning: dir(%s/*): failed to open dir: %s in %s on line %d
51+
Warning: dir(): failed to open dir (%s/*): %s in %s on line %d
5252
bool(false)
5353
-- wildcard = '?' --
5454

55-
Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
55+
Warning: dir(): failed to open dir (%s/dir_variation81/sub_dir?): %s in %s on line %d
5656
bool(false)
5757

58-
Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
58+
Warning: dir(): failed to open dir (%s/dir_variation81/sub?dir1): %s in %s on line %d
5959
bool(false)
6060
Done

ext/standard/tests/dir/dir_variation9.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ object(Directory)#%d (2) {
103103

104104
-- With invalid paths --
105105

106-
Warning: dir(%s/dir_variation91/sub_dir12/sub_dir111/..): failed to open dir: %s in %s on line %d
106+
Warning: dir(): failed to open dir (%s/dir_variation91/sub_dir12/sub_dir111/..): %s in %s on line %d
107107
bool(false)
108108

109-
Warning: dir(%s/dir_variation92/sub_dir21/../dir_variation91): failed to open dir: %s in %s on line %d
109+
Warning: dir(): failed to open dir (%s/dir_variation92/sub_dir21/../dir_variation91): %s in %s on line %d
110110
bool(false)
111111

112-
Warning: dir(%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): failed to open dir: %s in %s on line %d
112+
Warning: dir(): failed to open dir (%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): %s in %s on line %d
113113
bool(false)
114114

115-
Warning: dir(%s/dir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): failed to open dir: %s in %s on line %d
115+
Warning: dir(): failed to open dir (%s/dir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): %s in %s on line %d
116116
bool(false)
117117
Done

ext/standard/tests/dir/opendir_error2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ var_dump(opendir('idonotexist'));
3333

3434
-- Pass a non-existent absolute path: --
3535

36-
Warning: opendir(%s/idonotexist): failed to open dir: %s in %s on line %d
36+
Warning: opendir(): failed to open dir (%s/idonotexist): %s in %s on line %d
3737
bool(false)
3838

3939
-- Pass a non-existent relative path: --
4040

41-
Warning: opendir(idonotexist): failed to open dir: %s in %s on line %d
41+
Warning: opendir(): failed to open dir (idonotexist): %s in %s on line %d
4242
bool(false)
4343
===DONE===

ext/standard/tests/dir/opendir_variation5.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ rmdir($parent_dir_path);
9292

9393
-- After restricting 1st level parent directory --
9494

95-
Warning: opendir(%s/opendir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d
95+
Warning: opendir(): failed to open dir (%s/opendir_variation5/sub_dir/child_dir): %s in %s on line %d
9696
bool(false)
9797

9898
-- After restricting parent directory --
9999

100-
Warning: opendir(%s/opendir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d
100+
Warning: opendir(): failed to open dir (%s/opendir_variation5/sub_dir/child_dir): %s in %s on line %d
101101
bool(false)
102102
===DONE===

ext/standard/tests/dir/opendir_variation6.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ rmdir($dir_path);
5151

5252
-- Wildcard = '*' --
5353

54-
Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d
54+
Warning: opendir(): failed to open dir (%s/opendir_var*): %s in %s on line %d
5555
bool(false)
5656

57-
Warning: opendir(%s/*): failed to open dir: %s in %s on line %d
57+
Warning: opendir(): failed to open dir (%s/*): %s in %s on line %d
5858
bool(false)
5959

6060
-- Wildcard = '?' --
6161

62-
Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d
62+
Warning: opendir(): failed to open dir (%s/opendir_variation6/sub_dir?): %s in %s on line %d
6363
bool(false)
6464

65-
Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d
65+
Warning: opendir(): failed to open dir (%s/opendir_variation6/sub?dir1): %s in %s on line %d
6666
bool(false)
6767
===DONE===

ext/standard/tests/dir/scandir_error2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ var_dump(scandir('/idonotexist'));
3333

3434
-- Pass scandir() an absolute path that does not exist --
3535

36-
Warning: scandir(%s/idonotexist): failed to open dir: %s in %s on line %d
36+
Warning: scandir(): failed to open dir (%s/idonotexist): %s in %s on line %d
3737

3838
Warning: scandir(): (errno %d): %s in %s on line %d
3939
bool(false)
4040

4141
-- Pass scandir() a relative path that does not exist --
4242

43-
Warning: scandir(/idonotexist): failed to open dir: %s in %s on line %d
43+
Warning: scandir(): failed to open dir (/idonotexist): %s in %s on line %d
4444

4545
Warning: scandir(): (errno %d): %s in %s on line %d
4646
bool(false)

ext/standard/tests/dir/scandir_variation5.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ rmdir($parent_dir_path);
8484

8585
-- After restricting 1st level parent directory --
8686

87-
Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d
87+
Warning: scandir(): failed to open dir (%s/scandir_variation5/sub_dir/child_dir): %s in %s on line %d
8888

8989
Warning: scandir(): (errno %d): %s in %s on line %d
9090
bool(false)
9191

9292
-- After restricting parent directory --
9393

94-
Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d
94+
Warning: scandir(): failed to open dir (%s/scandir_variation5/sub_dir/child_dir): %s in %s on line %d
9595

9696
Warning: scandir(): (errno %d): %s in %s on line %d
9797
bool(false)

ext/standard/tests/dir/scandir_variation6.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,24 @@ rmdir($dir_path);
5252

5353
-- Wildcard = '*' --
5454

55-
Warning: scandir(%s/scandir_var*): failed to open dir: %s in %s on line %d
55+
Warning: scandir(): failed to open dir (%s/scandir_var*): %s in %s on line %d
5656

5757
Warning: scandir(): (errno %d): %s in %s on line %d
5858
bool(false)
5959

60-
Warning: scandir(%s/*): failed to open dir: %s in %s on line %d
60+
Warning: scandir(): failed to open dir (%s/*): %s in %s on line %d
6161

6262
Warning: scandir(): (errno %d): %s in %s on line %d
6363
bool(false)
6464

6565
-- Wildcard = '?' --
6666

67-
Warning: scandir(%s/scandir_variation6/sub_dir?): failed to open dir: %s in %s on line %d
67+
Warning: scandir(): failed to open dir (%s/scandir_variation6/sub_dir?): %s in %s on line %d
6868

6969
Warning: scandir(): (errno %d): %s in %s on line %d
7070
bool(false)
7171

72-
Warning: scandir(%s/scandir_variation6/sub?dir1): failed to open dir: %s in %s on line %d
72+
Warning: scandir(): failed to open dir (%s/scandir_variation6/sub?dir1): %s in %s on line %d
7373

7474
Warning: scandir(): (errno %d): %s in %s on line %d
7575
bool(false)

ext/standard/tests/file/007_error.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool(false)
105105
-- Testing fopen(), fclose() & feof() with invalid arguments --
106106
-- Iteration 1 --
107107

108-
Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d
108+
Warning: fopen(): failed to open stream (string): No such file or directory in %s on line %d
109109
bool(false)
110110

111111
Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d
@@ -115,7 +115,7 @@ Warning: feof() expects parameter 1 to be resource, string given in %s on line %
115115
bool(false)
116116
-- Iteration 2 --
117117

118-
Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d
118+
Warning: fopen(): failed to open stream (10): No such file or directory in %s on line %d
119119
bool(false)
120120

121121
Warning: fclose() expects parameter 1 to be resource, int given in %s on line %d
@@ -125,7 +125,7 @@ Warning: feof() expects parameter 1 to be resource, int given in %s on line %d
125125
bool(false)
126126
-- Iteration 3 --
127127

128-
Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d
128+
Warning: fopen(): failed to open stream (10.5): No such file or directory in %s on line %d
129129
bool(false)
130130

131131
Warning: fclose() expects parameter 1 to be resource, float given in %s on line %d
@@ -135,7 +135,7 @@ Warning: feof() expects parameter 1 to be resource, float given in %s on line %d
135135
bool(false)
136136
-- Iteration 4 --
137137

138-
Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d
138+
Warning: fopen(): failed to open stream (1): No such file or directory in %s on line %d
139139
bool(false)
140140

141141
Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d

ext/standard/tests/file/007_variation15.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ int(0)
5454
bool(true)
5555
string(7) "Unknown"
5656

57-
Warning: fopen(%s): failed to open stream: File exists in %s on line %d
57+
Warning: fopen(): failed to open stream (%s): File exists in %s on line %d
5858
*** Done ***

ext/standard/tests/file/007_variation16.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ int(37)
5656
bool(true)
5757
string(7) "Unknown"
5858

59-
Warning: fopen(%s): failed to open stream: File exists in %s on line %d
59+
Warning: fopen(): failed to open stream (%s): File exists in %s on line %d
6060
*** Done ***

ext/standard/tests/file/007_variation23.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ int(0)
5454
bool(true)
5555
string(7) "Unknown"
5656

57-
Warning: fopen(%s): failed to open stream: File exists in %s on line %d
57+
Warning: fopen(): failed to open stream (%s): File exists in %s on line %d
5858
*** Done ***

0 commit comments

Comments
 (0)