mirror of
https://github.com/php/php-src.git
synced 2026-04-10 17:43:13 +02:00
use _ex-API
This commit is contained in:
@@ -296,7 +296,7 @@ static struct gfxinfo *php3_handle_jpeg(FILE *fp,pval *info)
|
||||
/* main function */
|
||||
PHP_FUNCTION(getimagesize)
|
||||
{
|
||||
pval *arg1,*info = 0;
|
||||
pval **arg1,**info = 0;
|
||||
FILE *fp;
|
||||
int itype = 0;
|
||||
char filetype[3];
|
||||
@@ -306,14 +306,14 @@ PHP_FUNCTION(getimagesize)
|
||||
|
||||
switch(ARG_COUNT(ht)){
|
||||
case 1:
|
||||
if (getParameters(ht, 1, &arg1) == FAILURE) {
|
||||
if (getParametersEx(1, &arg1) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string(arg1);
|
||||
convert_to_string_ex(arg1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (getParameters(ht, 2, &arg1, &info) == FAILURE) {
|
||||
if (getParametersEx(2, &arg1, &info) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!ParameterPassedByReference(ht, 2)) {
|
||||
@@ -321,13 +321,13 @@ PHP_FUNCTION(getimagesize)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
pval_destructor(info);
|
||||
zval_dtor(*info);
|
||||
|
||||
if (array_init(info) == FAILURE) {
|
||||
if (array_init(*info) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
convert_to_string(arg1);
|
||||
convert_to_string_ex(arg1);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -336,10 +336,10 @@ PHP_FUNCTION(getimagesize)
|
||||
}
|
||||
|
||||
/* Check open_basedir */
|
||||
if (_php3_check_open_basedir(arg1->value.str.val)) return;
|
||||
if (_php3_check_open_basedir((*arg1)->value.str.val)) return;
|
||||
|
||||
if ((fp = fopen(arg1->value.str.val,"rb")) == 0) {
|
||||
php_error(E_WARNING, "Unable to open %s", arg1->value.str.val);
|
||||
if ((fp = fopen((*arg1)->value.str.val,"rb")) == 0) {
|
||||
php_error(E_WARNING, "Unable to open %s", (*arg1)->value.str.val);
|
||||
return;
|
||||
}
|
||||
fread(filetype,sizeof(filetype),1,fp);
|
||||
@@ -347,7 +347,7 @@ PHP_FUNCTION(getimagesize)
|
||||
result = php3_handle_gif (fp);
|
||||
itype = 1;
|
||||
} else if (!memcmp(filetype, php3_sig_jpg, 3)) {
|
||||
result = php3_handle_jpeg(fp,info);
|
||||
result = php3_handle_jpeg(fp,*info);
|
||||
itype = 2;
|
||||
} else if (!memcmp(filetype, php3_sig_png, 3)) {
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
|
||||
@@ -439,11 +439,12 @@ void register_phpinfo_constants(INIT_FUNC_ARGS)
|
||||
|
||||
|
||||
/* {{{ proto void phpinfo(void)
|
||||
|
||||
Output a page of useful information about PHP and the current request */
|
||||
PHP_FUNCTION(phpinfo)
|
||||
{
|
||||
int flag;
|
||||
zval *flag_arg;
|
||||
zval **flag_arg;
|
||||
|
||||
|
||||
switch (ARG_COUNT(ht)) {
|
||||
@@ -451,11 +452,11 @@ PHP_FUNCTION(phpinfo)
|
||||
flag = 0xFFFFFFFF;
|
||||
break;
|
||||
case 1:
|
||||
if (getParameters(ht, 1, &flag_arg)==FAILURE) {
|
||||
if (getParametersEx(1, &flag_arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long(flag_arg);
|
||||
flag = flag_arg->value.lval;
|
||||
convert_to_long_ex(flag_arg);
|
||||
flag = (*flag_arg)->value.lval;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -464,6 +465,7 @@ PHP_FUNCTION(phpinfo)
|
||||
php_print_info(flag);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string phpversion(void)
|
||||
@@ -476,11 +478,12 @@ PHP_FUNCTION(phpversion)
|
||||
|
||||
|
||||
/* {{{ proto void phpcredits(int)
|
||||
|
||||
Prints the list of people who've contributed to the PHP project */
|
||||
PHP_FUNCTION(phpcredits)
|
||||
{
|
||||
int flag;
|
||||
zval *flag_arg;
|
||||
zval **flag_arg;
|
||||
|
||||
|
||||
switch (ARG_COUNT(ht)) {
|
||||
@@ -488,11 +491,11 @@ PHP_FUNCTION(phpcredits)
|
||||
flag = 0xFFFFFFFF;
|
||||
break;
|
||||
case 1:
|
||||
if (getParameters(ht, 1, &flag_arg)==FAILURE) {
|
||||
if (getParametersEx(1, &flag_arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long(flag_arg);
|
||||
flag = flag_arg->value.lval;
|
||||
convert_to_long_ex(flag_arg);
|
||||
flag = (*flag_arg)->value.lval;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -501,6 +504,7 @@ PHP_FUNCTION(phpcredits)
|
||||
php_print_credits(flag);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user