CVS update: php31/ext/standard
| From: | zeev | Date: | Fri, 21 Aug 1998 19:17:36 +0000 |
| Subject: | CVS update: php31/ext/standard | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-439@lists.php.net to get a copy of this message | ||
Date: Friday August 21, 1998 @ 15:17
Author: zeev
Update of /repository/php31/ext/standard
In directory asf:/tmp/cvs-serv2030/ext/standard
Modified Files:
basic_functions.c
Log Message:
3.0 patch imported - allow shutdown functions to generate output in the Apache module
Index: php31/ext/standard/basic_functions.c
diff -c php31/ext/standard/basic_functions.c:2.6 php31/ext/standard/basic_functions.c:2.7
*** php31/ext/standard/basic_functions.c:2.6 Thu Aug 20 20:15:27 1998
--- php31/ext/standard/basic_functions.c Fri Aug 21 15:17:36 1998
***************
*** 1,30 ****
/*
+----------------------------------------------------------------------+
! | PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
! | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
! | it under the terms of one of the following licenses: |
! | |
| A) the GNU General Public License as published by the Free Software |
! | Foundation; either version 2 of the License, or (at your option) |
! | any later version. |
! | |
! | B) the PHP License as published by the PHP Development Team and |
! | included in the distribution in the file: LICENSE |
! | |
! | This program is distributed in the hope that it will be useful, |
! | but WITHOUT ANY WARRANTY; without even the implied warranty of |
! | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
! | GNU General Public License for more details. |
! | |
| You should have received a copy of both licenses referred to here. |
! | If you did not, or have any questions about PHP licensing, please |
! | contact core@php.net. |
+----------------------------------------------------------------------+
! | Authors: Andi Gutmans <andi@php.net> |
! | Zeev Suraski <bourbon@netvision.net.il> |
+----------------------------------------------------------------------+
*/
--- 1,30 ----
/*
+----------------------------------------------------------------------+
! | PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
! | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
! | it under the terms of one of the following licenses: |
! | |
| A) the GNU General Public License as published by the Free Software |
! | Foundation; either version 2 of the License, or (at your option) |
! | any later version. |
! | |
! | B) the PHP License as published by the PHP Development Team and |
! | included in the distribution in the file: LICENSE |
! | |
! | This program is distributed in the hope that it will be useful, |
! | but WITHOUT ANY WARRANTY; without even the implied warranty of |
! | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
! | GNU General Public License for more details. |
! | |
| You should have received a copy of both licenses referred to here. |
! | If you did not, or have any questions about PHP licensing, please |
! | contact core@php.net. |
+----------------------------------------------------------------------+
! | Authors: Andi Gutmans <andi@php.net> |
! | Zeev Suraski <bourbon@netvision.net.il> |
+----------------------------------------------------------------------+
*/
***************
*** 100,106 ****
{"sort", php3_sort, first_arg_force_ref},
{"rsort", php3_rsort, first_arg_force_ref},
{"usort", php3_user_sort, first_arg_force_ref},
! {"uasort", php3_auser_sort, first_arg_force_ref},
{"array_walk", php3_array_walk, first_arg_force_ref},
{"sizeof", php3_count, first_arg_allow_ref},
{"count", php3_count, first_arg_allow_ref},
--- 100,106 ----
{"sort", php3_sort, first_arg_force_ref},
{"rsort", php3_rsort, first_arg_force_ref},
{"usort", php3_user_sort, first_arg_force_ref},
! {"uasort", php3_auser_sort, first_arg_force_ref},
{"array_walk", php3_array_walk, first_arg_force_ref},
{"sizeof", php3_count, first_arg_allow_ref},
{"count", php3_count, first_arg_allow_ref},
***************
*** 151,157 ****
{"strcmp", php3_strcmp, NULL},
{"strspn", php3_strspn, NULL},
{"strcspn", php3_strcspn, NULL},
! {"strcasecmp", php3_strcasecmp, NULL},
{"strtok", php3_strtok, NULL},
{"strtoupper", php3_strtoupper, NULL},
{"strtolower", php3_strtolower, NULL},
--- 151,157 ----
{"strcmp", php3_strcmp, NULL},
{"strspn", php3_strspn, NULL},
{"strcspn", php3_strcspn, NULL},
! {"strcasecmp", php3_strcasecmp, NULL},
{"strtok", php3_strtok, NULL},
{"strtoupper", php3_strtoupper, NULL},
{"strtolower", php3_strtolower, NULL},
***************
*** 650,659 ****
php3_error(E_WARNING, "Wrong datatype in asort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to asort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_data_compare,0) == FAILURE) {
return;
}
--- 650,659 ----
php3_error(E_WARNING, "Wrong datatype in asort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to asort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_data_compare,0) == FAILURE) {
return;
}
***************
*** 672,681 ****
php3_error(E_WARNING, "Wrong datatype in arsort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to arsort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_reverse_data_compare,0) == FAILURE) {
return;
}
--- 672,681 ----
php3_error(E_WARNING, "Wrong datatype in arsort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to arsort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_reverse_data_compare,0) == FAILURE) {
return;
}
***************
*** 694,703 ****
php3_error(E_WARNING, "Wrong datatype in sort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to sort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_data_compare,1) == FAILURE) {
return;
}
--- 694,703 ----
php3_error(E_WARNING, "Wrong datatype in sort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to sort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_data_compare,1) == FAILURE) {
return;
}
***************
*** 716,725 ****
php3_error(E_WARNING, "Wrong datatype in rsort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to rsort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_reverse_data_compare,1) == FAILURE) {
return;
}
--- 716,725 ----
php3_error(E_WARNING, "Wrong datatype in rsort() call");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to rsort()");
return;
! }
if (_php3_hash_sort(array->value.ht, array_reverse_data_compare,1) == FAILURE) {
return;
}
***************
*** 727,733 ****
}
static pval *user_compare_func_name;
!
static int array_user_compare(const void *a, const void *b)
{
Bucket *f;
--- 727,733 ----
}
static pval *user_compare_func_name;
!
static int array_user_compare(const void *a, const void *b)
{
Bucket *f;
***************
*** 812,821 ****
if (!(array->type & IS_HASH)) {
php3_error(E_WARNING, "Variable passed to end() is not an array or object");
return;
}
- if (!ParameterPassedByReference(ht,1)) {
- php3_error(E_WARNING, "Array not passed by reference in call to end()");
- }
_php3_hash_internal_pointer_end(array->value.ht);
while (1) {
if (_php3_hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
--- 812,821 ----
if (!(array->type & IS_HASH)) {
php3_error(E_WARNING, "Variable passed to end() is not an array or object");
return;
+ }
+ if (!ParameterPassedByReference(ht,1)) {
+ php3_error(E_WARNING, "Array not passed by reference in call to end()");
}
_php3_hash_internal_pointer_end(array->value.ht);
while (1) {
if (_php3_hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
***************
*** 978,986 ****
php3_error(E_WARNING, "Variable passed to key() is not an array or object");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to key()");
! }
switch (_php3_hash_get_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
return_value->value.str.val = string_key;
--- 978,986 ----
php3_error(E_WARNING, "Variable passed to key() is not an array or object");
return;
}
! if (!ParameterPassedByReference(ht,1)) {
! php3_error(E_WARNING, "Array not passed by reference in call to key()");
! }
switch (_php3_hash_get_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
return_value->value.str.val = string_key;
***************
*** 1170,1176 ****
static pval *php3_array_walk_func_name;
!
static int _php3_array_walk(const void *a)
{
pval *args[1];
--- 1170,1176 ----
static pval *php3_array_walk_func_name;
!
static int _php3_array_walk(const void *a)
{
pval *args[1];
***************
*** 1357,1363 ****
4th arg = used for additional headers if email
error options
! 0 = send to php3_error_log (uses syslog or file depending on ini setting)
1 = send via email to 3rd parameter 4th option = additional headers
2 = send via tcp/ip to 3rd parameter (name or ip:port)
3 = save to file in 3rd parameter
--- 1357,1363 ----
4th arg = used for additional headers if email
error options
! 0 = send to php3_error_log (uses syslog or file depending on ini setting)
1 = send via email to 3rd parameter 4th option = additional headers
2 = send via tcp/ip to 3rd parameter (name or ip:port)
3 = save to file in 3rd parameter
***************
*** 1483,1489 ****
RETURN_FALSE;
}
convert_to_string(params[0]);
! if (call_user_function(&GLOBAL(function_table), NULL, params[0], &retval, arg_count-1,
params+1)==SUCCESS) {
*return_value = retval;
} else {
php3_error(E_WARNING,"Unable to call %s() - function does not exist",
params[0]->value.str.val);
--- 1483,1489 ----
RETURN_FALSE;
}
convert_to_string(params[0]);
! if (call_user_function(&GLOBAL(function_table), NULL, params[0], &retval, arg_count-1,
params+1)==SUCCESS) {
*return_value = retval;
} else {
php3_error(E_WARNING,"Unable to call %s() - function does not exist",
params[0]->value.str.val);
***************
*** 1533,1538 ****
--- 1533,1551 ----
yystype_destructor(user_shutdown_function_name _INLINE_TLS);
}
+
+ int user_shutdown_function_executor(pval *user_shutdown_function_name)
+ {
+ return 1;
+ }
+
+
+ void php3_call_shutdown_functions()
+ {
+ if (user_shutdown_function_names) {
+ _php3_hash_apply(user_shutdown_function_names, (int(*)(void *))
user_shutdown_function_executor);
+ }
+ }
PHP3_FUNCTION(register_shutdown_function)
{
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net