CVS update: php31/ext/standard
| From: | shane | Date: | Fri, 14 Aug 1998 17:29:59 +0000 |
| Subject: | CVS update: php31/ext/standard | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-232@lists.php.net to get a copy of this message | ||
Date: Friday August 14, 1998 @ 13:29
Author: shane
Update of /repository/php31/ext/standard
In directory asf:/tmp/cvs-serv1435/ext/standard
Modified Files:
datetime.c datetime.h dir.c exec.c image.c math.c
Log Message:
finally, 3.0->3.1 patches done in standard
Index: php31/ext/standard/datetime.c
diff -c php31/ext/standard/datetime.c:2.0 php31/ext/standard/datetime.c:2.1
*** php31/ext/standard/datetime.c:2.0 Fri Jul 3 09:14:19 1998
--- php31/ext/standard/datetime.c Fri Aug 14 13:29:58 1998
***************
*** 30,36 ****
*/
! /* $Id: datetime.c,v 2.0 1998/07/03 13:14:19 rasmus Exp $ */
#ifdef THREAD_SAFE
--- 30,36 ----
*/
! /* $Id: datetime.c,v 2.1 1998/08/14 17:29:58 shane Exp $ */
#ifdef THREAD_SAFE
***************
*** 347,361 ****
void php3_getdate(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *timestamp;
struct tm *ta;
! if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, ×tamp) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long(timestamp);
! ta = localtime((time_t *) & timestamp->value.lval);
if (!ta) {
php3_error(E_WARNING, "Cannot perform date calculation");
return;
--- 347,366 ----
void php3_getdate(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *timestamp_arg;
! time_t timestamp;
struct tm *ta;
! if (ARG_COUNT(ht) == 0) {
! timestamp = time(NULL);
! } else if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, ×tamp_arg) == FAILURE) {
WRONG_PARAM_COUNT;
+ } else {
+ convert_to_long(timestamp_arg);
+ timestamp = timestamp_arg->value.lval;
}
! ta = localtime(×tamp);
if (!ta) {
php3_error(E_WARNING, "Cannot perform date calculation");
return;
***************
*** 374,380 ****
add_assoc_long(return_value, "yday", ta->tm_yday);
add_assoc_string(return_value, "weekday", day_full_names[ta->tm_wday], 1);
add_assoc_string(return_value, "month", mon_full_names[ta->tm_mon], 1);
! add_index_long(return_value, 0, timestamp->value.lval);
}
/* Return date string in standard format for http headers */
--- 379,385 ----
add_assoc_long(return_value, "yday", ta->tm_yday);
add_assoc_string(return_value, "weekday", day_full_names[ta->tm_wday], 1);
add_assoc_string(return_value, "month", mon_full_names[ta->tm_mon], 1);
! add_index_long(return_value, 0, timestamp);
}
/* Return date string in standard format for http headers */
Index: php31/ext/standard/datetime.h
diff -c php31/ext/standard/datetime.h:2.0 php31/ext/standard/datetime.h:2.1
*** php31/ext/standard/datetime.h:2.0 Fri Jul 3 09:14:20 1998
--- php31/ext/standard/datetime.h Fri Aug 14 13:29:58 1998
***************
*** 29,35 ****
*/
! /* $Id: datetime.h,v 2.0 1998/07/03 13:14:20 rasmus Exp $ */
#ifndef _DATETIME_H
#define _DATETIME_H
--- 29,35 ----
*/
! /* $Id: datetime.h,v 2.1 1998/08/14 17:29:58 shane Exp $ */
#ifndef _DATETIME_H
#define _DATETIME_H
***************
*** 46,50 ****
--- 46,51 ----
#endif
extern char *php3_std_date(time_t t);
+ void _php3_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#endif /* _DATETIME_H */
Index: php31/ext/standard/dir.c
diff -c php31/ext/standard/dir.c:2.0 php31/ext/standard/dir.c:2.1
*** php31/ext/standard/dir.c:2.0 Fri Jul 3 09:14:20 1998
--- php31/ext/standard/dir.c Fri Aug 14 13:29:58 1998
***************
*** 27,39 ****
+----------------------------------------------------------------------+
*/
! /* $Id: dir.c,v 2.0 1998/07/03 13:14:20 rasmus Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
#include "php.h"
#include "internal_functions.h"
#include "php3_list.h"
#include "php3_dir.h"
--- 27,40 ----
+----------------------------------------------------------------------+
*/
! /* $Id: dir.c,v 2.1 1998/08/14 17:29:58 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
#include "php.h"
#include "internal_functions.h"
+ #include "fopen-wrappers.h"
#include "php3_list.h"
#include "php3_dir.h"
***************
*** 93,98 ****
--- 94,102 ----
}
convert_to_string(arg);
+ /* Check fopen_basedir */
+ if (_php3_check_fopen_basedir(arg->value.str.val)) RETURN_FALSE;
+
dirp = opendir(arg->value.str.val);
if (!dirp) {
php3_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno),errno);
***************
*** 237,242 ****
--- 241,249 ----
}
convert_to_string(arg);
+ /* Check fopen_basedir */
+ if (_php3_check_fopen_basedir(arg->value.str.val)) RETURN_FALSE;
+
dirp = opendir(arg->value.str.val);
if (!dirp) {
php3_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno), errno);
Index: php31/ext/standard/exec.c
diff -c php31/ext/standard/exec.c:2.0 php31/ext/standard/exec.c:2.1
*** php31/ext/standard/exec.c:2.0 Fri Jul 3 09:14:22 1998
--- php31/ext/standard/exec.c Fri Aug 14 13:29:59 1998
***************
*** 26,32 ****
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: exec.c,v 2.0 1998/07/03 13:14:22 rasmus Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 26,32 ----
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: exec.c,v 2.1 1998/08/14 17:29:59 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 91,97 ****
efree(d);
d = tmp;
#if WIN32|WINNT
! fp = popen(d, "rt");
#else
fp = popen(d, "r");
#endif
--- 91,97 ----
efree(d);
d = tmp;
#if WIN32|WINNT
! fp = popen(d, "rb");
#else
fp = popen(d, "r");
#endif
***************
*** 102,108 ****
}
} else { /* not safe_mode */
#if WIN32|WINNT
! fp = popen(cmd, "rt");
#else
fp = popen(cmd, "r");
#endif
--- 102,108 ----
}
} else { /* not safe_mode */
#if WIN32|WINNT
! fp = popen(cmd, "rb");
#else
fp = popen(cmd, "r");
#endif
Index: php31/ext/standard/image.c
diff -c php31/ext/standard/image.c:2.0 php31/ext/standard/image.c:2.1
*** php31/ext/standard/image.c:2.0 Fri Jul 3 09:14:26 1998
--- php31/ext/standard/image.c Fri Aug 14 13:29:59 1998
***************
*** 26,32 ****
| Authors: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: image.c,v 2.0 1998/07/03 13:14:26 rasmus Exp $ */
/*
* Based on Daniel Schmitt's imageinfo.c which carried the following
* Copyright notice.
--- 26,32 ----
| Authors: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: image.c,v 2.1 1998/08/14 17:29:59 shane Exp $ */
/*
* Based on Daniel Schmitt's imageinfo.c which carried the following
* Copyright notice.
***************
*** 53,58 ****
--- 53,59 ----
#include <fcntl.h>
#endif
#include "internal_functions.h"
+ #include "fopen-wrappers.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
***************
*** 235,240 ****
--- 236,244 ----
WRONG_PARAM_COUNT;
}
convert_to_string(arg1);
+
+ /* Check fopen_basedir */
+ if (_php3_check_fopen_basedir(arg1->value.str.val)) return;
if ((filehandle = open(arg1->value.str.val, O_RDONLY)) < 0) {
php3_error(E_WARNING, "Unable to open %s", arg1->value.str.val);
Index: php31/ext/standard/math.c
diff -c php31/ext/standard/math.c:2.0 php31/ext/standard/math.c:2.1
*** php31/ext/standard/math.c:2.0 Fri Jul 3 09:14:29 1998
--- php31/ext/standard/math.c Fri Aug 14 13:29:59 1998
***************
*** 42,47 ****
--- 42,49 ----
#define M_PI 3.14159265358979323846
#endif
+ char *_php3_number_format(double, int, char ,char);
+
void php3_abs(INTERNAL_FUNCTION_PARAMETERS) {
pval *value;
TLS_VARS;
--
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