mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 03:00:49 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f128c84af | ||
|
|
4ba37d04d4 | ||
|
|
4eb9e62209 | ||
|
|
eb0a6a666f | ||
|
|
8f514cd18c | ||
|
|
1340c04976 | ||
|
|
014729d00b | ||
|
|
95c6c6d2cd | ||
|
|
d734669230 | ||
|
|
1a78dc5fbf | ||
|
|
924ae32ddf | ||
|
|
18606377dd | ||
|
|
a0303c772a | ||
|
|
52747127f8 | ||
|
|
c127df868e | ||
|
|
b5c8fcb5fa | ||
|
|
158ebbd9b5 | ||
|
|
da0a76c561 | ||
|
|
f1a8fde76a |
No files matched your search
@@ -1,6 +1,20 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
17 Nov 2005, PHP 5.1 Release Candidate 6
|
||||
- Changed function parameter parsing to handle integers in a non-strict fashion
|
||||
and to emit an E_NOTICE on badly formed integer values. (Ilia)
|
||||
- Fixed Apache 2 regression with sub-request handling on non-linux systems.
|
||||
(Ilia, Tony)
|
||||
- Fixed bug #35249 (compile failure when ext/readline is compiled as shared).
|
||||
(Jani)
|
||||
- Fixed bug #35248 (sqlite_query() doesnt set error_msg when return value is
|
||||
being used). (Ilia)
|
||||
- Fixed bug #35079 (stream_set_blocking(true) toggles, not enables
|
||||
blocking). (askalski at gmail dot com, Tony)
|
||||
|
||||
16 Nov 2005, PHP 5.1 Release Candidate 5
|
||||
- Added an E_STRICT warning on the usage of {} for accessing of string offsets.
|
||||
(Ilia)
|
||||
- Changed type hints to allow "null" as default value for class and array.
|
||||
(Marcus, Derick, Dmitry)
|
||||
- Fixed __get/__set to allow recursive calls for different properties. (Dmitry)
|
||||
|
||||
@@ -8,7 +8,7 @@ class Test {
|
||||
function __copy()
|
||||
{
|
||||
$string = PHP_VERSION;
|
||||
$version = $string{0};
|
||||
$version = $string[0];
|
||||
if($string < 5)
|
||||
{
|
||||
return $this;
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #26281 (switch() crash when condition is a string offset)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = 'abc';
|
||||
switch ($x{0}) {
|
||||
switch ($x[0]) {
|
||||
case 'a':
|
||||
echo "no crash\n";
|
||||
break;
|
||||
|
||||
@@ -4,14 +4,14 @@ Bug #26801 (switch ($a{0}) crash)
|
||||
<?php
|
||||
|
||||
$a = '11';
|
||||
$b = $a{0};
|
||||
$b = $a[0];
|
||||
switch ($b) {
|
||||
case '-':
|
||||
break;
|
||||
}
|
||||
|
||||
$a = '22';
|
||||
switch ($a{0}) {
|
||||
switch ($a[0]) {
|
||||
case '-':
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ var_dump(isset($a->b));
|
||||
$a = '0';
|
||||
var_dump(isset($a->b));
|
||||
$a = '';
|
||||
var_dump(isset($a{'b'}));
|
||||
var_dump(isset($a['b']));
|
||||
$a = 'a';
|
||||
var_dump(isset($a{'b'}));
|
||||
var_dump(isset($a['b']));
|
||||
$a = '0';
|
||||
var_dump(isset($a{'b'}));
|
||||
var_dump(isset($a['b']));
|
||||
|
||||
$simpleString = "Bogus String Text";
|
||||
echo isset($simpleString->wrong)?"bug\n":"ok\n";
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
MAJOR_VERSION=5
|
||||
MINOR_VERSION=1
|
||||
RELEASE_VERSION=0
|
||||
EXTRA_VERSION="RC5"
|
||||
EXTRA_VERSION="RC6"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Regenerating Parser
|
||||
===================
|
||||
|
||||
Make sure you use re2c 0.9.8dev or higher:
|
||||
Make sure you use re2c 0.9.10 or higher:
|
||||
|
||||
/dat/dev/sf/re2c/re2c -d -b resource/parse_date.re > parse_date.c
|
||||
/dat/dev/sf/re2c/re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re
|
||||
+11711
-10655
File diff suppressed because it is too large.
Load diff
@@ -598,7 +598,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
long value = 0;
|
||||
timelib_tz_lookup_table *tp;
|
||||
|
||||
while (**ptr != '\0') {
|
||||
while (**ptr != '\0' && **ptr != ')') {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -621,10 +621,11 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
|
||||
{
|
||||
timelib_tzinfo *res;
|
||||
long retval = 0;
|
||||
|
||||
*tz_not_found = 0;
|
||||
|
||||
while (**ptr == ' ') {
|
||||
while (**ptr == ' ' || **ptr == '(') {
|
||||
++*ptr;
|
||||
}
|
||||
if (**ptr == '+') {
|
||||
@@ -634,7 +635,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
*tz_not_found = 0;
|
||||
t->dst = 0;
|
||||
|
||||
return -1 * timelib_parse_tz_cor(ptr);
|
||||
retval = -1 * timelib_parse_tz_cor(ptr);
|
||||
} else if (**ptr == '-') {
|
||||
++*ptr;
|
||||
t->is_localtime = 1;
|
||||
@@ -642,7 +643,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
*tz_not_found = 0;
|
||||
t->dst = 0;
|
||||
|
||||
return timelib_parse_tz_cor(ptr);
|
||||
retval = timelib_parse_tz_cor(ptr);
|
||||
} else {
|
||||
int found = 0;
|
||||
long offset;
|
||||
@@ -650,6 +651,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
|
||||
t->is_localtime = 1;
|
||||
t->zone_type = TIMELIB_ZONETYPE_ABBR;
|
||||
|
||||
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
|
||||
#if 0
|
||||
/* If we found a TimeZone identifier, use it */
|
||||
@@ -671,8 +673,12 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
}
|
||||
free(tz_abbr);
|
||||
*tz_not_found = (found == 0);
|
||||
return offset;
|
||||
retval = offset;
|
||||
}
|
||||
while (**ptr == ')') {
|
||||
++*ptr;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
#define timelib_split_free(arg) { \
|
||||
@@ -709,7 +715,7 @@ minutelz = [0-5][0-9];
|
||||
second = minute | "60";
|
||||
secondlz = minutelz | "60";
|
||||
meridian = [AaPp] "."? [Mm] "."?;
|
||||
tz = [A-Za-z]{1,4} | [A-Z][a-z]+([_/][A-Z][a-z]+)+;
|
||||
tz = "("? [A-Za-z]{1,4} ")"? | [A-Z][a-z]+([_/][A-Z][a-z]+)+;
|
||||
tzcorrection = [+-] hour24 ":"? minutelz?;
|
||||
|
||||
month = "0"? [0-9] | "1"[0-2];
|
||||
@@ -1396,6 +1402,8 @@ timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb)
|
||||
in.time->dst = -1;
|
||||
in.errors = 0;
|
||||
in.tzdb = tzdb;
|
||||
in.time->is_localtime = 0;
|
||||
in.time->zone_type = 0;
|
||||
|
||||
do {
|
||||
t = scan(&in);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
Regenerating Parser
|
||||
===================
|
||||
|
||||
Make sure you use re2c 0.9.8dev or higher:
|
||||
|
||||
/dat/dev/sf/re2c/re2c -d -b resource/parse_date.re > parse_date.c
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1002,6 +1002,7 @@
|
||||
{ "kdt", 1, 36000, "ROK" },
|
||||
{ "kgst", 1, 21600, "Asia/Bishkek" },
|
||||
{ "kgt", 0, 18000, "Asia/Bishkek" },
|
||||
{ "kgt", 0, 21600, "Asia/Bishkek" },
|
||||
{ "kizst", 1, 21600, "Asia/Qyzylorda" },
|
||||
{ "kizt", 0, 14400, "Asia/Qyzylorda" },
|
||||
{ "kizt", 0, 18000, "Asia/Qyzylorda" },
|
||||
|
||||
+49
-48
@@ -74,8 +74,9 @@ function_entry date_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
|
||||
function_entry date_funcs_date[] = {
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
ZEND_NAMED_FE(format, ZEND_FN(date_format), NULL)
|
||||
ZEND_NAMED_FE(modify, ZEND_FN(date_modify), NULL)
|
||||
ZEND_NAMED_FE(getTimezone, ZEND_FN(date_timezone_get), NULL)
|
||||
@@ -84,25 +85,23 @@ function_entry date_funcs_date[] = {
|
||||
ZEND_NAMED_FE(setTime, ZEND_FN(date_time_set), NULL)
|
||||
ZEND_NAMED_FE(setDate, ZEND_FN(date_date_set), NULL)
|
||||
ZEND_NAMED_FE(setISODate, ZEND_FN(date_isodate_set), NULL)
|
||||
#endif
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
function_entry date_funcs_timezone[] = {
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
ZEND_NAMED_FE(getName, ZEND_FN(timezone_name_get), NULL)
|
||||
ZEND_NAMED_FE(getOffset, ZEND_FN(timezone_offset_get), NULL)
|
||||
ZEND_NAMED_FE(getTransistions, ZEND_FN(timezone_transistions_get), NULL)
|
||||
ZEND_MALIAS(timezone, listAbbreviations, abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
ZEND_MALIAS(timezone, listIdentifiers, identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
#endif
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
static void date_register_classes(TSRMLS_D);
|
||||
# define DATE_REGISTER_CLASSES date_register_classes(TSRMLS_C)
|
||||
#else
|
||||
# define DATE_REGISTER_CLASSES /* */
|
||||
#endif
|
||||
|
||||
static char* guess_timezone(TSRMLS_D);
|
||||
static void date_register_classes(TSRMLS_D);
|
||||
/* }}} */
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(date)
|
||||
@@ -117,7 +116,11 @@ PHP_INI_BEGIN()
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
zend_class_entry *date_ce_date, *date_ce_timezone;
|
||||
|
||||
static zend_object_handlers date_object_handlers_date;
|
||||
static zend_object_handlers date_object_handlers_timezone;
|
||||
|
||||
typedef struct _php_date_obj php_date_obj;
|
||||
typedef struct _php_timezone_obj php_timezone_obj;
|
||||
|
||||
@@ -131,11 +134,7 @@ struct _php_timezone_obj {
|
||||
timelib_tzinfo *tz;
|
||||
};
|
||||
|
||||
zend_class_entry *date_ce_date, *date_ce_timezone;
|
||||
|
||||
static zend_object_handlers date_object_handlers_date;
|
||||
static zend_object_handlers date_object_handlers_timezone;
|
||||
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
#define DATE_SET_CONTEXT \
|
||||
zval *object; \
|
||||
object = getThis(); \
|
||||
@@ -154,12 +153,12 @@ static zend_object_handlers date_object_handlers_timezone;
|
||||
} \
|
||||
obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \
|
||||
|
||||
#endif
|
||||
|
||||
static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC);
|
||||
static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC);
|
||||
static void date_object_free_storage_date(void *object TSRMLS_DC);
|
||||
static void date_object_free_storage_timezone(void *object TSRMLS_DC);
|
||||
#endif
|
||||
static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC);
|
||||
static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC);
|
||||
|
||||
/* {{{ Module struct */
|
||||
zend_module_entry date_module_entry = {
|
||||
@@ -237,18 +236,7 @@ PHP_MINIT_FUNCTION(date)
|
||||
ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL);
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
DATE_REGISTER_CLASSES;
|
||||
|
||||
REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
|
||||
date_register_classes(TSRMLS_C);
|
||||
|
||||
php_date_global_timezone_db = NULL;
|
||||
php_date_global_timezone_db_enabled = 0;
|
||||
@@ -1014,7 +1002,38 @@ PHP_FUNCTION(getdate)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
static void date_register_classes(TSRMLS_D)
|
||||
{
|
||||
zend_class_entry ce_date, ce_timezone;
|
||||
|
||||
INIT_CLASS_ENTRY(ce_date, "date", date_funcs_date);
|
||||
ce_date.create_object = date_object_new_date;
|
||||
date_ce_date = zend_register_internal_class_ex(&ce_date, NULL, NULL TSRMLS_CC);
|
||||
memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_date.clone_obj = NULL;
|
||||
|
||||
#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
|
||||
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
|
||||
|
||||
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_ISO8601);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC1123);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC1123);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC1036);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_ISO8601);
|
||||
|
||||
|
||||
INIT_CLASS_ENTRY(ce_timezone, "timezone", date_funcs_timezone);
|
||||
ce_timezone.create_object = date_object_new_timezone;
|
||||
date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL, NULL TSRMLS_CC);
|
||||
memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_timezone.clone_obj = NULL;
|
||||
}
|
||||
|
||||
static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC)
|
||||
{
|
||||
php_date_obj *intern;
|
||||
@@ -1061,28 +1080,10 @@ static void date_object_free_storage_date(void *object TSRMLS_DC)
|
||||
|
||||
static void date_object_free_storage_timezone(void *object TSRMLS_DC)
|
||||
{
|
||||
php_timezone_obj *intern = (php_timezone_obj *)object;
|
||||
|
||||
efree(object);
|
||||
}
|
||||
|
||||
static void date_register_classes(TSRMLS_D)
|
||||
{
|
||||
zend_class_entry ce_date, ce_timezone;
|
||||
|
||||
INIT_CLASS_ENTRY(ce_date, "date", date_funcs_date);
|
||||
ce_date.create_object = date_object_new_date;
|
||||
date_ce_date = zend_register_internal_class_ex(&ce_date, NULL, NULL TSRMLS_CC);
|
||||
memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_date.clone_obj = NULL;
|
||||
|
||||
INIT_CLASS_ENTRY(ce_timezone, "timezone", date_funcs_timezone);
|
||||
ce_timezone.create_object = date_object_new_timezone;
|
||||
date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL, NULL TSRMLS_CC);
|
||||
memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_timezone.clone_obj = NULL;
|
||||
}
|
||||
|
||||
#ifdef EXPERIMENTAL_DATE_SUPPORT
|
||||
/* Advanced Interface */
|
||||
static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
|
||||
{
|
||||
|
||||
@@ -4,17 +4,17 @@ Bug #33869 (strtotime() doesn't parse "+1days" format)
|
||||
<?php
|
||||
date_default_timezone_set("UTC");
|
||||
$tm = strtotime("2005-01-01 01:01:01");
|
||||
echo date(DATE_ISO8601, strtotime('+5days', $tm));
|
||||
echo date(date::ISO8601, strtotime('+5days', $tm));
|
||||
echo "\n";
|
||||
echo date(DATE_ISO8601, strtotime('+1month', $tm));
|
||||
echo date(date::ISO8601, strtotime('+1month', $tm));
|
||||
echo "\n";
|
||||
echo date(DATE_ISO8601, strtotime('+1year', $tm));
|
||||
echo date(date::ISO8601, strtotime('+1year', $tm));
|
||||
echo "\n";
|
||||
echo date(DATE_ISO8601, strtotime('+5 days', $tm));
|
||||
echo date(date::ISO8601, strtotime('+5 days', $tm));
|
||||
echo "\n";
|
||||
echo date(DATE_ISO8601, strtotime('+1 month', $tm));
|
||||
echo date(date::ISO8601, strtotime('+1 month', $tm));
|
||||
echo "\n";
|
||||
echo date(DATE_ISO8601, strtotime('+1 year', $tm));
|
||||
echo date(date::ISO8601, strtotime('+1 year', $tm));
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -6,10 +6,10 @@ date_default_timezone_set("UTC");
|
||||
echo "Y/m/d: ", strtotime("2005/8/12"), "\n";
|
||||
echo "Y-m-d: ", strtotime("2005-8-12"), "\n";
|
||||
|
||||
echo date(DATE_ISO8601, strtotime("2005/1/2")), "\n";
|
||||
echo date(DATE_ISO8601, strtotime("2005/01/02")), "\n";
|
||||
echo date(DATE_ISO8601, strtotime("2005/01/2")), "\n";
|
||||
echo date(DATE_ISO8601, strtotime("2005/1/02")), "\n";
|
||||
echo date(date::ISO8601, strtotime("2005/1/2")), "\n";
|
||||
echo date(date::ISO8601, strtotime("2005/01/02")), "\n";
|
||||
echo date(date::ISO8601, strtotime("2005/01/2")), "\n";
|
||||
echo date(date::ISO8601, strtotime("2005/1/02")), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Y/m/d: 1123804800
|
||||
|
||||
@@ -10,7 +10,7 @@ $tests = array(
|
||||
|
||||
foreach ($tests as $test) {
|
||||
$t = strtotime("2005-12-22 ". $test);
|
||||
printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t));
|
||||
printf("%-10s => %s\n", $test, date(date::ISO8601, $t));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -13,7 +13,7 @@ $tests = array(
|
||||
|
||||
foreach ($tests as $test) {
|
||||
$t = strtotime("2005-12-22 ". $test);
|
||||
printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t));
|
||||
printf("%-10s => %s\n", $test, date(date::ISO8601, $t));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #35218 (strtotime no longer ignores timezone comments like "(PST)")
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("UTC");
|
||||
$date = 'Sun, 13 Nov 2005 22:56:10 -0800 (PST)';
|
||||
$date_fixed = 'Sun, 13 Nov 2005 22:56:10 -0800';
|
||||
|
||||
var_dump(strtotime($date));
|
||||
var_dump(strtotime($date_fixed));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1131951370)
|
||||
int(1131951370)
|
||||
@@ -28,7 +28,7 @@ $d[] = date_create("2005-07-14 22:30:41 Europe/Oslo", $tz1);
|
||||
$d[] = date_create("2005-07-14 22:30:41 America/Los_Angeles", $tz2);
|
||||
|
||||
foreach($d as $date) {
|
||||
echo $date->format(DATE_ISO8601), "\n";
|
||||
echo $date->format(date::ISO8601), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -12,10 +12,10 @@ date.timezone=
|
||||
$date4 = strtotime("2005-07-12 08:00:00");
|
||||
|
||||
echo date_default_timezone_get(), "\n";
|
||||
echo date(DATE_ISO8601, $date1), "\n";
|
||||
echo date(DATE_ISO8601, $date2), "\n";
|
||||
echo date(DATE_ISO8601, $date3), "\n";
|
||||
echo date(DATE_ISO8601, $date4), "\n";
|
||||
echo date(date::ISO8601, $date1), "\n";
|
||||
echo date(date::ISO8601, $date2), "\n";
|
||||
echo date(date::ISO8601, $date3), "\n";
|
||||
echo date(date::ISO8601, $date4), "\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3
|
||||
|
||||
@@ -16,7 +16,7 @@ foreach ($tzs as $tz) {
|
||||
if ($ret == FALSE) {
|
||||
echo "out of range\n";
|
||||
} else {
|
||||
echo date("F ".DATE_ISO8601, $ret), "\n";
|
||||
echo date("F ".date::ISO8601, $ret), "\n";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
@@ -8,7 +8,7 @@ $d[] = strtotime("2005-07-14 22:30:41");
|
||||
$d[] = strtotime("2005-07-14 22:30:41 GMT");
|
||||
|
||||
foreach($d as $date) {
|
||||
echo date(DATE_ISO8601, $date), "\n";
|
||||
echo date(date::ISO8601, $date), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl By default we'll compile and link against the bundled PCRE library
|
||||
dnl if DIR is supplied, we'll use that for linking
|
||||
|
||||
PHP_ARG_WITH(pcre-regex,for PCRE support,
|
||||
[ --without-pcre-regex Do not include Perl Compatible Regular Expressions
|
||||
support. Use --with-pcre-regex=DIR to specify DIR
|
||||
where PCRE's include and library files are located,
|
||||
if not using bundled library.],yes)
|
||||
|
||||
if test "$PHP_PCRE_REGEX" != "no"; then
|
||||
if test "$PHP_PCRE_REGEX" = "yes"; then
|
||||
PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_dfa_exec.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_printint.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_ucp_findchar.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -I@ext_srcdir@/pcrelib)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
|
||||
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
|
||||
else
|
||||
for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
|
||||
test -f $i/pcre.h && PCRE_INCDIR=$i
|
||||
done
|
||||
|
||||
if test -z "$PCRE_INCDIR"; then
|
||||
AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
|
||||
fi
|
||||
|
||||
for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
|
||||
test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
|
||||
done
|
||||
|
||||
if test -z "$PCRE_LIBDIR" ; then
|
||||
AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX])
|
||||
fi
|
||||
|
||||
changequote({,})
|
||||
pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
|
||||
pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
|
||||
changequote([,])
|
||||
pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
|
||||
if test "$pcre_minor_length" -eq 2 ; then
|
||||
pcre_minor="$pcre_minor"0
|
||||
fi
|
||||
pcre_version=$pcre_major$pcre_minor
|
||||
if test "$pcre_version" -lt 208; then
|
||||
AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08])
|
||||
fi
|
||||
|
||||
PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
|
||||
|
||||
AC_DEFINE(HAVE_PCRE, 1, [ ])
|
||||
PHP_ADD_INCLUDE($PCRE_INCDIR)
|
||||
PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000)
|
||||
fi
|
||||
PHP_SUBST(PCRE_SHARED_LIBADD)
|
||||
fi
|
||||
+8
-5
@@ -1516,7 +1516,7 @@ next_row:
|
||||
/* }}} */
|
||||
|
||||
/* {{{ sqlite_query */
|
||||
void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
|
||||
void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres, zval *errmsg TSRMLS_DC)
|
||||
{
|
||||
struct php_sqlite_result res, *rres;
|
||||
int ret;
|
||||
@@ -1532,6 +1532,9 @@ void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_le
|
||||
|
||||
if (ret != SQLITE_OK) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errtext);
|
||||
if (errmsg) {
|
||||
ZVAL_STRING(errmsg, errtext, 1);
|
||||
}
|
||||
sqlite_freemem(errtext);
|
||||
goto terminate;
|
||||
} else if (!res.vm) { /* empty query */
|
||||
@@ -1632,7 +1635,7 @@ PHP_FUNCTION(sqlite_unbuffered_query)
|
||||
return;
|
||||
}
|
||||
|
||||
sqlite_query(object, db, sql, sql_len, (int)mode, 0, return_value, NULL TSRMLS_CC);
|
||||
sqlite_query(object, db, sql, sql_len, (int)mode, 0, return_value, NULL, errmsg TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1757,7 +1760,7 @@ PHP_FUNCTION(sqlite_query)
|
||||
return;
|
||||
}
|
||||
|
||||
sqlite_query(object, db, sql, sql_len, (int)mode, 1, return_value, NULL TSRMLS_CC);
|
||||
sqlite_query(object, db, sql, sql_len, (int)mode, 1, return_value, NULL, errmsg TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2168,7 +2171,7 @@ PHP_FUNCTION(sqlite_array_query)
|
||||
}
|
||||
|
||||
rres = (struct php_sqlite_result *)emalloc(sizeof(*rres));
|
||||
sqlite_query(NULL, db, sql, sql_len, (int)mode, 0, NULL, &rres TSRMLS_CC);
|
||||
sqlite_query(NULL, db, sql, sql_len, (int)mode, 0, NULL, &rres, NULL TSRMLS_CC);
|
||||
if (db->last_err_code != SQLITE_OK) {
|
||||
if (rres) {
|
||||
efree(rres);
|
||||
@@ -2284,7 +2287,7 @@ PHP_FUNCTION(sqlite_single_query)
|
||||
}
|
||||
|
||||
rres = (struct php_sqlite_result *)emalloc(sizeof(*rres));
|
||||
sqlite_query(NULL, db, sql, sql_len, PHPSQLITE_NUM, 0, NULL, &rres TSRMLS_CC);
|
||||
sqlite_query(NULL, db, sql, sql_len, PHPSQLITE_NUM, 0, NULL, &rres, NULL TSRMLS_CC);
|
||||
if (db->last_err_code != SQLITE_OK) {
|
||||
if (rres) {
|
||||
efree(rres);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #35248 (sqlite_query does not return parse error message)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("sqlite")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$db = sqlite_open(":memory:");
|
||||
$res = @sqlite_query($db, "asdfesdfa", SQLITE_NUM, $err);
|
||||
var_dump($err);
|
||||
$res = @sqlite_unbuffered_query($db, "asdfesdfa", SQLITE_NUM, $err);
|
||||
var_dump($err);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(30) "near "asdfesdfa": syntax error"
|
||||
string(30) "near "asdfesdfa": syntax error"
|
||||
@@ -73,17 +73,19 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t
|
||||
|
||||
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
off_t *position = (off_t*)stream->abstract;
|
||||
size_t read_bytes = 0;
|
||||
|
||||
if(!stream->eof) {
|
||||
if(SG(request_info).raw_post_data) { /* data has already been read by a post handler */
|
||||
read_bytes = SG(request_info).raw_post_data_length - stream->position;
|
||||
read_bytes = SG(request_info).raw_post_data_length - *position;
|
||||
if(read_bytes <= count) {
|
||||
stream->eof = 1;
|
||||
} else {
|
||||
read_bytes = count;
|
||||
}
|
||||
if(read_bytes) {
|
||||
memcpy(buf, SG(request_info).raw_post_data + stream->position, read_bytes);
|
||||
memcpy(buf, SG(request_info).raw_post_data + *position, read_bytes);
|
||||
}
|
||||
} else if(sapi_module.read_post) {
|
||||
read_bytes = sapi_module.read_post(buf, count TSRMLS_CC);
|
||||
@@ -96,12 +98,15 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
|
||||
}
|
||||
}
|
||||
|
||||
*position += read_bytes;
|
||||
SG(read_post_bytes) += read_bytes;
|
||||
return read_bytes;
|
||||
}
|
||||
|
||||
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC)
|
||||
{
|
||||
efree(stream->abstract);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -162,7 +167,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
|
||||
}
|
||||
|
||||
if (!strcasecmp(path, "input")) {
|
||||
return php_stream_alloc(&php_stream_input_ops, NULL, 0, "rb");
|
||||
return php_stream_alloc(&php_stream_input_ops, ecalloc(1, sizeof(off_t)), 0, "rb");
|
||||
}
|
||||
|
||||
if (!strcasecmp(path, "stdin")) {
|
||||
|
||||
+2
-2
@@ -3,5 +3,5 @@
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 1
|
||||
#define PHP_RELEASE_VERSION 0
|
||||
#define PHP_EXTRA_VERSION "RC5"
|
||||
#define PHP_VERSION "5.1.0RC5"
|
||||
#define PHP_EXTRA_VERSION "RC6"
|
||||
#define PHP_VERSION "5.1.0RC6"
|
||||
@@ -540,7 +540,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
|
||||
flags = fcntl(fd, F_GETFL, 0);
|
||||
oldval = (flags & O_NONBLOCK) ? 0 : 1;
|
||||
if (value)
|
||||
flags ^= O_NONBLOCK;
|
||||
flags &= ~O_NONBLOCK;
|
||||
else
|
||||
flags |= O_NONBLOCK;
|
||||
|
||||
|
||||
@@ -457,6 +457,7 @@ static int php_handler(request_rec *r)
|
||||
if (strcmp(r->protocol, "INCLUDED")) { \
|
||||
zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); \
|
||||
} \
|
||||
apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup); \
|
||||
|
||||
conf = ap_get_module_config(r->per_dir_config, &php5_module);
|
||||
|
||||
|
||||
+6
-7
@@ -70,11 +70,12 @@
|
||||
#include <unixlib/local.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
#include <readline/readline.h>
|
||||
#if !HAVE_LIBEDIT
|
||||
#include <readline/history.h>
|
||||
#endif
|
||||
#include "php_cli_readline.h"
|
||||
#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
|
||||
|
||||
#include "zend_compile.h"
|
||||
@@ -82,9 +83,7 @@
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_indent.h"
|
||||
|
||||
|
||||
#include "php_getopt.h"
|
||||
#include "php_cli_readline.h"
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
@@ -100,7 +99,7 @@
|
||||
|
||||
static char *php_optarg = NULL;
|
||||
static int php_optind = 1;
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
static char php_last_char = '\0';
|
||||
#endif
|
||||
|
||||
@@ -212,7 +211,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
|
||||
uint remaining = str_length;
|
||||
size_t ret;
|
||||
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
if (!str_length) {
|
||||
return 0;
|
||||
}
|
||||
@@ -390,7 +389,7 @@ static void php_cli_usage(char *argv0)
|
||||
" %s [options] -- [args...]\n"
|
||||
" %s [options] -a\n"
|
||||
"\n"
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
" -a Run as interactive shell\n"
|
||||
#else
|
||||
" -a Run interactively\n"
|
||||
@@ -977,7 +976,7 @@ int main(int argc, char *argv[])
|
||||
cli_register_file_handles(TSRMLS_C);
|
||||
}
|
||||
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
if (interactive) {
|
||||
char *line;
|
||||
size_t size = 4096, pos = 0, len;
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
|
||||
|
||||
#include "php_globals.h"
|
||||
#include "php_variables.h"
|
||||
#include "zend_hash.h"
|
||||
@@ -42,20 +45,16 @@
|
||||
#include <unixlib/local.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
#include <readline/readline.h>
|
||||
#if !HAVE_LIBEDIT
|
||||
#include <readline/history.h>
|
||||
#endif
|
||||
#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_execute.h"
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_indent.h"
|
||||
|
||||
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
|
||||
|
||||
/* {{{ cli_is_valid_code
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
Reference in new issue
Block a user