@@ -949,8 +949,8 @@ vips_php_call_array(const char *operation_name, zval *instance,
949
949
}
950
950
else if (call -> argc != call -> args_required ) {
951
951
php_error_docref (NULL , E_WARNING ,
952
- "operation expects %d arguments, but you supplied %d" ,
953
- call -> args_required , call -> argc );
952
+ "operation %s expects %d arguments, but you supplied %d" ,
953
+ call -> operation_name , call -> args_required , call -> argc );
954
954
vips_object_unref_outputs (VIPS_OBJECT (call -> operation ));
955
955
vips_php_call_free (call );
956
956
return -1 ;
@@ -1423,6 +1423,19 @@ PHP_FUNCTION(vips_image_set)
1423
1423
}
1424
1424
/* }}} */
1425
1425
1426
+ /* {{{ proto string vips_error_buffer()
1427
+ Fetch and clear the vips error buffer */
1428
+ PHP_FUNCTION (vips_error_buffer )
1429
+ {
1430
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "" ) == FAILURE ) {
1431
+ return ;
1432
+ }
1433
+
1434
+ RETVAL_STRING (strdup (vips_error_buffer ()));
1435
+ vips_error_clear ();
1436
+ }
1437
+ /* }}} */
1438
+
1426
1439
/* {{{ php_vips_init_globals
1427
1440
*/
1428
1441
/* Uncomment this function if you have INI entries
@@ -1565,6 +1578,9 @@ ZEND_BEGIN_ARG_INFO(arginfo_vips_image_set, 0)
1565
1578
ZEND_ARG_INFO (0 , value )
1566
1579
ZEND_END_ARG_INFO ()
1567
1580
1581
+ ZEND_BEGIN_ARG_INFO (arginfo_vips_error_buffer , 0 )
1582
+ ZEND_END_ARG_INFO ()
1583
+
1568
1584
/* {{{ vips_functions[]
1569
1585
*
1570
1586
* Every user visible function must have an entry in vips_functions[].
@@ -1579,6 +1595,7 @@ const zend_function_entry vips_functions[] = {
1579
1595
PHP_FE (vips_image_get , arginfo_vips_image_get )
1580
1596
PHP_FE (vips_image_get_typeof , arginfo_vips_image_get_typeof )
1581
1597
PHP_FE (vips_image_set , arginfo_vips_image_set )
1598
+ PHP_FE (vips_error_buffer , arginfo_vips_error_buffer )
1582
1599
1583
1600
PHP_FE_END /* Must be the last line in vips_functions[] */
1584
1601
};
0 commit comments