@@ -1344,15 +1344,12 @@ SPL_METHOD(SplFileInfo, setFileClass)
1344
1344
{
1345
1345
spl_filesystem_object * intern = Z_SPLFILESYSTEM_P (ZEND_THIS );
1346
1346
zend_class_entry * ce = spl_ce_SplFileObject ;
1347
- zend_error_handling error_handling ;
1348
-
1349
- zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
1350
1347
1351
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == SUCCESS ) {
1352
- intern -> file_class = ce ;
1348
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == FAILURE ) {
1349
+ return ;
1353
1350
}
1354
1351
1355
- zend_restore_error_handling ( & error_handling ) ;
1352
+ intern -> file_class = ce ;
1356
1353
}
1357
1354
/* }}} */
1358
1355
@@ -1362,15 +1359,12 @@ SPL_METHOD(SplFileInfo, setInfoClass)
1362
1359
{
1363
1360
spl_filesystem_object * intern = Z_SPLFILESYSTEM_P (ZEND_THIS );
1364
1361
zend_class_entry * ce = spl_ce_SplFileInfo ;
1365
- zend_error_handling error_handling ;
1366
1362
1367
- zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
1368
-
1369
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == SUCCESS ) {
1370
- intern -> info_class = ce ;
1363
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == FAILURE ) {
1364
+ return ;
1371
1365
}
1372
1366
1373
- zend_restore_error_handling ( & error_handling ) ;
1367
+ intern -> info_class = ce ;
1374
1368
}
1375
1369
/* }}} */
1376
1370
@@ -1380,15 +1374,12 @@ SPL_METHOD(SplFileInfo, getFileInfo)
1380
1374
{
1381
1375
spl_filesystem_object * intern = Z_SPLFILESYSTEM_P (ZEND_THIS );
1382
1376
zend_class_entry * ce = intern -> info_class ;
1383
- zend_error_handling error_handling ;
1384
-
1385
- zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
1386
1377
1387
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == SUCCESS ) {
1388
- spl_filesystem_object_create_type ( ZEND_NUM_ARGS (), intern , SPL_FS_INFO , ce , return_value ) ;
1378
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == FAILURE ) {
1379
+ return ;
1389
1380
}
1390
1381
1391
- zend_restore_error_handling ( & error_handling );
1382
+ spl_filesystem_object_create_type ( ZEND_NUM_ARGS (), intern , SPL_FS_INFO , ce , return_value );
1392
1383
}
1393
1384
/* }}} */
1394
1385
@@ -1398,22 +1389,20 @@ SPL_METHOD(SplFileInfo, getPathInfo)
1398
1389
{
1399
1390
spl_filesystem_object * intern = Z_SPLFILESYSTEM_P (ZEND_THIS );
1400
1391
zend_class_entry * ce = intern -> info_class ;
1401
- zend_error_handling error_handling ;
1402
-
1403
- zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
1392
+ size_t path_len ;
1393
+ char * path ;
1404
1394
1405
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == SUCCESS ) {
1406
- size_t path_len ;
1407
- char * path = spl_filesystem_object_get_pathname (intern , & path_len );
1408
- if (path ) {
1409
- char * dpath = estrndup (path , path_len );
1410
- path_len = php_dirname (dpath , path_len );
1411
- spl_filesystem_object_create_info (intern , dpath , path_len , 1 , ce , return_value );
1412
- efree (dpath );
1413
- }
1395
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "|C" , & ce ) == FAILURE ) {
1396
+ return ;
1414
1397
}
1415
1398
1416
- zend_restore_error_handling (& error_handling );
1399
+ path = spl_filesystem_object_get_pathname (intern , & path_len );
1400
+ if (path ) {
1401
+ char * dpath = estrndup (path , path_len );
1402
+ path_len = php_dirname (dpath , path_len );
1403
+ spl_filesystem_object_create_info (intern , dpath , path_len , 1 , ce , return_value );
1404
+ efree (dpath );
1405
+ }
1417
1406
}
1418
1407
/* }}} */
1419
1408
0 commit comments