@@ -566,19 +566,24 @@ PHP_FUNCTION(ftp_systype)
566
566
/* {{{ Retrieves a file from the FTP server and writes it to an open file */
567
567
PHP_FUNCTION (ftp_fget )
568
568
{
569
- zval * z_ftp , * z_file ;
569
+ zval * z_ftp ;
570
570
ftpbuf_t * ftp ;
571
571
ftptype_t xtype ;
572
572
php_stream * stream ;
573
573
char * file ;
574
574
size_t file_len ;
575
575
zend_long mode = FTPTYPE_IMAGE , resumepos = 0 ;
576
576
577
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Ors|ll" , & z_ftp , php_ftp_ce , & z_file , & file , & file_len , & mode , & resumepos ) == FAILURE ) {
578
- RETURN_THROWS ();
579
- }
577
+ ZEND_PARSE_PARAMETERS_START (3 , 5 )
578
+ Z_PARAM_OBJECT_OF_CLASS (z_ftp , php_ftp_ce )
579
+ PHP_Z_PARAM_STREAM (stream )
580
+ Z_PARAM_STRING (file , file_len )
581
+ Z_PARAM_OPTIONAL
582
+ Z_PARAM_LONG (mode )
583
+ Z_PARAM_LONG (resumepos )
584
+ ZEND_PARSE_PARAMETERS_END ();
585
+
580
586
GET_FTPBUF (ftp , z_ftp );
581
- php_stream_from_res (stream , Z_RES_P (z_file ));
582
587
XTYPE (xtype , mode ) ;
583
588
584
589
/* ignore autoresume if autoseek is switched off */
@@ -610,19 +615,24 @@ PHP_FUNCTION(ftp_fget)
610
615
/* {{{ Retrieves a file from the FTP server asynchronly and writes it to an open file */
611
616
PHP_FUNCTION (ftp_nb_fget )
612
617
{
613
- zval * z_ftp , * z_file ;
618
+ zval * z_ftp ;
614
619
ftpbuf_t * ftp ;
615
620
ftptype_t xtype ;
616
621
php_stream * stream ;
617
622
char * file ;
618
623
size_t file_len ;
619
624
zend_long mode = FTPTYPE_IMAGE , resumepos = 0 , ret ;
620
625
621
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Ors|ll" , & z_ftp , php_ftp_ce , & z_file , & file , & file_len , & mode , & resumepos ) == FAILURE ) {
622
- RETURN_THROWS ();
623
- }
626
+ ZEND_PARSE_PARAMETERS_START (3 , 5 )
627
+ Z_PARAM_OBJECT_OF_CLASS (z_ftp , php_ftp_ce )
628
+ PHP_Z_PARAM_STREAM (stream )
629
+ Z_PARAM_STRING (file , file_len )
630
+ Z_PARAM_OPTIONAL
631
+ Z_PARAM_LONG (mode )
632
+ Z_PARAM_LONG (resumepos )
633
+ ZEND_PARSE_PARAMETERS_END ();
634
+
624
635
GET_FTPBUF (ftp , z_ftp );
625
- php_stream_from_res (stream , Z_RES_P (z_file ));
626
636
XTYPE (xtype , mode ) ;
627
637
628
638
/* ignore autoresume if autoseek is switched off */
@@ -848,19 +858,24 @@ PHP_FUNCTION(ftp_nb_continue)
848
858
/* {{{ Stores a file from an open file to the FTP server */
849
859
PHP_FUNCTION (ftp_fput )
850
860
{
851
- zval * z_ftp , * z_file ;
861
+ zval * z_ftp ;
852
862
ftpbuf_t * ftp ;
853
863
ftptype_t xtype ;
854
864
size_t remote_len ;
855
865
zend_long mode = FTPTYPE_IMAGE , startpos = 0 ;
856
866
php_stream * stream ;
857
867
char * remote ;
858
868
859
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Osr|ll" , & z_ftp , php_ftp_ce , & remote , & remote_len , & z_file , & mode , & startpos ) == FAILURE ) {
860
- RETURN_THROWS ();
861
- }
869
+ ZEND_PARSE_PARAMETERS_START (3 , 5 )
870
+ Z_PARAM_OBJECT_OF_CLASS (z_ftp , php_ftp_ce )
871
+ Z_PARAM_STRING (remote , remote_len )
872
+ PHP_Z_PARAM_STREAM (stream )
873
+ Z_PARAM_OPTIONAL
874
+ Z_PARAM_LONG (mode )
875
+ Z_PARAM_LONG (startpos )
876
+ ZEND_PARSE_PARAMETERS_END ();
877
+
862
878
GET_FTPBUF (ftp , z_ftp );
863
- php_stream_from_zval (stream , z_file );
864
879
XTYPE (xtype , mode );
865
880
866
881
/* ignore autoresume if autoseek is switched off */
@@ -895,7 +910,7 @@ PHP_FUNCTION(ftp_fput)
895
910
/* {{{ Stores a file from an open file to the FTP server nbronly */
896
911
PHP_FUNCTION (ftp_nb_fput )
897
912
{
898
- zval * z_ftp , * z_file ;
913
+ zval * z_ftp ;
899
914
ftpbuf_t * ftp ;
900
915
ftptype_t xtype ;
901
916
size_t remote_len ;
@@ -904,11 +919,16 @@ PHP_FUNCTION(ftp_nb_fput)
904
919
php_stream * stream ;
905
920
char * remote ;
906
921
907
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Osr|ll" , & z_ftp , php_ftp_ce , & remote , & remote_len , & z_file , & mode , & startpos ) == FAILURE ) {
908
- RETURN_THROWS ();
909
- }
922
+ ZEND_PARSE_PARAMETERS_START (3 , 5 )
923
+ Z_PARAM_OBJECT_OF_CLASS (z_ftp , php_ftp_ce )
924
+ Z_PARAM_STRING (remote , remote_len )
925
+ PHP_Z_PARAM_STREAM (stream )
926
+ Z_PARAM_OPTIONAL
927
+ Z_PARAM_LONG (mode )
928
+ Z_PARAM_LONG (startpos )
929
+ ZEND_PARSE_PARAMETERS_END ();
930
+
910
931
GET_FTPBUF (ftp , z_ftp );
911
- php_stream_from_res (stream , Z_RES_P (z_file ));
912
932
XTYPE (xtype , mode );
913
933
914
934
/* ignore autoresume if autoseek is switched off */
0 commit comments