[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2008-08-29 Thread changelog
changelog   Sat Aug 30 01:31:55 2008 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.3153r2=1.3154diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.3153 php-src/ChangeLog:1.3154
--- php-src/ChangeLog:1.3153Fri Aug 29 01:31:55 2008
+++ php-src/ChangeLog   Sat Aug 30 01:31:53 2008
@@ -1,3 +1,350 @@
+2008-08-29  Henrique do Nascimento Angelo  [EMAIL PROTECTED]
+
+* ext/tidy/tidy.c:
+  Fix wrong Unicode string length (bytes) in tidy_parse_string()
+
+2008-08-29  Patrick van Kleef  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ext/odbc/php_odbc.c
+  ext/odbc/php_odbc_includes.h:
+  - MFH: Added odbc.default_cursortype to control the ODBC cursormodel
+(bug #43668)
+
+* ext/odbc/php_odbc.c
+  ext/odbc/php_odbc_includes.h:
+  - Added odbc.default_cursortype to control the ODBC cursormodel (bug
+  #43668)
+
+2008-08-29  Matt Wilmas  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ZendEngine2/zend_compile.h
+  ZendEngine2/zend_opcode.c:
+  MFH: - Updated unary_op_type typedef with TSRMLS_DC
+  - Added binary_op_type typedef
+  - Added missing ZEND_BOOL_XOR to get_binary_op()
+
+* ZendEngine2/zend_compile.h
+  ZendEngine2/zend_opcode.c:
+  - Updated unary_op_type typedef with TSRMLS_DC
+  - Added binary_op_type typedef
+  - Added missing ZEND_BOOL_XOR to get_binary_op()
+
+* (PHP_5_3)
+  ZendEngine2/zend_language_parser.y:
+  MFH: - Saved opcode when unary +/- is applied to IS_CONST op (e.g. for
+  negative numbers)
+  - Made '+' in static_scalar context behave as '-' by calling
+  add_function()
+
+* ZendEngine2/zend_language_parser.y:
+  - Saved opcode when unary +/- is applied to IS_CONST op (e.g. for 
negative
+  numbers)
+  - Made '+' in static_scalar context behave as '-' by calling
+  add_function(), so:
+  static $a = +'abc'; // 0 instead of abc
+  static $b = +array(); // Invalid operand types, like -array(),
+  instead of array()
+
+2008-08-29  Patrick van Kleef  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ext/odbc/php_odbc.c
+  ext/odbc/php_odbc.h
+  ext/odbc/php_odbc_includes.h:
+  - MFH: Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug 
#43666)
+
+* ext/odbc/php_odbc.c
+  ext/odbc/php_odbc.h
+  ext/odbc/php_odbc_includes.h:
+  - Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug #43666)
+
+2008-08-29  Felipe Pena  [EMAIL PROTECTED]
+
+* ext/standard/tests/array/array_walk_object1.phpt
+  ext/standard/tests/array/array_walk_object1.phpt
+  ext/standard/tests/array/array_walk_objects.phpt
+  ext/standard/tests/array/array_walk_objects.phpt
+  ext/standard/tests/array/array_walk_rec_objects.phpt
+  ext/standard/tests/array/array_walk_rec_objects.phpt
+  ext/standard/tests/array/array_walk_recursive_object1.phpt
+  ext/standard/tests/array/array_walk_recursive_object1.phpt:
+  - Fixed tests
+
+* ext/fileinfo/tests/finfo_open_basic.phpt
+  ext/fileinfo/tests/finfo_open_basic.phpt
+  ext/fileinfo/tests/finfo_open_variation1.phpt
+  ext/fileinfo/tests/finfo_open_variation1.phpt:
+  - Fixed tests (Disable COMPRESS support for now)
+
+* ext/fileinfo/fileinfo.c:
+  - Fixed build
+
+2008-08-29  Dmitry Stogov  [EMAIL PROTECTED]
+
+* ext/standard/tests/serialize/bug45706.phpt
+  ext/standard/tests/serialize/bug45706.phpt
+  ext/standard/tests/serialize/serialization_objects_009.phpt:
+  
+  file bug45706.phpt was initially added on branch PHP_5_3.
+
+* (PHP_5_3)
+  NEWS
+  ext/standard/var_unserializer.c
+  ext/standard/var_unserializer.c
+  ext/standard/var_unserializer.re
+  ext/standard/var_unserializer.re
+  ext/standard/tests/serialize/bug45706.phpt
+  ext/standard/tests/serialize/serialization_objects_009.phpt:
+  Fixed bug #45706 (Unserialization of classes derived from ArrayIterator
+  fails)
+
+2008-08-29  Antony Dovgal  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ext/standard/browscap.c:
+  MFH: fix get_browser() (broken in the process of param API conversion)
+
+* ext/standard/browscap.c:
+  fix get_browser() (broken in the process of param API conversion)
+
+* (PHP_5_3)
+  ext/fileinfo/fileinfo.c:
+  MFH: check for \0 to be consistent with other functions
+
+* ext/fileinfo/fileinfo.c:
+  check for \0 to be consistent with other functions
+
+2008-08-29  Derick Rethans  [EMAIL PROTECTED]
+
+* ext/fileinfo/fileinfo.c:
+  - MFB: Disable COMPRESS support for now, as it requires forking.
+
+* (PHP_5_3)
+  ext/fileinfo/fileinfo.c:
+  - Disable COMPRESS support for now, as it requires forking.
+
+* (PHP_5_3)
+  ext/fileinfo/fileinfo.c
+  ext/fileinfo/php_fileinfo.h:
+  - MFH: Adding back in mime_content_type().
+
+  

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic apprentice.c file.h print.c softmagic.c

2008-08-29 Thread Scott MacVicar
scottmacFri Aug 29 09:49:02 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  apprentice.c file.h print.c 
softmagic.c 
  Log:
  Replace ereg code with pcre, fix duplicate macro names and segfault. Patch by 
Mikko
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.7.2.1r2=1.7.2.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.1 
php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.2
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.1  Tue Aug 26 12:23:29 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Fri Aug 29 09:49:01 2008
@@ -1118,7 +1118,7 @@
 
m-mask_op = 0;
if (*l == '~') {
-   if (!IS_STRING(m-type))
+   if (!IS_LIBMAGIC_STRING(m-type))
m-mask_op |= FILE_OPINVERSE;
else if (ms-flags  MAGIC_CHECK)
file_magwarn(ms, '~' invalid for string types);
@@ -1128,7 +1128,7 @@
m-str_flags = 0;
m-num_mask = 0;
if ((op = get_op(*l)) != -1) {
-   if (!IS_STRING(m-type)) {
+   if (!IS_LIBMAGIC_STRING(m-type)) {
uint64_t val;
++l;
m-mask_op |= op;
@@ -2066,7 +2066,7 @@
m-offset = swap4((uint32_t)m-offset);
m-in_offset = swap4((uint32_t)m-in_offset);
m-lineno = swap4((uint32_t)m-lineno);
-   if (IS_STRING(m-type)) {
+   if (IS_LIBMAGIC_STRING(m-type)) {
m-str_range = swap4(m-str_range);
m-str_flags = swap4(m-str_flags);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/file.h?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/file.h
diff -u php-src/ext/fileinfo/libmagic/file.h:1.1.2.1 
php-src/ext/fileinfo/libmagic/file.h:1.1.2.2
--- php-src/ext/fileinfo/libmagic/file.h:1.1.2.1Tue Aug 26 12:23:29 2008
+++ php-src/ext/fileinfo/libmagic/file.hFri Aug 29 09:49:01 2008
@@ -46,7 +46,11 @@
 #ifdef HAVE_INTTYPES_H
 #include inttypes.h
 #endif
-#include regex.h
+
+#include php.h
+#include ext/standard/php_string.h
+#include ext/pcre/php_pcre.h
+
 #include sys/types.h
 /* Do this here and now, because struct stat gets re-defined on solaris */
 #include sys/stat.h
@@ -165,7 +169,7 @@
 #defineFILE_LEDOUBLE   38
 #defineFILE_NAMES_SIZE 39/* size of array to 
contain all names */
 
-#define IS_STRING(t) \
+#define IS_LIBMAGIC_STRING(t) \
((t) == FILE_STRING || \
 (t) == FILE_PSTRING || \
 (t) == FILE_BESTRING16 || \
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/print.c?r1=1.1r2=1.1.2.1diff_format=u
Index: php-src/ext/fileinfo/libmagic/print.c
diff -u php-src/ext/fileinfo/libmagic/print.c:1.1 
php-src/ext/fileinfo/libmagic/print.c:1.1.2.1
--- php-src/ext/fileinfo/libmagic/print.c:1.1   Fri Jul 11 14:13:50 2008
+++ php-src/ext/fileinfo/libmagic/print.c   Fri Aug 29 09:49:01 2008
@@ -74,7 +74,7 @@
if (m-mask_op  FILE_OPINVERSE)
(void) fputc('~', stderr);
 
-   if (IS_STRING(m-type)) {
+   if (IS_LIBMAGIC_STRING(m-type)) {
if (m-str_flags) {
(void) fputc('/', stderr);
if (m-str_flags  STRING_COMPACT_BLANK) 
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.1 
php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.2
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.1   Tue Aug 26 12:23:29 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 09:49:01 2008
@@ -36,6 +36,10 @@
 #include stdlib.h
 #include time.h
 
+#ifndef PREG_OFFSET_CAPTURE
+# define PREG_OFFSET_CAPTURE (18)
+#endif
+
 
 #ifndeflint
 FILE_RCSID(@(#)$File: softmagic.c,v 1.117 2008/03/01 22:21:49 rrt Exp $)
@@ -281,25 +285,18 @@
 private int
 check_fmt(struct magic_set *ms, struct magic *m)
 {
-   regex_t rx = {0};
-   int rc;
-
+   pcre *pce;
+   int re_options;
+   pcre_extra *re_extra;
+   
if (strchr(MAGIC_DESC, '%') == NULL) {
return 0;
}
-
-   rc = regcomp(rx, %[-0-9\\.]*s, REG_EXTENDED|REG_NOSUB);
-   if (rc) {
-   char errmsg[512];
-   (void)regerror(rc, rx, errmsg, sizeof(errmsg));
-   file_magerror(ms, regex error %d, (%s), rc, errmsg);
+   
+   if ((pce = pcre_get_compiled_regex(~%[-0-9.]*s~, re_extra, 
re_options TSRMLS_CC)) == NULL) {
return -1;
} else {
-   regmatch_t *pmatch = (regmatch_t *)ecalloc(sizeof(regmatch_t), 
rx.re_nsub + 1);
-   rc = regexec(rx, 

[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic apprentice.c file.h print.c softmagic.c

2008-08-29 Thread Scott MacVicar
scottmacFri Aug 29 09:50:57 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  apprentice.c file.h print.c 
softmagic.c 
  Log:
  MFB: Replace ereg code with pcre, fix duplicate macro names and segfault. 
Patch by Mikko
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.8 
php-src/ext/fileinfo/libmagic/apprentice.c:1.9
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.8  Tue Aug 26 12:24:12 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Fri Aug 29 09:50:57 2008
@@ -1118,7 +1118,7 @@
 
m-mask_op = 0;
if (*l == '~') {
-   if (!IS_STRING(m-type))
+   if (!IS_LIBMAGIC_STRING(m-type))
m-mask_op |= FILE_OPINVERSE;
else if (ms-flags  MAGIC_CHECK)
file_magwarn(ms, '~' invalid for string types);
@@ -1128,7 +1128,7 @@
m-str_flags = 0;
m-num_mask = 0;
if ((op = get_op(*l)) != -1) {
-   if (!IS_STRING(m-type)) {
+   if (!IS_LIBMAGIC_STRING(m-type)) {
uint64_t val;
++l;
m-mask_op |= op;
@@ -2066,7 +2066,7 @@
m-offset = swap4((uint32_t)m-offset);
m-in_offset = swap4((uint32_t)m-in_offset);
m-lineno = swap4((uint32_t)m-lineno);
-   if (IS_STRING(m-type)) {
+   if (IS_LIBMAGIC_STRING(m-type)) {
m-str_range = swap4(m-str_range);
m-str_flags = swap4(m-str_flags);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/file.h?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/file.h
diff -u php-src/ext/fileinfo/libmagic/file.h:1.2 
php-src/ext/fileinfo/libmagic/file.h:1.3
--- php-src/ext/fileinfo/libmagic/file.h:1.2Tue Aug 26 12:24:12 2008
+++ php-src/ext/fileinfo/libmagic/file.hFri Aug 29 09:50:57 2008
@@ -46,7 +46,11 @@
 #ifdef HAVE_INTTYPES_H
 #include inttypes.h
 #endif
-#include regex.h
+
+#include php.h
+#include ext/standard/php_string.h
+#include ext/pcre/php_pcre.h
+
 #include sys/types.h
 /* Do this here and now, because struct stat gets re-defined on solaris */
 #include sys/stat.h
@@ -165,7 +169,7 @@
 #defineFILE_LEDOUBLE   38
 #defineFILE_NAMES_SIZE 39/* size of array to 
contain all names */
 
-#define IS_STRING(t) \
+#define IS_LIBMAGIC_STRING(t) \
((t) == FILE_STRING || \
 (t) == FILE_PSTRING || \
 (t) == FILE_BESTRING16 || \
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/print.c?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/print.c
diff -u php-src/ext/fileinfo/libmagic/print.c:1.1 
php-src/ext/fileinfo/libmagic/print.c:1.2
--- php-src/ext/fileinfo/libmagic/print.c:1.1   Fri Jul 11 14:13:50 2008
+++ php-src/ext/fileinfo/libmagic/print.c   Fri Aug 29 09:50:57 2008
@@ -74,7 +74,7 @@
if (m-mask_op  FILE_OPINVERSE)
(void) fputc('~', stderr);
 
-   if (IS_STRING(m-type)) {
+   if (IS_LIBMAGIC_STRING(m-type)) {
if (m-str_flags) {
(void) fputc('/', stderr);
if (m-str_flags  STRING_COMPACT_BLANK) 
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.2 
php-src/ext/fileinfo/libmagic/softmagic.c:1.3
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.2   Tue Aug 26 12:24:12 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 09:50:57 2008
@@ -36,6 +36,10 @@
 #include stdlib.h
 #include time.h
 
+#ifndef PREG_OFFSET_CAPTURE
+# define PREG_OFFSET_CAPTURE (18)
+#endif
+
 
 #ifndeflint
 FILE_RCSID(@(#)$File: softmagic.c,v 1.117 2008/03/01 22:21:49 rrt Exp $)
@@ -281,25 +285,18 @@
 private int
 check_fmt(struct magic_set *ms, struct magic *m)
 {
-   regex_t rx = {0};
-   int rc;
-
+   pcre *pce;
+   int re_options;
+   pcre_extra *re_extra;
+   
if (strchr(MAGIC_DESC, '%') == NULL) {
return 0;
}
-
-   rc = regcomp(rx, %[-0-9\\.]*s, REG_EXTENDED|REG_NOSUB);
-   if (rc) {
-   char errmsg[512];
-   (void)regerror(rc, rx, errmsg, sizeof(errmsg));
-   file_magerror(ms, regex error %d, (%s), rc, errmsg);
+   
+   if ((pce = pcre_get_compiled_regex(~%[-0-9.]*s~, re_extra, 
re_options TSRMLS_CC)) == NULL) {
return -1;
} else {
-   regmatch_t *pmatch = (regmatch_t *)ecalloc(sizeof(regmatch_t), 
rx.re_nsub + 1);
-   rc = regexec(rx, MAGIC_DESC, rx.re_nsub + 1, pmatch, 0);
-   efree(pmatch);
-   

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/tests finfo_file_002.phpt /ext/fileinfo/tests/resources test.bmp test.gif test.jpg test.pdf test.png

2008-08-29 Thread Scott MacVicar
scottmacFri Aug 29 09:52:13 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/fileinfo/tests finfo_file_002.phpt 
/php-src/ext/fileinfo/tests/resources   test.bmp test.gif test.jpg 
test.pdf test.png 
  Log:
  Test for fileinfo to check mime types.
  

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_file_002.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_file_002.phpt
+++ php-src/ext/fileinfo/tests/finfo_file_002.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.bmp?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/resources/test.bmp
+++ php-src/ext/fileinfo/tests/resources/test.bmp



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/tests finfo_file_002.phpt /ext/fileinfo/tests/resources test.bmp test.gif test.jpg test.pdf test.png

2008-08-29 Thread Scott MacVicar
scottmacFri Aug 29 09:55:52 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/tests finfo_file_002.phpt 
/php-src/ext/fileinfo/tests/resources   test.bmp test.gif test.jpg 
test.pdf test.png 
  Log:
  MFB: Test for fileinfo to check mime types.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_file_002.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/finfo_file_002.phpt
diff -u /dev/null php-src/ext/fileinfo/tests/finfo_file_002.phpt:1.2
--- /dev/null   Fri Aug 29 09:55:52 2008
+++ php-src/ext/fileinfo/tests/finfo_file_002.phpt  Fri Aug 29 09:55:52 2008
@@ -0,0 +1,30 @@
+--TEST--
+finfo_file(): Testing mime types
+--FILE--
+?php
+
+$fp = finfo_open(FILEINFO_MIME);
+$results = array();
+
+foreach (glob(__DIR__ . /resources/*) as $filename) {
+   if (is_file($filename)) {
+   $results[$filename] = finfo_file($fp, $filename);
+   }
+}
+ksort($results);
+
+var_dump($results);
+?
+--EXPECTF--
+array(5) {
+  [%s/resources/test.bmp]=
+  string(14) image/x-ms-bmp
+  [%s/resources/test.gif]=
+  string(9) image/gif
+  [%s/resources/test.jpg]=
+  string(10) image/jpeg
+  [%s/resources/test.pdf]=
+  string(15) application/pdf
+  [%s/resources/test.png]=
+  string(9) image/png
+}
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.bmp?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/resources/test.bmp
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.gif?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/resources/test.gif
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.jpg?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/resources/test.jpg
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.pdf?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/resources/test.pdf
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/resources/test.png?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/fileinfo/tests/resources/test.png



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic softmagic.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 10:08:31 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  softmagic.c 
  Log:
  fix build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.3 
php-src/ext/fileinfo/libmagic/softmagic.c:1.4
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.3   Fri Aug 29 09:50:57 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 10:08:30 2008
@@ -1718,7 +1718,7 @@

convert_libmagic_pattern(pattern, options);
 
-   if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), 
Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
+   if ((pce = pcre_get_compiled_regex_cache(IS_STRING, 
Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
return -1;
} else {
/* pce now contains the compiled regex */
@@ -1733,7 +1733,7 @@
haystack = estrndup(ms-search.s, ms-search.s_len);
 
/* match v = 0, no match v = 1 */
-   php_pcre_match_impl(pce, haystack, ms-search.s_len, 
retval, subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
+   php_pcre_match_impl(pce, IS_STRING, haystack, 
ms-search.s_len, retval, subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);

/* Free haystack */
efree(haystack);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic softmagic.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 10:10:56 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  softmagic.c 
  Log:
  fix ZTS build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.4 
php-src/ext/fileinfo/libmagic/softmagic.c:1.5
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.4   Fri Aug 29 10:08:30 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 10:10:56 2008
@@ -288,6 +288,7 @@
pcre *pce;
int re_options;
pcre_extra *re_extra;
+   TSRMLS_FETCH();

if (strchr(MAGIC_DESC, '%') == NULL) {
return 0;
@@ -1704,6 +1705,7 @@
zval *pattern;
int options = 0;
pcre_cache_entry *pce;
+   TSRMLS_FETCH();

MAKE_STD_ZVAL(pattern);
Z_STRVAL_P(pattern) = (char *)m-value.s;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic softmagic.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 10:12:29 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  softmagic.c 
  Log:
  fix ZTS build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.2 
php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.3
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.2   Fri Aug 29 09:49:01 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 10:12:29 2008
@@ -288,6 +288,7 @@
pcre *pce;
int re_options;
pcre_extra *re_extra;
+   TSRMLS_FETCH();

if (strchr(MAGIC_DESC, '%') == NULL) {
return 0;
@@ -1704,6 +1705,7 @@
zval *pattern;
int options = 0;
pcre_cache_entry *pce;
+   TSRMLS_FETCH();

MAKE_STD_ZVAL(pattern);
Z_STRVAL_P(pattern) = (char *)m-value.s;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / run-tests.php

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:25:35 2008 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  Added %unicode_string_optional% for differences in output between PHP 5 and 6
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.374r2=1.375diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.374 php-src/run-tests.php:1.375
--- php-src/run-tests.php:1.374 Thu Aug 14 23:29:59 2008
+++ php-src/run-tests.php   Fri Aug 29 10:25:35 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.374 2008/08/14 23:29:59 jani Exp $ */
+/* $Id: run-tests.php,v 1.375 2008/08/29 10:25:35 felixdv Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -608,7 +608,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.374 $' . \n;
+   echo '$Revision: 1.375 $' . \n;
exit(1);
 
default:
@@ -1726,6 +1726,11 @@
if (isset($section_text['EXPECTF'])) {
$wanted_re = preg_quote($wanted_re, '/');
$wanted_re = str_replace(
+   array('%unicode_string_optional%'),
+   version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'Unicode string',
+   $wanted_re
+   );
+   $wanted_re = str_replace(
array('%unicode\|string%', '%string\|unicode%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'unicode',
$wanted_re



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:25:54 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  Added %unicode_string_optional% for differences in output between PHP 5 and 6
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.43r2=1.226.2.37.2.35.2.44diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.43 
php-src/run-tests.php:1.226.2.37.2.35.2.44
--- php-src/run-tests.php:1.226.2.37.2.35.2.43  Thu Aug 14 20:53:56 2008
+++ php-src/run-tests.php   Fri Aug 29 10:25:54 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.43 2008/08/14 20:53:56 jani Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.44 2008/08/29 10:25:54 felixdv Exp $ 
*/
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -608,7 +608,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.43 
$' . \n;
+   echo '$Revision: 1.226.2.37.2.35.2.44 
$' . \n;
exit(1);
 
default:
@@ -1726,6 +1726,11 @@
if (isset($section_text['EXPECTF'])) {
$wanted_re = preg_quote($wanted_re, '/');
$wanted_re = str_replace(
+   array('%unicode_string_optional%'),
+   version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'Unicode string',
+   $wanted_re
+   );
+   $wanted_re = str_replace(
array('%unicode\|string%', '%string\|unicode%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'unicode',
$wanted_re



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/tests finfo_buffer_basic.phpt finfo_buffer_error.phpt finfo_buffer_variation1.phpt finfo_close_basic.phpt finfo_file_basic.phpt finfo_open_basic.phpt finf

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:29:55 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/fileinfo/tests finfo_buffer_basic.phpt 
finfo_buffer_error.phpt 
finfo_buffer_variation1.phpt 
finfo_close_basic.phpt 
finfo_file_basic.phpt 
finfo_open_basic.phpt 
finfo_open_error.phpt 
finfo_open_variation1.phpt 
finfo_set_flags_basic.phpt magic 
  Log:
  Some fileinfo tests
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_error.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_error.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_close_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_close_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_close_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_file_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_file_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_file_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_error.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_error.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_variation1.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_variation1.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic softmagic.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 10:53:07 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  softmagic.c 
  Log:
  fix invalid read
  
  weird, the code uses correct order of checks just ten lines below
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.5 
php-src/ext/fileinfo/libmagic/softmagic.c:1.6
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.5   Fri Aug 29 10:10:56 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 10:53:07 2008
@@ -131,8 +131,8 @@
 
if ((m-flag  BINTEST) != mode) {
/* Skip sub-tests */
-   while (magic[magindex + 1].cont_level != 0  
++magindex  nmagic) {
-   continue;
+   while (magindex  nmagic - 1  magic[magindex + 
1].cont_level != 0) {
+   magindex++;
}
continue; /* Skip to next top-level test*/
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic softmagic.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 10:53:14 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  softmagic.c 
  Log:
  fix invalid read
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.3 
php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.4
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.3   Fri Aug 29 10:12:29 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Fri Aug 29 10:53:13 2008
@@ -131,8 +131,8 @@
 
if ((m-flag  BINTEST) != mode) {
/* Skip sub-tests */
-   while (magic[magindex + 1].cont_level != 0  
++magindex  nmagic) {
-   continue;
+   while (magindex  nmagic - 1  magic[magindex + 
1].cont_level != 0) {
+   magindex++;
}
continue; /* Skip to next top-level test*/
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd gd.c

2008-08-29 Thread Pierre-Alain Joye
pajoye  Fri Aug 29 11:09:05 2008 UTC

  Modified files:  
/php-src/ext/gd gd.c 
  Log:
  - fix warning
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.392r2=1.393diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.392 php-src/ext/gd/gd.c:1.393
--- php-src/ext/gd/gd.c:1.392   Sun Aug 24 04:02:20 2008
+++ php-src/ext/gd/gd.c Fri Aug 29 11:09:05 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.392 2008/08/24 04:02:20 felipe Exp $ */
+/* $Id: gd.c,v 1.393 2008/08/29 11:09:05 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -75,7 +75,7 @@
 #include gdfontl.h  /* 4 Large font */
 #include gdfontg.h  /* 5 Giant font */
 #include libgd/wbmp.h
-
+#include gdhelpers.h
 #ifdef ENABLE_GD_TTF
 # ifdef HAVE_LIBFREETYPE
 #  include ft2build.h



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/gd gd.c

2008-08-29 Thread Pierre-Alain Joye
pajoye  Fri Aug 29 11:09:28 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/gd gd.c 
  Log:
  - MFH: fix warning
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.32.2.16r2=1.312.2.20.2.32.2.17diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.32.2.16 
php-src/ext/gd/gd.c:1.312.2.20.2.32.2.17
--- php-src/ext/gd/gd.c:1.312.2.20.2.32.2.16Mon Aug  4 23:48:09 2008
+++ php-src/ext/gd/gd.c Fri Aug 29 11:09:28 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.20.2.32.2.16 2008/08/04 23:48:09 felipe Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.32.2.17 2008/08/29 11:09:28 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -43,6 +43,7 @@
 #include ext/standard/info.h
 #include php_open_temporary_file.h
 
+
 #if HAVE_SYS_WAIT_H
 # include sys/wait.h
 #endif
@@ -73,6 +74,8 @@
 #include gdfontmb.h /* 3 Medium bold font */
 #include gdfontl.h  /* 4 Large font */
 #include gdfontg.h  /* 5 Giant font */
+#include gdhelpers.h
+
 #ifdef HAVE_GD_WBMP
 #include libgd/wbmp.h
 #endif



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2008-08-29 Thread Matt Wilmas
mattwil Fri Aug 29 11:12:34 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - Be more specific about when constant substitution occurs
  - And should that be values or value? Hmm, feel free to improve wording
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.290r2=1.2027.2.547.2.965.2.291diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.290 
php-src/NEWS:1.2027.2.547.2.965.2.291
--- php-src/NEWS:1.2027.2.547.2.965.2.290   Thu Aug 28 06:22:49 2008
+++ php-src/NEWSFri Aug 29 11:12:34 2008
@@ -105,7 +105,8 @@
   . Added ability to handle exceptions in destructors. (Marcus)
 
 - Improved PHP runtime speed and memory usage:
-  . Substitute persistent constants by their values at compile time. (Matt)
+  . Substitute global-scope, persistent constants with their values at compile
+time. (Matt)
   . Optimized ZEND_SIGNED_MULTIPLY_LONG(). (Matt)
   . Removed direct executor recursion. (Dmitry)
   . Use fastcall calling convention in executor on x86. (Dmitry)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ming .cvsignore CREDITS EXPERIMENTAL config.m4 config.w32 ming.c ming.dsp php_ming.h /ext/ming/tests .cvsignore swfaction-new.phpt swfaction.phpt

2008-08-29 Thread Pierre-Alain Joye
pajoye  Fri Aug 29 11:17:13 2008 UTC

  Removed files:   
/php-src/ext/ming   .cvsignore CREDITS EXPERIMENTAL config.m4 
config.w32 ming.c ming.dsp php_ming.h 
/php-src/ext/ming/tests .cvsignore swfaction-new.phpt 
swfaction.phpt 
  Log:
  - move ming to pecl
  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/ming .cvsignore CREDITS EXPERIMENTAL config.m4 config.w32 ming.c ming.dsp php_ming.h /ext/ming/tests .cvsignore swfaction-new.phpt swfaction.phpt

2008-08-29 Thread Pierre-Alain Joye
pajoye  Fri Aug 29 11:19:37 2008 UTC

  Removed files:   (Branch: PHP_5_3)
/php-src/ext/ming   .cvsignore CREDITS EXPERIMENTAL config.m4 
config.w32 ming.c ming.dsp php_ming.h 
/php-src/ext/ming/tests .cvsignore swfaction-new.phpt 
swfaction.phpt 
  Log:
  - MFH: move ming to pecl
  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2008-08-29 Thread Pierre-Alain Joye
pajoye  Fri Aug 29 11:20:19 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - [DOC] ming has been moved to pecl
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.291r2=1.2027.2.547.2.965.2.292diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.291 
php-src/NEWS:1.2027.2.547.2.965.2.292
--- php-src/NEWS:1.2027.2.547.2.965.2.291   Fri Aug 29 11:12:34 2008
+++ php-src/NEWSFri Aug 29 11:20:18 2008
@@ -64,6 +64,7 @@
   . ext/fbsql
   . ext/fdf
   . ext/ncurses
+  . ext/ming
   . ext/sybase (not maintained anymore, sybase_ct has to be used instead)
 
 - Removed the experimental RPL (master/slave) functions from mysqli. (Andrey)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic apprentice.c file.h funcs.c magic.c print.c

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 12:05:35 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  apprentice.c file.h funcs.c magic.c 
print.c 
  Log:
  - Some more cleanups, and fixed some warnings.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.9 
php-src/ext/fileinfo/libmagic/apprentice.c:1.10
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.9  Fri Aug 29 09:50:57 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Fri Aug 29 12:05:35 2008
@@ -235,7 +235,6 @@
return rv;
}
 
-#ifndef COMPILE_ONLY
if ((rv = apprentice_map(ms, magic, nmagic, fn)) == -1) {
if (ms-flags  MAGIC_CHECK)
file_magwarn(ms, using regular magic file `%s', fn);
@@ -263,7 +262,6 @@
mlist-prev = ml;
 
return 0;
-#endif /* COMPILE_ONLY */
 }
 
 protected void
@@ -464,7 +462,7 @@
return 1;
 }
 
-private int
+private void
 set_test_type(struct magic *mstart, struct magic *m)
 {
switch (m-type) {
@@ -599,7 +597,7 @@
if (stat(fn, st) == 0  S_ISDIR(st.st_mode)) {
dir = opendir(fn);
if (dir) {
-   while (d = readdir(dir)) {
+   while ((d = readdir(dir))) {
snprintf(subfn, sizeof(subfn), %s/%s,
fn, d-d_name);
if (stat(subfn, st) == 0  
S_ISREG(st.st_mode)) {
@@ -1266,11 +1264,9 @@
if (check_format(ms, m) == -1)
return -1;
}
-#ifndef COMPILE_ONLY
if (action == FILE_CHECK) {
file_mdump(m);
}
-#endif
m-mimetype[0] = '\0';  /* initialise MIME type to none */
if (m-cont_level == 0)
++(*nmentryp);  /* make room for next */
@@ -1862,7 +1858,6 @@
fd = -1;
 
 internal_loaded:
-
*magicp = mm;
ptr = (uint32_t *)(void *)*magicp;
if (*ptr != MAGICNO) {
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/file.h?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/fileinfo/libmagic/file.h
diff -u php-src/ext/fileinfo/libmagic/file.h:1.3 
php-src/ext/fileinfo/libmagic/file.h:1.4
--- php-src/ext/fileinfo/libmagic/file.h:1.3Fri Aug 29 09:50:57 2008
+++ php-src/ext/fileinfo/libmagic/file.hFri Aug 29 12:05:35 2008
@@ -354,10 +354,8 @@
 protected int file_check_mem(struct magic_set *, unsigned int);
 protected int file_looks_utf8(const unsigned char *, size_t, unichar *, size_t 
*);
 
-#ifndef COMPILE_ONLY
 extern const char *file_names[];
 extern const size_t file_nnames;
-#endif
 
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/funcs.c?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/fileinfo/libmagic/funcs.c
diff -u php-src/ext/fileinfo/libmagic/funcs.c:1.6 
php-src/ext/fileinfo/libmagic/funcs.c:1.7
--- php-src/ext/fileinfo/libmagic/funcs.c:1.6   Wed Aug 27 00:16:11 2008
+++ php-src/ext/fileinfo/libmagic/funcs.c   Fri Aug 29 12:05:35 2008
@@ -145,7 +145,6 @@
file_error(ms, errno, error reading);
 }
 
-#ifndef COMPILE_ONLY
 protected int
 file_buffer(struct magic_set *ms, int fd, const char *inname, const void *buf,
 size_t nb)
@@ -218,7 +217,6 @@
 #endif
return m;
 }
-#endif
 
 protected int
 file_reset(struct magic_set *ms)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/magic.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/magic.c
diff -u php-src/ext/fileinfo/libmagic/magic.c:1.2 
php-src/ext/fileinfo/libmagic/magic.c:1.3
--- php-src/ext/fileinfo/libmagic/magic.c:1.2   Tue Aug 26 12:24:12 2008
+++ php-src/ext/fileinfo/libmagic/magic.c   Fri Aug 29 12:05:35 2008
@@ -82,9 +82,7 @@
 private void close_and_restore(const struct magic_set *, const char *, int,
 const struct stat *);
 private int info_from_stat(struct magic_set *, mode_t);
-#ifndef COMPILE_ONLY
 private const char *file_or_fd(struct magic_set *, const char *, int);
-#endif
 
 #ifndefSTDIN_FILENO
 #defineSTDIN_FILENO0
@@ -235,7 +233,6 @@
}
 }
 
-#ifndef COMPILE_ONLY
 
 /*
  * find type of descriptor
@@ -372,7 +369,6 @@
}
return file_getbuffer(ms);
 }
-#endif
 
 public const char *
 magic_error(struct magic_set *ms)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/print.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/print.c
diff -u php-src/ext/fileinfo/libmagic/print.c:1.2 
php-src/ext/fileinfo/libmagic/print.c:1.3
--- php-src/ext/fileinfo/libmagic/print.c:1.2   Fri Aug 29 09:50:57 2008
+++ php-src/ext/fileinfo/libmagic/print.c   Fri Aug 29 12:05:35 2008
@@ -46,7 +46,6 @@
 
 #define SZOF(a)(sizeof(a) / sizeof(a[0]))
 
-#ifndef 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic apprentice.c file.h funcs.c magic.c print.c

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 12:05:46 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  apprentice.c file.h funcs.c magic.c 
print.c 
  Log:
  - MFH: Some more cleanups, and fixed some warnings.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.7.2.2r2=1.7.2.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.2 
php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.3
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.2  Fri Aug 29 09:49:01 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Fri Aug 29 12:05:46 2008
@@ -235,7 +235,6 @@
return rv;
}
 
-#ifndef COMPILE_ONLY
if ((rv = apprentice_map(ms, magic, nmagic, fn)) == -1) {
if (ms-flags  MAGIC_CHECK)
file_magwarn(ms, using regular magic file `%s', fn);
@@ -263,7 +262,6 @@
mlist-prev = ml;
 
return 0;
-#endif /* COMPILE_ONLY */
 }
 
 protected void
@@ -464,7 +462,7 @@
return 1;
 }
 
-private int
+private void
 set_test_type(struct magic *mstart, struct magic *m)
 {
switch (m-type) {
@@ -599,7 +597,7 @@
if (stat(fn, st) == 0  S_ISDIR(st.st_mode)) {
dir = opendir(fn);
if (dir) {
-   while (d = readdir(dir)) {
+   while ((d = readdir(dir))) {
snprintf(subfn, sizeof(subfn), %s/%s,
fn, d-d_name);
if (stat(subfn, st) == 0  
S_ISREG(st.st_mode)) {
@@ -1266,11 +1264,9 @@
if (check_format(ms, m) == -1)
return -1;
}
-#ifndef COMPILE_ONLY
if (action == FILE_CHECK) {
file_mdump(m);
}
-#endif
m-mimetype[0] = '\0';  /* initialise MIME type to none */
if (m-cont_level == 0)
++(*nmentryp);  /* make room for next */
@@ -1862,7 +1858,6 @@
fd = -1;
 
 internal_loaded:
-
*magicp = mm;
ptr = (uint32_t *)(void *)*magicp;
if (*ptr != MAGICNO) {
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/file.h?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/file.h
diff -u php-src/ext/fileinfo/libmagic/file.h:1.1.2.2 
php-src/ext/fileinfo/libmagic/file.h:1.1.2.3
--- php-src/ext/fileinfo/libmagic/file.h:1.1.2.2Fri Aug 29 09:49:01 2008
+++ php-src/ext/fileinfo/libmagic/file.hFri Aug 29 12:05:46 2008
@@ -354,10 +354,8 @@
 protected int file_check_mem(struct magic_set *, unsigned int);
 protected int file_looks_utf8(const unsigned char *, size_t, unichar *, size_t 
*);
 
-#ifndef COMPILE_ONLY
 extern const char *file_names[];
 extern const size_t file_nnames;
-#endif
 
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/funcs.c?r1=1.3.2.3r2=1.3.2.4diff_format=u
Index: php-src/ext/fileinfo/libmagic/funcs.c
diff -u php-src/ext/fileinfo/libmagic/funcs.c:1.3.2.3 
php-src/ext/fileinfo/libmagic/funcs.c:1.3.2.4
--- php-src/ext/fileinfo/libmagic/funcs.c:1.3.2.3   Wed Aug 27 00:17:27 2008
+++ php-src/ext/fileinfo/libmagic/funcs.c   Fri Aug 29 12:05:46 2008
@@ -145,7 +145,6 @@
file_error(ms, errno, error reading);
 }
 
-#ifndef COMPILE_ONLY
 protected int
 file_buffer(struct magic_set *ms, int fd, const char *inname, const void *buf,
 size_t nb)
@@ -218,7 +217,6 @@
 #endif
return m;
 }
-#endif
 
 protected int
 file_reset(struct magic_set *ms)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/magic.c?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/magic.c
diff -u php-src/ext/fileinfo/libmagic/magic.c:1.1.2.1 
php-src/ext/fileinfo/libmagic/magic.c:1.1.2.2
--- php-src/ext/fileinfo/libmagic/magic.c:1.1.2.1   Tue Aug 26 12:23:29 2008
+++ php-src/ext/fileinfo/libmagic/magic.c   Fri Aug 29 12:05:46 2008
@@ -82,9 +82,7 @@
 private void close_and_restore(const struct magic_set *, const char *, int,
 const struct stat *);
 private int info_from_stat(struct magic_set *, mode_t);
-#ifndef COMPILE_ONLY
 private const char *file_or_fd(struct magic_set *, const char *, int);
-#endif
 
 #ifndefSTDIN_FILENO
 #defineSTDIN_FILENO0
@@ -235,7 +233,6 @@
}
 }
 
-#ifndef COMPILE_ONLY
 
 /*
  * find type of descriptor
@@ -372,7 +369,6 @@
}
return file_getbuffer(ms);
 }
-#endif
 
 public const char *
 magic_error(struct magic_set *ms)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/print.c?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/libmagic/print.c
diff -u php-src/ext/fileinfo/libmagic/print.c:1.1.2.1 
php-src/ext/fileinfo/libmagic/print.c:1.1.2.2
--- php-src/ext/fileinfo/libmagic/print.c:1.1.2.1   Fri Aug 29 09:49:01 2008
+++ 

[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests preg_filter.phpt

2008-08-29 Thread Marcus Boerger
helly   Fri Aug 29 12:13:55 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/pcre/tests preg_filter.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/pcre   php_pcre.c 
  Log:
  - MFH preg_filter()
  # As discussed with Lukas
  # [DOC] check out the test
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.293r2=1.2027.2.547.2.965.2.294diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.293 
php-src/NEWS:1.2027.2.547.2.965.2.294
--- php-src/NEWS:1.2027.2.547.2.965.2.293   Fri Aug 29 12:01:32 2008
+++ php-src/NEWSFri Aug 29 12:13:54 2008
@@ -8,6 +8,7 @@
   accessibility (like method_exists()). (Felipe)
 - Changed array_reduce() to allow mixed $initial (Christian Seiler)
 
+- Added function preg_filter() that does grep and replace in one go. (Marcus)
 - Added system independent realpath() implementation which caches intermediate
   directories in realpath-cache. (Dmitry)
 - Added optional clear_realpath_cache and filename parameters to
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.21r2=1.168.2.9.2.21.2.22diff_format=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.21 
php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.22
--- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.21 Thu Aug 14 14:37:39 2008
+++ php-src/ext/pcre/php_pcre.c Fri Aug 29 12:13:54 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.21 2008/08/14 14:37:39 nlopess Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.22 2008/08/29 12:13:54 helly Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1196,7 +1196,7 @@
 
 /* {{{ php_replace_in_subject
  */
-static char *php_replace_in_subject(zval *regex, zval *replace, zval 
**subject, int *result_len, int limit, zend_bool is_callable_replace, int 
*replace_count TSRMLS_DC)
+static char *php_replace_in_subject(zval *regex, zval *replace, zval 
**subject, int *result_len, int limit, int is_callable_replace, int 
*replace_count TSRMLS_DC)
 {
zval**regex_entry,
**replace_entry = NULL,
@@ -1284,7 +1284,7 @@
 
 /* {{{ preg_replace_impl
  */
-static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool 
is_callable_replace)
+static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int 
is_callable_replace, int is_filter)
 {
zval   **regex,
   **replace,
@@ -1298,8 +1298,7 @@
char*string_key;
ulongnum_key;
char*callback_name;
-   int  replace_count=0;
-   int *replace_count_ptr=NULL; 
+   int  replace_count=0, old_replace_count;

/* Get function parameters and do error-checking. */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZZZ|lZ, regex, 
replace, subject, limit, zcount) == FAILURE) {
@@ -1312,8 +1311,9 @@
}
 
SEPARATE_ZVAL(replace);
-   if (Z_TYPE_PP(replace) != IS_ARRAY  (Z_TYPE_PP(replace) != IS_OBJECT 
|| !is_callable_replace))
+   if (Z_TYPE_PP(replace) != IS_ARRAY  (Z_TYPE_PP(replace) != IS_OBJECT 
|| !is_callable_replace)) {
convert_to_string_ex(replace);
+   }
if (is_callable_replace) {
if (!zend_is_callable(*replace, 0, callback_name TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Requires 
argument 2, '%s', to be a valid callback, callback_name);
@@ -1332,9 +1332,6 @@
if (ZEND_NUM_ARGS()  3) {
limit_val = limit;
}
-   if (ZEND_NUM_ARGS()  4) {
-   replace_count_ptr = replace_count;
-   }

if (Z_TYPE_PP(regex) != IS_ARRAY)
convert_to_string_ex(regex);
@@ -1348,10 +1345,12 @@
   and add the result to the return_value array. */
while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void 
**)subject_entry) == SUCCESS) {
SEPARATE_ZVAL(subject_entry);
-   if ((result = php_replace_in_subject(*regex, *replace, 
subject_entry, result_len, limit_val, is_callable_replace, replace_count_ptr 
TSRMLS_CC)) != NULL) {
-   /* Add to return array */
-   
switch(zend_hash_get_current_key(Z_ARRVAL_PP(subject), string_key, num_key, 
0))
-   {
+   old_replace_count = replace_count;
+   if ((result = php_replace_in_subject(*regex, *replace, 
subject_entry, result_len, limit_val, is_callable_replace, replace_count 
TSRMLS_CC)) != NULL) {
+   if (!is_filter || replace_count  
old_replace_count) {
+

[PHP-CVS] cvs: php-src /ext/fileinfo fileinfo.c php_fileinfo.h

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:29:18 2008 UTC

  Modified files:  
/php-src/ext/fileinfo   fileinfo.c php_fileinfo.h 
  Log:
  - Adding back in mime_content_type().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.27r2=1.28diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.27 
php-src/ext/fileinfo/fileinfo.c:1.28
--- php-src/ext/fileinfo/fileinfo.c:1.27Wed Aug 27 07:40:59 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:29:18 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.27 2008/08/27 07:40:59 tony2001 Exp $ */
+/* $Id: fileinfo.c,v 1.28 2008/08/29 13:29:18 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -166,6 +166,11 @@
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, context)
 ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mime_content_type, 0, 0, 1)
+   ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
 /* }}} */
 
 /* {{{ finfo_class_functions
@@ -229,6 +234,7 @@
PHP_FE(finfo_set_flags, arginfo_finfo_set_flags)
PHP_FE(finfo_file,  arginfo_finfo_file)
PHP_FE(finfo_buffer,arginfo_finfo_buffer)
+   PHP_FE(mime_content_type, arginfo_mime_content_type)
{NULL, NULL, NULL}
 };
 /* }}} */
@@ -450,7 +456,10 @@
char resolved_path[MAXPATHLEN];
 
if (*buffer  VCWD_REALPATH(buffer, resolved_path)) {
-   ret_val = (char *) magic_file(finfo-magic, 
buffer);
+   if (php_check_open_basedir(resolved_path 
TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+   ret_val = (char *) magic_file(finfo-magic, 
resolved_path);
} else {
RETURN_FALSE;
}
@@ -496,6 +505,98 @@
 }
 /* }}} */
 
+/* {{{ proto string mime_content_type(string filename|resource stream)
+   Return content-type for file */
+PHP_FUNCTION(mime_content_type)
+{
+   zval *what;
+   magic_t magic;
+   char *tmp, *ret_val;
+   int buffer_len;
+   char *tmp2;
+   php_stream_wrapper *wrap; 
+   zval *zcontext = NULL;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, what) == 
FAILURE) {
+   return;
+   }
+
+   RETVAL_FALSE;
+
+   magic = magic_open(MAGIC_MIME);
+   if (magic_load(magic, NULL) == -1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to load 
magic database.);
+   goto cleanup;
+   }
+
+   switch (Z_TYPE_P(what)) {
+   case IS_STRING:
+   wrap = php_stream_locate_url_wrapper(Z_STRVAL_P(what), 
tmp2, 0 TSRMLS_CC);
+   /* determine if the file is a local file or remote URL 
*/
+   if (wrap  wrap-is_url) {
+   php_stream_context *context = 
php_stream_context_from_zval(zcontext, 0);
+   php_stream *stream = 
php_stream_open_wrapper_ex(Z_STRVAL_P(what), rb, 
+   ENFORCE_SAFE_MODE | 
REPORT_ERRORS, NULL, context);
+   if (!stream) {
+   goto cleanup;
+   }
+   buffer_len = php_stream_copy_to_mem(stream, 
tmp, 4096, 0);
+   php_stream_close(stream);
+
+   if (buffer_len == 0) {
+   goto cleanup;
+   }
+   ret_val = (char *) magic_buffer(magic, tmp, 
buffer_len);
+   } else { /* local file */
+   char resolved_path[MAXPATHLEN];
+
+   if (Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
+   if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
+   goto cleanup;
+   }
+   ret_val = (char *) magic_file(magic, 
resolved_path);
+   } else {
+   goto cleanup;
+   }
+   }
+   break;
+   case IS_RESOURCE:
+   {
+   php_stream *stream;
+   off_t streampos;
+
+   php_stream_from_zval_no_verify(stream, what);
+   if (!stream) {
+   goto cleanup;
+ 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mime_magic .cvsignore CREDITS DEPRECATED EXPERIMENTAL config.m4 config.w32 mime_magic.c mime_magic.dsp package.xml php_mime_magic.h phpmimemagic.h

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:31:45 2008 UTC

  Removed files:   (Branch: PHP_5_3)
/php-src/ext/mime_magic .cvsignore CREDITS DEPRECATED EXPERIMENTAL 
config.m4 config.w32 mime_magic.c 
mime_magic.dsp package.xml php_mime_magic.h 
phpmimemagic.h 
  Log:
  - Remove ext/mime_magic, it was deprecated and it's only function is now part 
of
ext/fileinfo.
  
  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: CVSROOT / avail

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:36:12 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - Give Ross phpdoc and GD karma
  - Give Patrick ext/odbc karma
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1439r2=1.1440diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1439 CVSROOT/avail:1.1440
--- CVSROOT/avail:1.1439Tue Aug 26 20:55:38 2008
+++ CVSROOT/avail   Fri Aug 29 13:36:11 2008
@@ -296,6 +296,8 @@
 avail|txforward|pecl/txforward
 avail|smantoor|php-src/ext/standard
 avail|guilhermeblanco|phpweb
+avail|iodbc|ext/odbc
+avail|ross|phpdoc,gd
 
 # Objective-C bridge
 avail|wez,jan|php-objc



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo fileinfo.c

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:39:01 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo   fileinfo.c 
  Log:
  - Disable COMPRESS support for now, as it requires forking.
  # @DOC [DOC] DOC
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.20.2.7r2=1.20.2.8diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.20.2.7 
php-src/ext/fileinfo/fileinfo.c:1.20.2.8
--- php-src/ext/fileinfo/fileinfo.c:1.20.2.7Fri Aug 29 13:29:42 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:39:01 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.20.2.7 2008/08/29 13:29:42 derick Exp $ */
+/* $Id: fileinfo.c,v 1.20.2.8 2008/08/29 13:39:01 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -258,7 +258,7 @@
REGISTER_LONG_CONSTANT(FILEINFO_NONE, MAGIC_NONE, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_SYMLINK,  MAGIC_SYMLINK, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_MIME, MAGIC_MIME, 
CONST_CS|CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(FILEINFO_COMPRESS, MAGIC_COMPRESS, 
CONST_CS|CONST_PERSISTENT);
+/* REGISTER_LONG_CONSTANT(FILEINFO_COMPRESS, MAGIC_COMPRESS, 
CONST_CS|CONST_PERSISTENT); disabled, as it does fork now */
REGISTER_LONG_CONSTANT(FILEINFO_DEVICES,  MAGIC_DEVICES, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_CONTINUE, MAGIC_CONTINUE, 
CONST_CS|CONST_PERSISTENT);
 #ifdef MAGIC_PRESERVE_ATIME



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo fileinfo.c

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:39:17 2008 UTC

  Modified files:  
/php-src/ext/fileinfo   fileinfo.c 
  Log:
  - MFB: Disable COMPRESS support for now, as it requires forking.
  # @DOC [DOC] DOC
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.28r2=1.29diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.28 
php-src/ext/fileinfo/fileinfo.c:1.29
--- php-src/ext/fileinfo/fileinfo.c:1.28Fri Aug 29 13:29:18 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:39:17 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.28 2008/08/29 13:29:18 derick Exp $ */
+/* $Id: fileinfo.c,v 1.29 2008/08/29 13:39:17 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -258,7 +258,7 @@
REGISTER_LONG_CONSTANT(FILEINFO_NONE, MAGIC_NONE, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_SYMLINK,  MAGIC_SYMLINK, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_MIME, MAGIC_MIME, 
CONST_CS|CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(FILEINFO_COMPRESS, MAGIC_COMPRESS, 
CONST_CS|CONST_PERSISTENT);
+/* REGISTER_LONG_CONSTANT(FILEINFO_COMPRESS, MAGIC_COMPRESS, 
CONST_CS|CONST_PERSISTENT); disabled, as it does fork now */
REGISTER_LONG_CONSTANT(FILEINFO_DEVICES,  MAGIC_DEVICES, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(FILEINFO_CONTINUE, MAGIC_CONTINUE, 
CONST_CS|CONST_PERSISTENT);
 #ifdef MAGIC_PRESERVE_ATIME



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo fileinfo.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 13:48:26 2008 UTC

  Modified files:  
/php-src/ext/fileinfo   fileinfo.c 
  Log:
  check for \0 to be consistent with other functions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.29r2=1.30diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.29 
php-src/ext/fileinfo/fileinfo.c:1.30
--- php-src/ext/fileinfo/fileinfo.c:1.29Fri Aug 29 13:39:17 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:48:26 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.29 2008/08/29 13:39:17 derick Exp $ */
+/* $Id: fileinfo.c,v 1.30 2008/08/29 13:48:26 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -550,7 +550,7 @@
} else { /* local file */
char resolved_path[MAXPATHLEN];
 
-   if (Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
+   if (*Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
goto cleanup;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo fileinfo.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 13:48:39 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo   fileinfo.c 
  Log:
  MFH: check for \0 to be consistent with other functions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.20.2.8r2=1.20.2.9diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.20.2.8 
php-src/ext/fileinfo/fileinfo.c:1.20.2.9
--- php-src/ext/fileinfo/fileinfo.c:1.20.2.8Fri Aug 29 13:39:01 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:48:38 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.20.2.8 2008/08/29 13:39:01 derick Exp $ */
+/* $Id: fileinfo.c,v 1.20.2.9 2008/08/29 13:48:38 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -550,7 +550,7 @@
} else { /* local file */
char resolved_path[MAXPATHLEN];
 
-   if (Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
+   if (*Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
goto cleanup;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mime_magic .cvsignore CREDITS DEPRECATED EXPERIMENTAL TODO config.m4 config.w32 mime_magic.c mime_magic.dsp package.xml php_mime_magic.h phpmimemagic.h

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:32:38 2008 UTC

  Removed files:   
/php-src/ext/mime_magic .cvsignore CREDITS DEPRECATED EXPERIMENTAL 
TODO config.m4 config.w32 mime_magic.c 
mime_magic.dsp package.xml php_mime_magic.h 
phpmimemagic.h 
  Log:
  - MFB: Remove ext/mime_magic, it was deprecated and it's only function is now
part of ext/fileinfo.
  
  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo fileinfo.c php_fileinfo.h

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 13:29:42 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo   fileinfo.c php_fileinfo.h 
  Log:
  - MFH: Adding back in mime_content_type().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.20.2.6r2=1.20.2.7diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.20.2.6 
php-src/ext/fileinfo/fileinfo.c:1.20.2.7
--- php-src/ext/fileinfo/fileinfo.c:1.20.2.6Wed Aug 27 07:40:44 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 13:29:42 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.20.2.6 2008/08/27 07:40:44 tony2001 Exp $ */
+/* $Id: fileinfo.c,v 1.20.2.7 2008/08/29 13:29:42 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -166,6 +166,11 @@
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, context)
 ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mime_content_type, 0, 0, 1)
+   ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
 /* }}} */
 
 /* {{{ finfo_class_functions
@@ -229,6 +234,7 @@
PHP_FE(finfo_set_flags, arginfo_finfo_set_flags)
PHP_FE(finfo_file,  arginfo_finfo_file)
PHP_FE(finfo_buffer,arginfo_finfo_buffer)
+   PHP_FE(mime_content_type, arginfo_mime_content_type)
{NULL, NULL, NULL}
 };
 /* }}} */
@@ -450,7 +456,10 @@
char resolved_path[MAXPATHLEN];
 
if (*buffer  VCWD_REALPATH(buffer, resolved_path)) {
-   ret_val = (char *) magic_file(finfo-magic, 
buffer);
+   if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+   ret_val = (char *) magic_file(finfo-magic, 
resolved_path);
} else {
RETURN_FALSE;
}
@@ -496,6 +505,98 @@
 }
 /* }}} */
 
+/* {{{ proto string mime_content_type(string filename|resource stream)
+   Return content-type for file */
+PHP_FUNCTION(mime_content_type)
+{
+   zval *what;
+   magic_t magic;
+   char *tmp, *ret_val;
+   int buffer_len;
+   char *tmp2;
+   php_stream_wrapper *wrap; 
+   zval *zcontext = NULL;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, what) == 
FAILURE) {
+   return;
+   }
+
+   RETVAL_FALSE;
+
+   magic = magic_open(MAGIC_MIME);
+   if (magic_load(magic, NULL) == -1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to load 
magic database.);
+   goto cleanup;
+   }
+
+   switch (Z_TYPE_P(what)) {
+   case IS_STRING:
+   wrap = php_stream_locate_url_wrapper(Z_STRVAL_P(what), 
tmp2, 0 TSRMLS_CC);
+   /* determine if the file is a local file or remote URL 
*/
+   if (wrap  wrap-is_url) {
+   php_stream_context *context = 
php_stream_context_from_zval(zcontext, 0);
+   php_stream *stream = 
php_stream_open_wrapper_ex(Z_STRVAL_P(what), rb, 
+   ENFORCE_SAFE_MODE | 
REPORT_ERRORS, NULL, context);
+   if (!stream) {
+   goto cleanup;
+   }
+   buffer_len = php_stream_copy_to_mem(stream, 
tmp, 4096, 0);
+   php_stream_close(stream);
+
+   if (buffer_len == 0) {
+   goto cleanup;
+   }
+   ret_val = (char *) magic_buffer(magic, tmp, 
buffer_len);
+   } else { /* local file */
+   char resolved_path[MAXPATHLEN];
+
+   if (Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
+   if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
+   goto cleanup;
+   }
+   ret_val = (char *) magic_file(magic, 
resolved_path);
+   } else {
+   goto cleanup;
+   }
+   }
+   break;
+   case IS_RESOURCE:
+   {
+   php_stream *stream;
+   off_t streampos;
+
+   

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/array array_walk_object1.phpt array_walk_objects.phpt array_walk_rec_objects.phpt array_walk_recursive_object1.phpt

2008-08-29 Thread Felipe Pena
felipe  Fri Aug 29 14:10:38 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/array   array_walk_object1.phpt 
array_walk_objects.phpt 
array_walk_rec_objects.phpt 
array_walk_recursive_object1.phpt 
  Log:
  - Fixed tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_object1.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_object1.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_objects.phpt?r1=1.1.2.3r2=1.1.2.3.2.1diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_objects.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_rec_objects.phpt?r1=1.1.2.3r2=1.1.2.3.2.1diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_rec_objects.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_recursive_object1.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_recursive_object1.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard browscap.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 14:13:57 2008 UTC

  Modified files:  
/php-src/ext/standard   browscap.c 
  Log:
  fix get_browser() (broken in the process of param API conversion)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.101r2=1.102diff_format=u
Index: php-src/ext/standard/browscap.c
diff -u php-src/ext/standard/browscap.c:1.101 
php-src/ext/standard/browscap.c:1.102
--- php-src/ext/standard/browscap.c:1.101   Tue Aug 19 15:16:23 2008
+++ php-src/ext/standard/browscap.c Fri Aug 29 14:13:57 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: browscap.c,v 1.101 2008/08/19 15:16:23 tony2001 Exp $ */
+/* $Id: browscap.c,v 1.102 2008/08/29 14:13:57 tony2001 Exp $ */
 
 #include php.h
 #include php_browscap.h
@@ -328,7 +328,7 @@
char *agent_name = NULL;
int agent_name_len;
zend_bool return_array = 0;
-   zval **agent;
+   zval **agent, **z_agent_name;
zval *found_browser_entry, *tmp_copy;
char *lookup_browser_name;
char *browscap = INI_STR(browscap);
@@ -375,8 +375,8 @@
zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), 
(copy_ctor_func_t) zval_add_ref, (void *) tmp_copy, sizeof(zval *));
}
 
-   while (zend_hash_find(Z_ARRVAL_PP(agent), parent, sizeof(parent), 
(void **) agent_name) == SUCCESS) {
-   if (zend_hash_find(browser_hash, agent_name, agent_name_len + 
1, (void **)agent) == FAILURE) {
+   while (zend_hash_find(Z_ARRVAL_PP(agent), parent, sizeof(parent), 
(void **) z_agent_name) == SUCCESS) {
+   if (zend_hash_find(browser_hash, Z_STRVAL_PP(z_agent_name), 
Z_STRLEN_PP(z_agent_name) + 1, (void **)agent) == FAILURE) {
break;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard browscap.c

2008-08-29 Thread Antony Dovgal
tony2001Fri Aug 29 14:14:09 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   browscap.c 
  Log:
  MFH: fix get_browser() (broken in the process of param API conversion)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.85.2.2.2.3.2.8r2=1.85.2.2.2.3.2.9diff_format=u
Index: php-src/ext/standard/browscap.c
diff -u php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.8 
php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.9
--- php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.8Tue Aug 19 15:16:33 2008
+++ php-src/ext/standard/browscap.c Fri Aug 29 14:14:09 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: browscap.c,v 1.85.2.2.2.3.2.8 2008/08/19 15:16:33 tony2001 Exp $ */
+/* $Id: browscap.c,v 1.85.2.2.2.3.2.9 2008/08/29 14:14:09 tony2001 Exp $ */
 
 #include php.h
 #include php_browscap.h
@@ -328,7 +328,7 @@
char *agent_name = NULL;
int agent_name_len;
zend_bool return_array = 0;
-   zval **agent;
+   zval **agent, **z_agent_name;
zval *found_browser_entry, *tmp_copy;
char *lookup_browser_name;
char *browscap = INI_STR(browscap);
@@ -375,8 +375,8 @@
zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), 
(copy_ctor_func_t) zval_add_ref, (void *) tmp_copy, sizeof(zval *));
}
 
-   while (zend_hash_find(Z_ARRVAL_PP(agent), parent, sizeof(parent), 
(void **) agent_name) == SUCCESS) {
-   if (zend_hash_find(browser_hash, agent_name, agent_name_len + 
1, (void **)agent) == FAILURE) {
+   while (zend_hash_find(Z_ARRVAL_PP(agent), parent, sizeof(parent), 
(void **) z_agent_name) == SUCCESS) {
+   if (zend_hash_find(browser_hash, Z_STRVAL_PP(z_agent_name), 
Z_STRLEN_PP(z_agent_name) + 1, (void **)agent) == FAILURE) {
break;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug45706.phpt serialization_objects_009.phpt

2008-08-29 Thread Dmitry Stogov
dmitry  Fri Aug 29 14:59:20 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/serialize   bug45706.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   
serialization_objects_009.phpt 
  Log:
  Fixed bug #45706 (Unserialization of classes derived from ArrayIterator fails)
  
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.294r2=1.2027.2.547.2.965.2.295diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.294 
php-src/NEWS:1.2027.2.547.2.965.2.295
--- php-src/NEWS:1.2027.2.547.2.965.2.294   Fri Aug 29 12:13:54 2008
+++ php-src/NEWSFri Aug 29 14:59:19 2008
@@ -36,6 +36,8 @@
   child class). (Felipe)
 - Fixed bug #45717 (Fileinfo/libmagic build fails, missing err.h and getopt.h).
   (Derick)
+- Fixed bug #45706 (Unserialization of classes derived from ArrayIterator
+  fails). (Etienne, Dmitry)
 - Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick)
 - Fixed bug #45636 (fileinfo ext duplicate strndup). (Derick)
 - Fixed bug #45545 (DateInterval has 4 char limitation for ISO durations).
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.7.2.6r2=1.70.2.4.2.7.2.7diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.6 
php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.7
--- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.6Tue May 27 
11:28:18 2008
+++ php-src/ext/standard/var_unserializer.c Fri Aug 29 14:59:20 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue May 27 06:20:00 2008 */
+/* Generated by re2c 0.13.5 on Fri Aug 29 18:39:52 2008 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.6 2008/05/27 11:28:18 mattwil Exp 
$ */
+/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.7 2008/08/29 14:59:20 dmitry Exp $ 
*/
 
 #include php.h
 #include ext/standard/php_var.h
@@ -324,11 +324,6 @@
 {
long datalen;
 
-   if (ce-unserialize == NULL) {
-   zend_error(E_WARNING, Class %s has no unserializer, ce-name);
-   return 0;
-   }
-
datalen = parse_iv2((*p) + 2, p);
 
(*p) += 2;
@@ -338,7 +333,10 @@
return 0;
}
 
-   if (ce-unserialize(rval, ce, (const unsigned char*)*p, datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+   if (ce-unserialize == NULL) {
+   zend_error(E_WARNING, Class %s has no unserializer, ce-name);
+   object_init_ex(*rval, ce);
+   } else if (ce-unserialize(rval, ce, (const unsigned char*)*p, datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
return 0;
}
 
@@ -398,7 +396,7 @@


 
-#line 402 ext/standard/var_unserializer.c
+#line 400 ext/standard/var_unserializer.c
 {
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -458,9 +456,9 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
 yy3:
-#line 696 ext/standard/var_unserializer.re
+#line 699 ext/standard/var_unserializer.re
{ return 0; }
-#line 464 ext/standard/var_unserializer.c
+#line 462 ext/standard/var_unserializer.c
 yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -503,13 +501,13 @@
goto yy3;
 yy14:
++YYCURSOR;
-#line 690 ext/standard/var_unserializer.re
+#line 693 ext/standard/var_unserializer.re
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of 
serialized data);
return 0; /* not sure if it should be 0 or 1 here? */
 }
-#line 513 ext/standard/var_unserializer.c
+#line 511 ext/standard/var_unserializer.c
 yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -539,7 +537,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy18;
++YYCURSOR;
-#line 578 ext/standard/var_unserializer.re
+#line 576 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -638,8 +636,13 @@
*p = YYCURSOR;
 
if (custom_object) {
+   int ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
+
+   if (ret  incomplete_class) {
+   php_store_class_name(*rval, class_name, len2);
+   }
efree(class_name);
-   return object_custom(UNSERIALIZE_PASSTHRU, ce);
+   return ret;
}

elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
@@ -651,7 +654,7 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug45706.phpt serialization_objects_009.phpt

2008-08-29 Thread Dmitry Stogov
dmitry  Fri Aug 29 14:59:41 2008 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   bug45706.phpt 
serialization_objects_009.phpt 
  Log:
  Fixed bug #45706 (Unserialization of classes derived from ArrayIterator fails)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.95r2=1.96diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.95 
php-src/ext/standard/var_unserializer.c:1.96
--- php-src/ext/standard/var_unserializer.c:1.95Tue May 27 11:27:58 2008
+++ php-src/ext/standard/var_unserializer.c Fri Aug 29 14:59:41 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue May 27 06:15:01 2008 */
+/* Generated by re2c 0.13.5 on Fri Aug 29 18:45:19 2008 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.95 2008/05/27 11:27:58 mattwil Exp $ */
+/* $Id: var_unserializer.c,v 1.96 2008/08/29 14:59:41 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -363,11 +363,6 @@
zstr buf;
size_t buf_len;
 
-   if (ce-unserialize == NULL) {
-   zend_error(E_WARNING, Class %v has no unserializer, ce-name);
-   return 0;
-   }
-
datalen = parse_iv2((*p) + 2, p);
 
switch((*p)[1]) {
@@ -400,7 +395,10 @@
buf_len = datalen;
(*p) += datalen;
}
-   if (ce-unserialize(rval, ce, type, buf, buf_len, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+   if (ce-unserialize == NULL) {
+   zend_error(E_WARNING, Class %v has no unserializer, ce-name);
+   object_init_ex(*rval, ce);
+   } else if (ce-unserialize(rval, ce, type, buf, buf_len, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
if (type == IS_UNICODE) {
efree(buf.v);
}
@@ -463,7 +461,7 @@
start = cursor;
 
 
-#line 467 ext/standard/var_unserializer.c
+#line 465 ext/standard/var_unserializer.c
 {
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -524,9 +522,9 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy103;
 yy3:
-#line 791 ext/standard/var_unserializer.re
+#line 794 ext/standard/var_unserializer.re
{ return 0; }
-#line 530 ext/standard/var_unserializer.c
+#line 528 ext/standard/var_unserializer.c
 yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy97;
@@ -573,13 +571,13 @@
goto yy3;
 yy15:
++YYCURSOR;
-#line 785 ext/standard/var_unserializer.re
+#line 788 ext/standard/var_unserializer.re
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of 
serialized data);
return 0; /* not sure if it should be 0 or 1 here? */
 }
-#line 583 ext/standard/var_unserializer.c
+#line 581 ext/standard/var_unserializer.c
 yy17:
yych = *++YYCURSOR;
goto yy3;
@@ -609,7 +607,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 672 ext/standard/var_unserializer.re
+#line 670 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -709,8 +707,13 @@
*p = YYCURSOR;
 
if (custom_object) {
+   int ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
+
+   if (ret  incomplete_class) {
+   php_store_class_name(*rval, class_name, len2);
+   }
efree(class_name.v);
-   return object_custom(UNSERIALIZE_PASSTHRU, ce);
+   return ret;
}
 
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
@@ -722,7 +725,7 @@
 
return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
-#line 726 ext/standard/var_unserializer.c
+#line 729 ext/standard/var_unserializer.c
 yy26:
yych = *++YYCURSOR;
if (yych = ',') {
@@ -747,7 +750,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 664 ext/standard/var_unserializer.re
+#line 662 ext/standard/var_unserializer.re
{
 
INIT_PZVAL(*rval);
@@ -755,7 +758,7 @@
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
-#line 759 ext/standard/var_unserializer.c
+#line 762 ext/standard/var_unserializer.c
 yy33:
yych = *++YYCURSOR;
if (yych == '+') goto yy34;
@@ -776,7 +779,7 @@
yych = *++YYCURSOR;
if (yych != '{') goto yy19;
++YYCURSOR;
-#line 644 

[PHP-CVS] cvs: php-src /ext/fileinfo fileinfo.c

2008-08-29 Thread Felipe Pena
felipe  Fri Aug 29 15:17:26 2008 UTC

  Modified files:  
/php-src/ext/fileinfo   fileinfo.c 
  Log:
  - Fixed build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.30r2=1.31diff_format=u
Index: php-src/ext/fileinfo/fileinfo.c
diff -u php-src/ext/fileinfo/fileinfo.c:1.30 
php-src/ext/fileinfo/fileinfo.c:1.31
--- php-src/ext/fileinfo/fileinfo.c:1.30Fri Aug 29 13:48:26 2008
+++ php-src/ext/fileinfo/fileinfo.c Fri Aug 29 15:17:25 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: fileinfo.c,v 1.30 2008/08/29 13:48:26 tony2001 Exp $ */
+/* $Id: fileinfo.c,v 1.31 2008/08/29 15:17:25 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -551,7 +551,7 @@
char resolved_path[MAXPATHLEN];
 
if (*Z_STRVAL_P(what)  
VCWD_REALPATH(Z_STRVAL_P(what), resolved_path)) {
-   if ((PG(safe_mode)  
(!php_checkuid(resolved_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || 
php_check_open_basedir(resolved_path TSRMLS_CC)) {
+   if 
(php_check_open_basedir(resolved_path TSRMLS_CC)) {
goto cleanup;
}
ret_val = (char *) magic_file(magic, 
resolved_path);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/tests finfo_open_basic.phpt finfo_open_variation1.phpt

2008-08-29 Thread Felipe Pena
felipe  Fri Aug 29 15:28:45 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/tests finfo_open_basic.phpt 
finfo_open_variation1.phpt 
  Log:
  - Fixed tests (Disable COMPRESS support for now)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_basic.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/tests/finfo_open_basic.phpt
diff -u php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.1.2.1 
php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.1.2.2
--- php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.1.2.1Fri Aug 29 
10:29:55 2008
+++ php-src/ext/fileinfo/tests/finfo_open_basic.phptFri Aug 29 15:28:45 2008
@@ -16,7 +16,7 @@
 var_dump( finfo_open( FILEINFO_MIME, $magicFile ) );
 var_dump( finfo_open( FILEINFO_NONE, $magicFile ) );
 var_dump( finfo_open( FILEINFO_SYMLINK, $magicFile ) );
-var_dump( finfo_open( FILEINFO_COMPRESS, $magicFile ) );
+//var_dump( finfo_open( FILEINFO_COMPRESS, $magicFile ) );
 var_dump( finfo_open( FILEINFO_DEVICES, $magicFile ) );
 var_dump( finfo_open( FILEINFO_CONTINUE, $magicFile ) );
 var_dump( finfo_open( FILEINFO_PRESERVE_ATIME, $magicFile ) );
@@ -37,7 +37,6 @@
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
-resource(%d) of type (file_info)
 object(finfo)#%d (%d) {
 }
 object(finfo)#%d (%d) {
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_variation1.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/fileinfo/tests/finfo_open_variation1.phpt
diff -u php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.1.2.1 
php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.1.2.2
--- php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.1.2.1   Fri Aug 
29 10:29:55 2008
+++ php-src/ext/fileinfo/tests/finfo_open_variation1.phpt   Fri Aug 29 
15:28:45 2008
@@ -14,7 +14,7 @@
 
 // Calling finfo_open() with different options
 var_dump( finfo_open( FILEINFO_MIME | FILEINFO_SYMLINK, $magicFile ) );
-var_dump( finfo_open( FILEINFO_COMPRESS | FILEINFO_PRESERVE_ATIME, $magicFile 
) );
+//var_dump( finfo_open( FILEINFO_COMPRESS | FILEINFO_PRESERVE_ATIME, 
$magicFile ) );
 var_dump( finfo_open( FILEINFO_DEVICES | FILEINFO_RAW, $magicFile ) );
 
 ?
@@ -23,5 +23,4 @@
 *** Testing finfo_open() : variations in opening ***
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
-resource(%d) of type (file_info)
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/tests finfo_open_basic.phpt finfo_open_variation1.phpt

2008-08-29 Thread Felipe Pena
felipe  Fri Aug 29 15:29:02 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/tests finfo_open_basic.phpt 
finfo_open_variation1.phpt 
  Log:
  - Fixed tests (Disable COMPRESS support for now)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_basic.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/tests/finfo_open_basic.phpt
diff -u php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.2 
php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.3
--- php-src/ext/fileinfo/tests/finfo_open_basic.phpt:1.2Fri Aug 29 
10:34:34 2008
+++ php-src/ext/fileinfo/tests/finfo_open_basic.phptFri Aug 29 15:29:02 2008
@@ -16,7 +16,7 @@
 var_dump( finfo_open( FILEINFO_MIME, $magicFile ) );
 var_dump( finfo_open( FILEINFO_NONE, $magicFile ) );
 var_dump( finfo_open( FILEINFO_SYMLINK, $magicFile ) );
-var_dump( finfo_open( FILEINFO_COMPRESS, $magicFile ) );
+//var_dump( finfo_open( FILEINFO_COMPRESS, $magicFile ) );
 var_dump( finfo_open( FILEINFO_DEVICES, $magicFile ) );
 var_dump( finfo_open( FILEINFO_CONTINUE, $magicFile ) );
 var_dump( finfo_open( FILEINFO_PRESERVE_ATIME, $magicFile ) );
@@ -37,7 +37,6 @@
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
-resource(%d) of type (file_info)
 object(finfo)#%d (%d) {
 }
 object(finfo)#%d (%d) {
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_variation1.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/tests/finfo_open_variation1.phpt
diff -u php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.2 
php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.3
--- php-src/ext/fileinfo/tests/finfo_open_variation1.phpt:1.2   Fri Aug 29 
10:34:34 2008
+++ php-src/ext/fileinfo/tests/finfo_open_variation1.phpt   Fri Aug 29 
15:29:02 2008
@@ -14,7 +14,7 @@
 
 // Calling finfo_open() with different options
 var_dump( finfo_open( FILEINFO_MIME | FILEINFO_SYMLINK, $magicFile ) );
-var_dump( finfo_open( FILEINFO_COMPRESS | FILEINFO_PRESERVE_ATIME, $magicFile 
) );
+//var_dump( finfo_open( FILEINFO_COMPRESS | FILEINFO_PRESERVE_ATIME, 
$magicFile ) );
 var_dump( finfo_open( FILEINFO_DEVICES | FILEINFO_RAW, $magicFile ) );
 
 ?
@@ -23,5 +23,4 @@
 *** Testing finfo_open() : variations in opening ***
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
-resource(%d) of type (file_info)
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/array array_walk_object1.phpt array_walk_objects.phpt array_walk_rec_objects.phpt array_walk_recursive_object1.phpt

2008-08-29 Thread Felipe Pena
felipe  Fri Aug 29 15:47:01 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/array   array_walk_object1.phpt 
array_walk_objects.phpt 
array_walk_rec_objects.phpt 
array_walk_recursive_object1.phpt 
  Log:
  - Fixed tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_object1.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_object1.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_objects.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_objects.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_rec_objects.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_rec_objects.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_walk_recursive_object1.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/array/array_walk_recursive_object1.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: CVSROOT / avail

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 16:42:30 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - Fixed typo.
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1440r2=1.1441diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1440 CVSROOT/avail:1.1441
--- CVSROOT/avail:1.1440Fri Aug 29 13:36:11 2008
+++ CVSROOT/avail   Fri Aug 29 16:42:30 2008
@@ -296,7 +296,7 @@
 avail|txforward|pecl/txforward
 avail|smantoor|php-src/ext/standard
 avail|guilhermeblanco|phpweb
-avail|iodbc|ext/odbc
+avail|iodbc|php-src/ext/odbc
 avail|ross|phpdoc,gd
 
 # Objective-C bridge



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/odbc php_odbc.c php_odbc.h php_odbc_includes.h

2008-08-29 Thread Patrick van Kleef
iodbc   Fri Aug 29 16:42:50 2008 UTC

  Modified files:  
/php-src/ext/odbc   php_odbc.c php_odbc.h php_odbc_includes.h 
  Log:
  - Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug #43666)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.209r2=1.210diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.209 php-src/ext/odbc/php_odbc.c:1.210
--- php-src/ext/odbc/php_odbc.c:1.209   Sun Aug 24 20:50:02 2008
+++ php-src/ext/odbc/php_odbc.c Fri Aug 29 16:42:49 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.209 2008/08/24 20:50:02 felipe Exp $ */
+/* $Id: php_odbc.c,v 1.210 2008/08/29 16:42:49 iodbc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -64,7 +64,7 @@
 
 static int le_result, le_conn, le_pconn;
 
-#define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0))
+#define SAFE_SQL_NTS(n) ((SQLSMALLINT) ((n)?(SQL_NTS):0))
 
 /* {{{ arginfo */
 static
@@ -477,7 +477,7 @@
if (res-stmt) {
 #if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35)
SQLTransact(res-conn_ptr-henv, res-conn_ptr-hdbc,
-   (UWORD)SQL_COMMIT);
+   (SQLUSMALLINT) SQL_COMMIT);
 #endif
rc = SQLFreeStmt(res-stmt,SQL_DROP);
/* We don't want the connection to be closed after the 
last statment has been closed
@@ -861,10 +861,10 @@
 /* {{{ odbc_sql_error */
 void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
 {
-   charstate[6];
-   SDWORD  error;/* Not used */
-   charerrormsg[SQL_MAX_MESSAGE_LENGTH];
-   SWORD   errormsgsize; /* Not used */
+   charstate[6];
+   SQLINTEGER  error;/* Not used */
+   charerrormsg[SQL_MAX_MESSAGE_LENGTH];
+   SQLSMALLINT errormsgsize; /* Not used */
RETCODE rc;
ODBC_SQL_ENV_T henv;
ODBC_SQL_CONN_T conn;
@@ -940,8 +940,8 @@
 {
RETCODE rc;
int i;
-   SWORD   colnamelen; /* Not used */
-   SDWORD  displaysize;
+   SQLSMALLINT colnamelen; /* Not used */
+   SQLLEN  displaysize;
 
result-values = (odbc_result_value *) 
safe_emalloc(sizeof(odbc_result_value), result-numcols, 0);
 
@@ -949,9 +949,9 @@
result-binmode = ODBCG(defaultbinmode);
 
for(i = 0; i  result-numcols; i++) {
-   rc = SQLColAttributes(result-stmt, (UWORD)(i+1), 
SQL_COLUMN_NAME, 
+   rc = SQLColAttributes(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_NAME, 
result-values[i].name, 
sizeof(result-values[i].name), colnamelen, 0);
-   rc = SQLColAttributes(result-stmt, (UWORD)(i+1), 
SQL_COLUMN_TYPE, 
+   rc = SQLColAttributes(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_TYPE, 
NULL, 0, NULL, result-values[i].coltype);

/* Don't bind LONG / BINARY columns, so that fetch behaviour can
@@ -969,17 +969,17 @@
 #ifdef HAVE_ADABAS
case SQL_TIMESTAMP:
result-values[i].value = (char *)emalloc(27);
-   SQLBindCol(result-stmt, (UWORD)(i+1), 
SQL_C_CHAR, result-values[i].value,
+   SQLBindCol(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_C_CHAR, result-values[i].value,
27, 
result-values[i].vallen);
break;
 #endif /* HAVE_ADABAS */
default:
-   rc = SQLColAttributes(result-stmt, 
(UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE,
+   rc = SQLColAttributes(result-stmt, 
(SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
NULL, 
0, NULL, displaysize);
displaysize = displaysize = 
result-longreadlen ? displaysize : 

result-longreadlen;
result-values[i].value = (char 
*)emalloc(displaysize + 1);
-   rc = SQLBindCol(result-stmt, (UWORD)(i+1), 
SQL_C_CHAR, result-values[i].value,
+   rc = SQLBindCol(result-stmt, 
(SQLUSMALLINT)(i+1), SQL_C_CHAR, result-values[i].value,
displaysize + 1, 
result-values[i].vallen);
break;
}
@@ -1001,7 +1001,7 @@
 
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, 
ODBC-Link, le_conn, le_pconn);

-   rc = SQLTransact(conn-henv, conn-hdbc, 
(UWORD)((type)?SQL_COMMIT:SQL_ROLLBACK));
+   rc = SQLTransact(conn-henv, conn-hdbc, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/odbc php_odbc.c php_odbc.h php_odbc_includes.h

2008-08-29 Thread Patrick van Kleef
iodbc   Fri Aug 29 16:44:29 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/odbc   php_odbc.c php_odbc.h php_odbc_includes.h 
  Log:
  - MFH: Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug #43666)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.6r2=1.189.2.4.2.7.2.7diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.6 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.7
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.6   Sun Aug 24 20:50:41 2008
+++ php-src/ext/odbc/php_odbc.c Fri Aug 29 16:44:29 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.6 2008/08/24 20:50:41 felipe Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.7 2008/08/29 16:44:29 iodbc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -64,7 +64,7 @@
 
 static int le_result, le_conn, le_pconn;
 
-#define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0))
+#define SAFE_SQL_NTS(n) ((SQLSMALLINT) ((n)?(SQL_NTS):0))
 
 /* {{{ arginfo */
 static
@@ -477,7 +477,7 @@
if (res-stmt) {
 #if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35)
SQLTransact(res-conn_ptr-henv, res-conn_ptr-hdbc,
-   (UWORD)SQL_COMMIT);
+   (SQLUSMALLINT) SQL_COMMIT);
 #endif
rc = SQLFreeStmt(res-stmt,SQL_DROP);
/* We don't want the connection to be closed after the 
last statment has been closed
@@ -861,10 +861,10 @@
 /* {{{ odbc_sql_error */
 void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
 {
-   charstate[6];
-   SDWORD  error;/* Not used */
-   charerrormsg[SQL_MAX_MESSAGE_LENGTH];
-   SWORD   errormsgsize; /* Not used */
+   charstate[6];
+   SQLINTEGER  error;/* Not used */
+   charerrormsg[SQL_MAX_MESSAGE_LENGTH];
+   SQLSMALLINT errormsgsize; /* Not used */
RETCODE rc;
ODBC_SQL_ENV_T henv;
ODBC_SQL_CONN_T conn;
@@ -940,8 +940,8 @@
 {
RETCODE rc;
int i;
-   SWORD   colnamelen; /* Not used */
-   SDWORD  displaysize;
+   SQLSMALLINT colnamelen; /* Not used */
+   SQLLEN  displaysize;
 
result-values = (odbc_result_value *) 
safe_emalloc(sizeof(odbc_result_value), result-numcols, 0);
 
@@ -949,9 +949,9 @@
result-binmode = ODBCG(defaultbinmode);
 
for(i = 0; i  result-numcols; i++) {
-   rc = SQLColAttributes(result-stmt, (UWORD)(i+1), 
SQL_COLUMN_NAME, 
+   rc = SQLColAttributes(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_NAME, 
result-values[i].name, 
sizeof(result-values[i].name), colnamelen, 0);
-   rc = SQLColAttributes(result-stmt, (UWORD)(i+1), 
SQL_COLUMN_TYPE, 
+   rc = SQLColAttributes(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_TYPE, 
NULL, 0, NULL, result-values[i].coltype);

/* Don't bind LONG / BINARY columns, so that fetch behaviour can
@@ -969,17 +969,17 @@
 #ifdef HAVE_ADABAS
case SQL_TIMESTAMP:
result-values[i].value = (char *)emalloc(27);
-   SQLBindCol(result-stmt, (UWORD)(i+1), 
SQL_C_CHAR, result-values[i].value,
+   SQLBindCol(result-stmt, (SQLUSMALLINT)(i+1), 
SQL_C_CHAR, result-values[i].value,
27, 
result-values[i].vallen);
break;
 #endif /* HAVE_ADABAS */
default:
-   rc = SQLColAttributes(result-stmt, 
(UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE,
+   rc = SQLColAttributes(result-stmt, 
(SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
NULL, 
0, NULL, displaysize);
displaysize = displaysize = 
result-longreadlen ? displaysize : 

result-longreadlen;
result-values[i].value = (char 
*)emalloc(displaysize + 1);
-   rc = SQLBindCol(result-stmt, (UWORD)(i+1), 
SQL_C_CHAR, result-values[i].value,
+   rc = SQLBindCol(result-stmt, 
(SQLUSMALLINT)(i+1), SQL_C_CHAR, result-values[i].value,
displaysize + 1, 
result-values[i].vallen);
break;
}
@@ -1001,7 +1001,7 @@
 
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, 
ODBC-Link, le_conn, le_pconn);

-   rc = SQLTransact(conn-henv, conn-hdbc, 

[PHP-CVS] cvs: CVSROOT / avail

2008-08-29 Thread Derick Rethans
derick  Fri Aug 29 16:49:28 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - Upgrade Mikko
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1441r2=1.1442diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1441 CVSROOT/avail:1.1442
--- CVSROOT/avail:1.1441Fri Aug 29 16:42:30 2008
+++ CVSROOT/avail   Fri Aug 29 16:49:28 2008
@@ -17,7 +17,7 @@
 # The PHP Developers have full access to the full source trees for
 # PHP, as well as the documentation.
 
-avail|lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,go!
 
palv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox,hnangelo,ohill,indeyets,felixdv,mich4ld,lbarnaud,cseiler|phpfi,php3,php-src,pecl,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca,phpdoc-no,phd,docweb
+avail|mkoppanen,lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathn!
 
a,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox,hnangelo,ohill,indeyets,felixdv,mich4ld,lbarnaud,cseiler|phpfi,php3,php-src,pecl,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca,phpdoc-no,phd,docweb
 
 # Some people have access to tests in the Engine
 avail|magnus,michael,zoe,jmessa,sfox,tomerc|Zend/tests,ZendEngine2/tests
@@ -216,7 +216,7 @@
 avail|tal,momo|php-src/ext/calendar
 avail|momo|php-src/ext/standard
 avail|mbretter,philippe|pecl/radius,pecl/mqseries
-avail|mcmontero,blade106,scottmac,mkoppanen|pecl/imagick
+avail|mcmontero,blade106,scottmac|pecl/imagick
 avail|bjori|php-src/ext/date
 avail|mg|pecl/lzf
 avail|mg|pecl/tcpwrap
@@ -279,7 +279,6 @@
 avail|lucas|pecl/apd
 avail|rotsenmarcello|pecl/puno
 avail|lwe|pecl/pdo_firebird,php-src/ext/pdo_firebird
-avail|mkoppanen|pecl/ssh2
 avail|bdeshong|pecl/usblib
 avail|francois|pecl/phk,pecl/automap
 avail|ramsey|pecl/uploadprogress,pecl/pdo_user



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests preg_filter.phpt

2008-08-29 Thread Hannes Magnusson
On Fri, Aug 29, 2008 at 14:13, Marcus Boerger [EMAIL PROTECTED] wrote:
[...]
 @@ -1879,6 +1894,7 @@
PHP_FE(preg_match_all,  arginfo_preg_match_all)
PHP_FE(preg_replace,arginfo_preg_replace)
PHP_FE(preg_replace_callback,   arginfo_preg_replace_callback)
 +   PHP_FE(preg_filter, arginfo_preg_replace)

The second argument of arginfo_preg_replace is called `callback`...

-Hannes

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/odbc php_odbc.c php_odbc_includes.h

2008-08-29 Thread Patrick van Kleef
iodbc   Fri Aug 29 19:15:39 2008 UTC

  Modified files:  
/php-src/ext/odbc   php_odbc.c php_odbc_includes.h 
  Log:
  - Added odbc.default_cursortype to control the ODBC cursormodel (bug #43668)
  #[DOC]
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.210r2=1.211diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.210 php-src/ext/odbc/php_odbc.c:1.211
--- php-src/ext/odbc/php_odbc.c:1.210   Fri Aug 29 16:42:49 2008
+++ php-src/ext/odbc/php_odbc.c Fri Aug 29 19:15:39 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.210 2008/08/29 16:42:49 iodbc Exp $ */
+/* $Id: php_odbc.c,v 1.211 2008/08/29 19:15:39 iodbc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -677,6 +677,50 @@
 }
 /* }}} */
 
+
+/* {{{ PHP_INI_DISP(display_cursortype)
+ */
+static PHP_INI_DISP(display_cursortype)
+{
+   char *value;
+   TSRMLS_FETCH();
+
+   if (type == PHP_INI_DISPLAY_ORIG  ini_entry-modified) {
+   value = ini_entry-orig_value;
+   } else if (ini_entry-value) {
+   value = ini_entry-value;
+   } else {
+   value = NULL;
+   }
+
+   if (value) {
+   switch (atoi (value))
+ {
+   case SQL_CURSOR_FORWARD_ONLY:
+   PUTS (Forward Only cursor);
+   break;
+
+   case SQL_CURSOR_STATIC:
+   PUTS (Static cursor);
+   break;
+
+   case SQL_CURSOR_KEYSET_DRIVEN:
+   PUTS (Keyset driven cursor);
+   break;
+
+   case SQL_CURSOR_DYNAMIC:
+   PUTS (Dynamic cursor);
+   break;
+
+   default:
+   php_printf(Unknown cursor model %s, value);
+   break;
+ }
+   }
+}
+
+/* }}} */
+
 /* {{{ PHP_INI_BEGIN 
  */
 PHP_INI_BEGIN()
@@ -698,6 +742,8 @@
defaultbinmode, zend_odbc_globals, odbc_globals, 
display_binmode)
STD_PHP_INI_BOOLEAN(odbc.check_persistent, 1, PHP_INI_SYSTEM, 
OnUpdateLong,
check_persistent, zend_odbc_globals, odbc_globals)
+   STD_PHP_INI_ENTRY_EX(odbc.default_cursortype, 3, PHP_INI_ALL, 
OnUpdateLong, 
+   default_cursortype, zend_odbc_globals, odbc_globals, 
display_cursortype)
 PHP_INI_END()
 /* }}} */
 
@@ -1173,7 +1219,8 @@
/* Try to set CURSOR_TYPE to dynamic. Driver will 
replace this with other
   type if not possible.
*/
-   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
SQL_CURSOR_DYNAMIC) == SQL_ERROR) {
+   int cursortype = ODBCG(default_cursortype);
+   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
cursortype) == SQL_ERROR) {
odbc_sql_error(conn, result-stmt,  
SQLSetStmtOption);
SQLFreeStmt(result-stmt, SQL_DROP);
efree(result);
@@ -1561,7 +1608,8 @@
/* Try to set CURSOR_TYPE to dynamic. Driver will 
replace this with other
   type if not possible.
 */
-   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
SQL_CURSOR_DYNAMIC) == SQL_ERROR) {
+   int cursortype = ODBCG(default_cursortype);
+   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
cursortype) == SQL_ERROR) {
odbc_sql_error(conn, result-stmt,  
SQLSetStmtOption);
SQLFreeStmt(result-stmt, SQL_DROP);
efree(result);
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc_includes.h?r1=1.19r2=1.20diff_format=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.19 
php-src/ext/odbc/php_odbc_includes.h:1.20
--- php-src/ext/odbc/php_odbc_includes.h:1.19   Fri Aug 29 16:42:50 2008
+++ php-src/ext/odbc/php_odbc_includes.hFri Aug 29 19:15:39 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_odbc_includes.h,v 1.19 2008/08/29 16:42:50 iodbc Exp $ */
+/* $Id: php_odbc_includes.h,v 1.20 2008/08/29 19:15:39 iodbc Exp $ */
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -265,6 +265,7 @@
int defConn;
 long defaultlrl;
 long defaultbinmode;
+long default_cursortype;
 char laststate[6];
 char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
HashTable *resource_list;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: 

[PHP-CVS] Re: [PHP-DOC] Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests preg_filter.phpt

2008-08-29 Thread Felipe Pena
Em Sex, 2008-08-29 às 21:07 +0200, Hannes Magnusson escreveu:
 On Fri, Aug 29, 2008 at 14:13, Marcus Boerger [EMAIL PROTECTED] wrote:
 [...]
  @@ -1879,6 +1894,7 @@
 PHP_FE(preg_match_all,  arginfo_preg_match_all)
 PHP_FE(preg_replace,arginfo_preg_replace)
 PHP_FE(preg_replace_callback,   arginfo_preg_replace_callback)
  +   PHP_FE(preg_filter, 
  arginfo_preg_replace)
 
 The second argument of arginfo_preg_replace is called `callback`...
 
No, 'callback' is the second argument of arginfo_preg_replace_callback.

 -Hannes
-- 
Regards,
Felipe Pena.


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/odbc php_odbc.c php_odbc_includes.h

2008-08-29 Thread Patrick van Kleef
iodbc   Fri Aug 29 19:16:58 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/odbc   php_odbc.c php_odbc_includes.h 
  Log:
  - MFH: Added odbc.default_cursortype to control the ODBC cursormodel 
(bug #43668)
  #[DOC]
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.7r2=1.189.2.4.2.7.2.8diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.7 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.8
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.7   Fri Aug 29 16:44:29 2008
+++ php-src/ext/odbc/php_odbc.c Fri Aug 29 19:16:58 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.7 2008/08/29 16:44:29 iodbc Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.8 2008/08/29 19:16:58 iodbc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -677,6 +677,50 @@
 }
 /* }}} */
 
+
+/* {{{ PHP_INI_DISP(display_cursortype)
+ */
+static PHP_INI_DISP(display_cursortype)
+{
+   char *value;
+   TSRMLS_FETCH();
+
+   if (type == PHP_INI_DISPLAY_ORIG  ini_entry-modified) {
+   value = ini_entry-orig_value;
+   } else if (ini_entry-value) {
+   value = ini_entry-value;
+   } else {
+   value = NULL;
+   }
+
+   if (value) {
+   switch (atoi (value))
+ {
+   case SQL_CURSOR_FORWARD_ONLY:
+   PUTS (Forward Only cursor);
+   break;
+
+   case SQL_CURSOR_STATIC:
+   PUTS (Static cursor);
+   break;
+
+   case SQL_CURSOR_KEYSET_DRIVEN:
+   PUTS (Keyset driven cursor);
+   break;
+
+   case SQL_CURSOR_DYNAMIC:
+   PUTS (Dynamic cursor);
+   break;
+
+   default:
+   php_printf(Unknown cursor model %s, value);
+   break;
+ }
+   }
+}
+
+/* }}} */
+
 /* {{{ PHP_INI_BEGIN 
  */
 PHP_INI_BEGIN()
@@ -698,6 +742,8 @@
defaultbinmode, zend_odbc_globals, odbc_globals, 
display_binmode)
STD_PHP_INI_BOOLEAN(odbc.check_persistent, 1, PHP_INI_SYSTEM, 
OnUpdateLong,
check_persistent, zend_odbc_globals, odbc_globals)
+   STD_PHP_INI_ENTRY_EX(odbc.default_cursortype, 3, PHP_INI_ALL, 
OnUpdateLong, 
+   default_cursortype, zend_odbc_globals, odbc_globals, 
display_cursortype)
 PHP_INI_END()
 /* }}} */
 
@@ -1173,7 +1219,8 @@
/* Try to set CURSOR_TYPE to dynamic. Driver will 
replace this with other
   type if not possible.
*/
-   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
SQL_CURSOR_DYNAMIC) == SQL_ERROR) {
+   int cursortype = ODBCG(default_cursortype);
+   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
cursortype) == SQL_ERROR) {
odbc_sql_error(conn, result-stmt,  
SQLSetStmtOption);
SQLFreeStmt(result-stmt, SQL_DROP);
efree(result);
@@ -1568,7 +1615,8 @@
/* Try to set CURSOR_TYPE to dynamic. Driver will 
replace this with other
   type if not possible.
 */
-   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
SQL_CURSOR_DYNAMIC) == SQL_ERROR) {
+   int cursortype = ODBCG(default_cursortype);
+   if (SQLSetStmtOption(result-stmt, SQL_CURSOR_TYPE, 
cursortype) == SQL_ERROR) {
odbc_sql_error(conn, result-stmt,  
SQLSetStmtOption);
SQLFreeStmt(result-stmt, SQL_DROP);
efree(result);
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc_includes.h?r1=1.12.2.1.2.4.2.2r2=1.12.2.1.2.4.2.3diff_format=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.2 
php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.3
--- php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.2   Fri Aug 29 
16:44:29 2008
+++ php-src/ext/odbc/php_odbc_includes.hFri Aug 29 19:16:58 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_odbc_includes.h,v 1.12.2.1.2.4.2.2 2008/08/29 16:44:29 iodbc Exp $ 
*/
+/* $Id: php_odbc_includes.h,v 1.12.2.1.2.4.2.3 2008/08/29 19:16:58 iodbc Exp $ 
*/
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -265,6 +265,7 @@
int defConn;
 long defaultlrl;
 long defaultbinmode;
+long 

[PHP-CVS] Re: [PHP-DOC] Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests preg_filter.phpt

2008-08-29 Thread Hannes Magnusson
On Fri, Aug 29, 2008 at 21:16, Felipe Pena [EMAIL PROTECTED] wrote:
 Em Sex, 2008-08-29 às 21:07 +0200, Hannes Magnusson escreveu:
 On Fri, Aug 29, 2008 at 14:13, Marcus Boerger [EMAIL PROTECTED] wrote:
 [...]
  @@ -1879,6 +1894,7 @@
 PHP_FE(preg_match_all,  arginfo_preg_match_all)
 PHP_FE(preg_replace,arginfo_preg_replace)
 PHP_FE(preg_replace_callback,   arginfo_preg_replace_callback)
  +   PHP_FE(preg_filter, 
  arginfo_preg_replace)

 The second argument of arginfo_preg_replace is called `callback`...

 No, 'callback' is the second argument of arginfo_preg_replace_callback.

Hah! Indeed.
Don't know how I manage to misread that one :D

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests preg_filter.phpt

2008-08-29 Thread Antony Dovgal

On 29.08.2008 16:13, Marcus Boerger wrote:

helly   Fri Aug 29 12:13:55 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/pcre/tests	preg_filter.phpt 


Don't forget to fix sapi/cli/tests/006.phpt

--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c

2008-08-29 Thread Henrique do Nascimento Angelo
hnangeloFri Aug 29 22:59:42 2008 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
  Log:
  Fix wrong Unicode string length (bytes) in tidy_parse_string()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.122r2=1.123diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.122 php-src/ext/tidy/tidy.c:1.123
--- php-src/ext/tidy/tidy.c:1.122   Thu Jul  3 12:21:25 2008
+++ php-src/ext/tidy/tidy.c Fri Aug 29 22:59:41 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.122 2008/07/03 12:21:25 felipe Exp $ */
+/* $Id: tidy.c,v 1.123 2008/08/29 22:59:41 hnangelo Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1180,7 +1180,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Tidy support, enabled);
php_info_print_table_row(2, libTidy Release, (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, Extension Version, 
PHP_TIDY_MODULE_VERSION  ($Id: tidy.c,v 1.122 2008/07/03 12:21:25 felipe Exp 
$));
+   php_info_print_table_row(2, Extension Version, 
PHP_TIDY_MODULE_VERSION  ($Id: tidy.c,v 1.123 2008/08/29 22:59:41 hnangelo Exp 
$));
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1313,7 +1313,7 @@
 
TIDY_APPLY_CONFIG_ZVAL(obj-ptdoc-doc, options);
 
-   if (php_tidy_parse_string(obj, input.s, input_len, enc TSRMLS_CC) == 
FAILURE) {
+   if (php_tidy_parse_string(obj, input.s, USTR_BYTES(input_type, 
input_len), enc TSRMLS_CC) == FAILURE) {
zval_dtor(return_value);
INIT_ZVAL(*return_value);
RETVAL_FALSE;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php