Browse Source

php3 compatibility added

experimetnal/RETURN_REF_PATCH
Andrew Skalski 27 years ago
parent
commit
4247839610
  1. 21
      ext/ftp/php_ftp.c
  2. 8
      ext/ftp/php_ftp.h

21
ext/ftp/php_ftp.c

@ -29,10 +29,15 @@
*/
#include "php.h"
#include "php_globals.h"
#if HAVE_FTP
#ifndef ZEND_VERSION
#include "internal_functions.h"
#include "php3_list.h"
#define php_error php3_error
#endif
#include "php_ftp.h"
#include "ftp.h"
@ -48,7 +53,7 @@ function_entry php3_ftp_functions[] = {
PHP_FE(ftp_mkdir, NULL)
PHP_FE(ftp_rmdir, NULL)
PHP_FE(ftp_nlist, NULL)
PHP_FE(ftp_listraw, NULL)
PHP_FE(ftp_rawlist, NULL)
PHP_FE(ftp_systype, NULL)
PHP_FE(ftp_get, NULL)
PHP_FE(ftp_put, NULL)
@ -59,7 +64,11 @@ function_entry php3_ftp_functions[] = {
php3_module_entry php3_ftp_module_entry = {
"FTP Functions",
php3_ftp_functions,
#ifdef ZEND_VERSION
PHP_MINIT(ftp),
#else
PHP_MINIT_FUNCTION,
#endif
NULL,
NULL,
NULL,
@ -72,7 +81,11 @@ static void ftp_destructor_ftpbuf(ftpbuf_t *ftp)
ftp_close(ftp);
}
#ifdef ZEND_VERSION
PHP_MINIT_FUNCTION(ftp)
#else
int PHP_MINIT_FUNCTION(INIT_FUNC_ARGS)
#endif
{
le_ftpbuf = register_list_destructors(ftp_destructor_ftpbuf, NULL);
REGISTER_MAIN_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII,
@ -379,9 +392,9 @@ PHP_FUNCTION(ftp_nlist)
}
/* }}} */
/* {{{ proto array ftp_listraw(int stream, string directory)
/* {{{ proto array ftp_rawlist(int stream, string directory)
Returns a detailed listing of a directory as an array of output lines */
PHP_FUNCTION(ftp_listraw)
PHP_FUNCTION(ftp_rawlist)
{
pval *arg1, *arg2;
int id, type;

8
ext/ftp/php_ftp.h

@ -13,7 +13,11 @@
extern php3_module_entry php3_ftp_module_entry;
#define php3_ftp_module_ptr &php3_ftp_module_entry
extern PHP_MINIT_FUNCTION(ftp);
#ifdef ZEND_VERSION
PHP_MINIT_FUNCTION(ftp);
#else
int PHP_MINIT_FUNCTION(INIT_FUNC_ARGS);
#endif
PHP_FUNCTION(ftp_connect);
PHP_FUNCTION(ftp_login);
@ -23,7 +27,7 @@ PHP_FUNCTION(ftp_chdir);
PHP_FUNCTION(ftp_mkdir);
PHP_FUNCTION(ftp_rmdir);
PHP_FUNCTION(ftp_nlist);
PHP_FUNCTION(ftp_listraw);
PHP_FUNCTION(ftp_rawlist);
PHP_FUNCTION(ftp_systype);
PHP_FUNCTION(ftp_get);
PHP_FUNCTION(ftp_put);

Loading…
Cancel
Save