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

2008-09-12 Thread Antony Dovgal
tony2001Fri Sep 12 10:30:18 2008 UTC

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  fix typo
  test before commit!
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.527r2=1.528diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.527 php-src/ext/standard/file.c:1.528
--- php-src/ext/standard/file.c:1.527   Fri Sep 12 01:10:56 2008
+++ php-src/ext/standard/file.c Fri Sep 12 10:30:18 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: file.c,v 1.527 2008/09/12 01:10:56 felipe Exp $ */
+/* $Id: file.c,v 1.528 2008/09/12 10:30:18 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2053,7 +2053,7 @@
 
count = zend_hash_num_elements(Z_ARRVAL_P(fields));
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(fields), pos);
-   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(fields), (void **) 
field, pos) == SUCCESS) {
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(fields), (void **) 
field_tmp, pos) == SUCCESS) {
field = **field_tmp;
 
if (Z_TYPE_PP(field_tmp) != IS_STRING) {



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



[PHP-CVS] cvs: php-src /ext/pcntl/tests 002.phpt

2008-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 12:14:28 2008 UTC

  Modified files:  
/php-src/ext/pcntl/tests002.phpt 
  Log:
  Fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcntl/tests/002.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/pcntl/tests/002.phpt
diff -u php-src/ext/pcntl/tests/002.phpt:1.2 
php-src/ext/pcntl/tests/002.phpt:1.3
--- php-src/ext/pcntl/tests/002.phpt:1.2Tue Aug  5 15:12:11 2008
+++ php-src/ext/pcntl/tests/002.phptFri Sep 12 12:14:28 2008
@@ -39,8 +39,19 @@
var_dump($siginfo['pid'] === $pid);
pcntl_waitpid($pid, $status);
 
+   set_error_handler(function($errno, $errstr) { echo Error triggered\n; 
}, E_WARNING);
+
echo sigprocmask with invalid arguments\n;
-   var_dump(pcntl_sigprocmask(PHP_INT_MAX, array(SIGTERM)));
+
+   /* Valgrind expectedly complains about this:
+ * sigprocmask: unknown 'how' field 2147483647
+* Skip */
+   if (getenv(USE_ZEND_ALLOC) !== '0') {
+   var_dump(pcntl_sigprocmask(PHP_INT_MAX, array(SIGTERM)));
+   } else {
+   echo Error triggered\n;
+   echo bool(false)\n;
+   }
var_dump(pcntl_sigprocmask(SIG_SETMASK, array(0)));
 
echo sigwaitinfo with invalid arguments\n;
@@ -50,7 +61,7 @@
var_dump(pcntl_sigtimedwait(array(SIGTERM), $signo, PHP_INT_MAX, 
PHP_INT_MAX));
 } else {
$siginfo = NULL;
-   pcntl_sigtimedwait(array(SIGTERM), $siginfo, PHP_INT_MAX, 9);
+   pcntl_sigtimedwait(array(SIGINT), $siginfo, PHP_INT_MAX, 9);
exit;
 }
 
@@ -71,17 +82,13 @@
 signo === pid
 bool(true)
 sigprocmask with invalid arguments
-
-Warning: pcntl_sigprocmask(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
-
-Warning: pcntl_sigprocmask(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
 sigwaitinfo with invalid arguments
-
-Warning: pcntl_sigwaitinfo(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
 sigtimedwait with invalid arguments
-
-Warning: pcntl_sigtimedwait(): Invalid argument in %s on line %d
+Error triggered
 int(-1)



-- 
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/pcntl/tests 002.phpt

2008-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 12:17:07 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/pcntl/tests002.phpt 
  Log:
  MFH Fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcntl/tests/002.phpt?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/pcntl/tests/002.phpt
diff -u php-src/ext/pcntl/tests/002.phpt:1.1.2.4 
php-src/ext/pcntl/tests/002.phpt:1.1.2.5
--- php-src/ext/pcntl/tests/002.phpt:1.1.2.4Mon Sep  8 12:08:41 2008
+++ php-src/ext/pcntl/tests/002.phptFri Sep 12 12:17:07 2008
@@ -40,8 +40,19 @@
var_dump($siginfo['pid'] === $pid);
pcntl_waitpid($pid, $status);
 
+   set_error_handler(function($errno, $errstr) { echo Error triggered\n; 
}, E_WARNING);
+
echo sigprocmask with invalid arguments\n;
-   var_dump(pcntl_sigprocmask(PHP_INT_MAX, array(SIGTERM)));
+
+   /* Valgrind expectedly complains about this:
+ * sigprocmask: unknown 'how' field 2147483647
+* Skip */
+   if (getenv(USE_ZEND_ALLOC) !== '0') {
+   var_dump(pcntl_sigprocmask(PHP_INT_MAX, array(SIGTERM)));
+   } else {
+   echo Error triggered\n;
+   echo bool(false)\n;
+   }
var_dump(pcntl_sigprocmask(SIG_SETMASK, array(0)));
 
echo sigwaitinfo with invalid arguments\n;
@@ -51,7 +62,7 @@
var_dump(pcntl_sigtimedwait(array(SIGTERM), $signo, PHP_INT_MAX, 
PHP_INT_MAX));
 } else {
$siginfo = NULL;
-   pcntl_sigtimedwait(array(SIGTERM), $siginfo, PHP_INT_MAX, 9);
+   pcntl_sigtimedwait(array(SIGINT), $siginfo, PHP_INT_MAX, 9);
exit;
 }
 
@@ -72,17 +83,13 @@
 signo === pid
 bool(true)
 sigprocmask with invalid arguments
-
-Warning: pcntl_sigprocmask(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
-
-Warning: pcntl_sigprocmask(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
 sigwaitinfo with invalid arguments
-
-Warning: pcntl_sigwaitinfo(): Invalid argument in %s on line %d
+Error triggered
 bool(false)
 sigtimedwait with invalid arguments
-
-Warning: pcntl_sigtimedwait(): Invalid argument in %s on line %d
+Error triggered
 int(-1)



-- 
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-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 14:14:53 2008 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  Fix cwd when running tests out of tree with ZTS builds (fixes #45837)
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.377r2=1.378diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.377 php-src/run-tests.php:1.378
--- php-src/run-tests.php:1.377 Mon Sep  8 09:23:24 2008
+++ php-src/run-tests.php   Fri Sep 12 14:14:52 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.377 2008/09/08 09:23:24 lbarnaud Exp $ */
+/* $Id: run-tests.php,v 1.378 2008/09/12 14:14:52 lbarnaud 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
@@ -609,7 +609,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.377 $' . \n;
+   echo '$Revision: 1.378 $' . \n;
exit(1);
 
default:
@@ -996,7 +996,7 @@
 
 function system_with_timeout($commandline, $env = null, $stdin = null)
 {
-   global $leak_check;
+   global $leak_check, $cwd;
 
$data = '';
 
@@ -1009,7 +1009,7 @@
0 = array('pipe', 'r'),
1 = array('pipe', 'w'),
2 = array('pipe', 'w')
-   ), $pipes, null, $bin_env, array('suppress_errors' = true, 
'binary_pipes' = true));
+   ), $pipes, $cwd, $bin_env, array('suppress_errors' = true, 
'binary_pipes' = true));
 
if (!$proc) {
return false;



-- 
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-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 14:15:05 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  MFH: Fix cwd when running tests out of tree with ZTS builds (fixes #45837)
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.46r2=1.226.2.37.2.35.2.47diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.46 
php-src/run-tests.php:1.226.2.37.2.35.2.47
--- php-src/run-tests.php:1.226.2.37.2.35.2.46  Mon Sep  8 09:23:51 2008
+++ php-src/run-tests.php   Fri Sep 12 14:15:05 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.46 2008/09/08 09:23:51 lbarnaud Exp 
$ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.47 2008/09/12 14:15:05 lbarnaud 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
@@ -609,7 +609,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.46 
$' . \n;
+   echo '$Revision: 1.226.2.37.2.35.2.47 
$' . \n;
exit(1);
 
default:
@@ -996,7 +996,7 @@
 
 function system_with_timeout($commandline, $env = null, $stdin = null)
 {
-   global $leak_check;
+   global $leak_check, $cwd;
 
$data = '';
 
@@ -1004,7 +1004,7 @@
0 = array('pipe', 'r'),
1 = array('pipe', 'w'),
2 = array('pipe', 'w')
-   ), $pipes, null, $env, array('suppress_errors' = true, 
'binary_pipes' = true));
+   ), $pipes, $cwd, $env, array('suppress_errors' = true, 
'binary_pipes' = true));
 
if (!$proc) {
return false;



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



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

2008-09-12 Thread Felipe Pena
felipe  Fri Sep 12 16:24:12 2008 UTC

  Modified files:  
/php-src/ext/splspl_directory.c 
  Log:
  - Missing argument to type t
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.167r2=1.168diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.167 
php-src/ext/spl/spl_directory.c:1.168
--- php-src/ext/spl/spl_directory.c:1.167   Thu Sep 11 15:45:29 2008
+++ php-src/ext/spl/spl_directory.c Fri Sep 12 16:24:12 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.167 2008/09/11 15:45:29 lbarnaud Exp $ */
+/* $Id: spl_directory.c,v 1.168 2008/09/12 16:24:12 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -879,11 +879,11 @@
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
zstr fname, suffix, path;
int flen, slen = 0, path_len;
-   zend_uchar path_type;
+   zend_uchar path_type, stype;
 
suffix.v = 0;
if (intern-file_name_type == IS_UNICODE) { 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |t, 
suffix.u, slen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |t, 
suffix, slen, stype) == FAILURE) {
return;
}
} else {



-- 
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) /ext/mbstring mbstring.c

2008-09-12 Thread Moriyoshi Koizumi
Hi Antony,

Antony Dovgal wrote:
 The docs say mbstring.internal_encoding is PHP_INI_ALL, but this change
 makes it in fact PHP_INI_SYSTEM.
 Also why allow using mb_internal_encoding() and disallow changing the
 ini setting?

I missed your mail. Sorry for the late reply.

As for your question. It's not really an INI_SYSTEM setting. To take
account of the other settings that are affected by the value of
mbstring.internal_encoding, it turned out the corresponding global entry
got to be handled in RINIT. the original INI values are kept by the
zend_ini facility separately, so doing so is anyway safe.

Regards,
Moriyoshi

-- 
Moriyoshi Koizumi [EMAIL PROTECTED]

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



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

2008-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 19:49:04 2008 UTC

  Modified files:  
/php-src/ext/pcntl  pcntl.c 
  Log:
  initialize optional args
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcntl/pcntl.c?r1=1.66r2=1.67diff_format=u
Index: php-src/ext/pcntl/pcntl.c
diff -u php-src/ext/pcntl/pcntl.c:1.66 php-src/ext/pcntl/pcntl.c:1.67
--- php-src/ext/pcntl/pcntl.c:1.66  Tue Aug  5 15:12:10 2008
+++ php-src/ext/pcntl/pcntl.c   Fri Sep 12 19:49:04 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: pcntl.c,v 1.66 2008/08/05 15:12:10 jani Exp $ */
+/* $Id: pcntl.c,v 1.67 2008/09/12 19:49:04 lbarnaud Exp $ */
 
 #define PCNTL_DEBUG 0
 
@@ -602,7 +602,7 @@
Executes specified program in current process space as defined by exec(2) */
 PHP_FUNCTION(pcntl_exec)
 {
-   zval *args, *envs;
+   zval *args = NULL, *envs = NULL;
zval **element;
HashTable *args_hash, *envs_hash;
int argc = 0, argi = 0;



-- 
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/pcntl pcntl.c

2008-09-12 Thread Arnaud Le Blanc
lbarnaudFri Sep 12 19:49:18 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/pcntl  pcntl.c 
  Log:
  MFH: initialize optional args
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcntl/pcntl.c?r1=1.48.2.2.2.4.2.9r2=1.48.2.2.2.4.2.10diff_format=u
Index: php-src/ext/pcntl/pcntl.c
diff -u php-src/ext/pcntl/pcntl.c:1.48.2.2.2.4.2.9 
php-src/ext/pcntl/pcntl.c:1.48.2.2.2.4.2.10
--- php-src/ext/pcntl/pcntl.c:1.48.2.2.2.4.2.9  Tue Aug  5 15:12:19 2008
+++ php-src/ext/pcntl/pcntl.c   Fri Sep 12 19:49:18 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: pcntl.c,v 1.48.2.2.2.4.2.9 2008/08/05 15:12:19 jani Exp $ */
+/* $Id: pcntl.c,v 1.48.2.2.2.4.2.10 2008/09/12 19:49:18 lbarnaud Exp $ */
 
 #define PCNTL_DEBUG 0
 
@@ -602,7 +602,7 @@
Executes specified program in current process space as defined by exec(2) */
 PHP_FUNCTION(pcntl_exec)
 {
-   zval *args, *envs;
+   zval *args = NULL, *envs = NULL;
zval **element;
HashTable *args_hash, *envs_hash;
int argc = 0, argi = 0;



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



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

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Fri Sep 12 23:34:45 2008 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c 
  Log:
  * Use memcmp() for binary safety.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.298r2=1.299diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.298 
php-src/ext/mbstring/mbstring.c:1.299
--- php-src/ext/mbstring/mbstring.c:1.298   Wed Sep 10 23:19:50 2008
+++ php-src/ext/mbstring/mbstring.c Fri Sep 12 23:34:45 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.298 2008/09/10 23:19:50 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.299 2008/09/12 23:34:45 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -4527,14 +4527,12 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to create 
converter);
RETURN_FALSE;
}   
-   mbfl_buffer_converter_illegal_mode(convd, 
MBSTRG(current_filter_illegal_mode));
-   mbfl_buffer_converter_illegal_substchar(convd, 
MBSTRG(current_filter_illegal_substchar));   
+   mbfl_buffer_converter_illegal_mode(convd, 
MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE);
+   mbfl_buffer_converter_illegal_substchar(convd, 0);  

/* initialize string */
-   mbfl_string_init(string);
+   mbfl_string_init_set(string, mbfl_no_language_neutral, no_encoding);
mbfl_string_init(result);
-   string.no_encoding = no_encoding;
-   string.no_language = MBSTRG(language);
 
string.val = (unsigned char *)var;
string.len = var_len;
@@ -4542,17 +4540,12 @@
illegalchars = mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
 
+   RETVAL_FALSE;
if (ret != NULL) {
-   MBSTRG(illegalchars) += illegalchars;
-   if (illegalchars == 0  strncmp((char *)string.val, (char 
*)ret-val, string.len) == 0) {
-   efree(ret-val);
-   RETURN_TRUE;
-   } else {
-   efree(ret-val);
-   RETURN_FALSE;
+   if (illegalchars == 0  string.len == result.len  
memcmp(string.val, result.val, string.len) == 0) {
+   RETVAL_TRUE;
}
-   } else {
-   RETURN_FALSE;
+   mbfl_string_clear(result);
}
 }
 /* }}} */



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring mbstring.c

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Fri Sep 12 23:37:22 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mbstring   mbstring.c 
  Log:
  - MFH: Use memcmp() for binary safety.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.38r2=1.224.2.22.2.39diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.38 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.39
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.38 Mon Aug  4 21:06:50 2008
+++ php-src/ext/mbstring/mbstring.c Fri Sep 12 23:37:21 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.38 2008/08/04 21:06:50 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.39 2008/09/12 23:37:21 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -4110,14 +4110,12 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to create 
converter);
RETURN_FALSE;
}   
-   mbfl_buffer_converter_illegal_mode(convd, 
MBSTRG(current_filter_illegal_mode));
-   mbfl_buffer_converter_illegal_substchar(convd, 
MBSTRG(current_filter_illegal_substchar));   
+   mbfl_buffer_converter_illegal_mode(convd, 
MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE);
+   mbfl_buffer_converter_illegal_substchar(convd, 0);  

/* initialize string */
-   mbfl_string_init(string);
+   mbfl_string_init_set(string, mbfl_no_language_neutral, no_encoding);
mbfl_string_init(result);
-   string.no_encoding = no_encoding;
-   string.no_language = MBSTRG(language);
 
string.val = (unsigned char *)var;
string.len = var_len;
@@ -4125,18 +4123,13 @@
illegalchars = mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
 
-   if (ret != NULL) {
-   MBSTRG(illegalchars) += illegalchars;
-   if (illegalchars == 0  strncmp(string.val, ret-val, 
string.len) == 0) {
-   efree(ret-val);
-   RETURN_TRUE;
-   } else {
-   efree(ret-val);
-   RETURN_FALSE;
-   }
-   } else {
-   RETURN_FALSE;
-   }
+   RETVAL_FALSE;
+   if (ret != NULL) {
+   if (illegalchars == 0  string.len == result.len  
memcmp(string.val, result.val, string.len) == 0) {
+   RETVAL_TRUE;
+   }
+   mbfl_string_clear(result);
+   }
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring mbstring.c mbstring.h

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Fri Sep 12 23:56:07 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mbstring   mbstring.c mbstring.h 
  Log:
  - Remove unexposed functions.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.39r2=1.224.2.22.2.40diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.39 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.40
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.39 Fri Sep 12 23:37:21 2008
+++ php-src/ext/mbstring/mbstring.c Fri Sep 12 23:56:06 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.39 2008/09/12 23:37:21 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.40 2008/09/12 23:56:06 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -2733,122 +2733,6 @@
 }
 /* }}} */
 
-/* {{{ proto array mb_list_encodings_alias_names([string encoding])
-   Returns an array of all supported alias encodings */
-PHP_FUNCTION(mb_list_encodings_alias_names)
-{
-   const mbfl_encoding **encodings;
-   const mbfl_encoding *encoding;
-   enum mbfl_no_encoding no_encoding;
-   int i, j;
-   zval *row;
-   char *name = NULL;
-   int name_len;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, name, 
name_len) == FAILURE) {
-   RETURN_FALSE;
-   }
-
-   if (name == NULL) {
-   array_init(return_value);
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   MAKE_STD_ZVAL(row);
-   array_init(row);
-   if (encoding-aliases != NULL) {
-   j = 0;
-   while ((*encoding-aliases)[j] != NULL) {
-   add_next_index_string(row, (char 
*)(*encoding-aliases)[j], 1);
-   j++;
-   }
-   }
-   add_assoc_zval(return_value, (char *) encoding-name, 
row);
-   }
-   } else {
-   no_encoding = mbfl_name2no_encoding(name);
-   if (no_encoding == mbfl_no_encoding_invalid) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
encoding \%s\, name);
-   RETURN_FALSE;
-   }
-
-   name = (char *)mbfl_no_encoding2name(no_encoding);
-   if (name != NULL) {
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   if (strcmp(encoding-name, name) != 0){ 
continue; }
-
-   array_init(return_value);
-   if (encoding-aliases != NULL) {
-   j = 0;
-   while ((*encoding-aliases)[j] != NULL) 
{
-   
add_next_index_string(return_value, (char *)(*encoding-aliases)[j], 1);
-   j++;
-   }
-   }
-
-   break;
-   }
-   } else {
-   RETURN_FALSE;
-   }
-   }
-}
-/* }}} */
-
-/* {{{ proto mixed mb_list_mime_names([string encoding])
-   Returns an array or string of all supported mime names */
-PHP_FUNCTION(mb_list_mime_names)
-{
-   const mbfl_encoding **encodings;
-   const mbfl_encoding *encoding;
-   enum mbfl_no_encoding no_encoding;
-   int i;
-   char *name = NULL;
-   int name_len;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, name, 
name_len) == FAILURE) {
-   RETURN_FALSE;
-   }
-
-   if (name == NULL) {
-   array_init(return_value);
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   if(encoding-mime_name != NULL) {
-   add_assoc_string(return_value, (char *) 
encoding-name, (char *) encoding-mime_name, 1);
-   } else{
-   add_assoc_string(return_value, (char *) 
encoding-name, , 1);
-   }
-   }
-   } else {
-   no_encoding = mbfl_name2no_encoding(name);
-   if (no_encoding == mbfl_no_encoding_invalid) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
encoding \%s\, name);
-   RETURN_FALSE;
-   }
-
-   name = (char *)mbfl_no_encoding2name(no_encoding);
-   

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

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Fri Sep 12 23:59:51 2008 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c 
  Log:
  - The mb_list_* issue has been resolved in the following way:
- Keep the same prototype as 5.2 for mb_list_encodings().
- Add mb_list_encoding_aliases() with the mandatory parameter.
- Remove mb_list_mime_names() as the list can be made from iteration
  on mb_list_encodings() with mb_preferred_mime_name().
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.299r2=1.300diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.299 
php-src/ext/mbstring/mbstring.c:1.300
--- php-src/ext/mbstring/mbstring.c:1.299   Fri Sep 12 23:34:45 2008
+++ php-src/ext/mbstring/mbstring.c Fri Sep 12 23:59:51 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.299 2008/09/12 23:34:45 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.300 2008/09/12 23:59:51 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -390,16 +390,10 @@
 
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_list_encodings, 0, 0, 0)
-   ZEND_ARG_INFO(0, alias_encoding)
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_list_encodings_alias_names, 0, 0, 0)
-   ZEND_ARG_INFO(0, encoding)
-ZEND_END_ARG_INFO()
-
-static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_list_mime_names, 0, 0, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_list_encoding_aliases, 0, 0, 1)
ZEND_ARG_INFO(0, encoding)
 ZEND_END_ARG_INFO()
 
@@ -588,8 +582,7 @@
PHP_FE(mb_convert_encoding, arginfo_mb_convert_encoding)
PHP_FE(mb_detect_encoding,  arginfo_mb_detect_encoding)
PHP_FE(mb_list_encodings,   arginfo_mb_list_encodings)
-   PHP_FE(mb_list_encodings_alias_names,   
arginfo_mb_list_encodings_alias_names)
-   PHP_FE(mb_list_mime_names,  arginfo_mb_list_mime_names)
+   PHP_FE(mb_list_encoding_aliases,
arginfo_mb_list_encoding_aliases)
PHP_FE(mb_convert_kana, arginfo_mb_convert_kana)
PHP_FE(mb_encode_mimeheader,arginfo_mb_encode_mimeheader)
PHP_FE(mb_decode_mimeheader,arginfo_mb_decode_mimeheader)
@@ -3125,156 +3118,51 @@
 }
 /* }}} */
 
-/* {{{ proto mixed mb_list_encodings([string alias_encoding])
+/* {{{ proto mixed mb_list_encodings()
Returns an array of all supported entity encodings or Returns the entity 
encoding as a string */
 PHP_FUNCTION(mb_list_encodings)
 {
const mbfl_encoding **encodings;
const mbfl_encoding *encoding;
-   enum mbfl_no_encoding no_encoding;
int i;
-   char *name = NULL;
-   int name_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, name, 
name_len) == FAILURE) {
-   RETURN_FALSE;
+   if (ZEND_NUM_ARGS() != 0) {
+   RETVAL_FALSE;
+   ZEND_WRONG_PARAM_COUNT();
}
 
-   if (name == NULL) {
-   array_init(return_value);
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   add_next_index_string(return_value, (char *) 
encoding-name, 1);
-   }
-   } else {
-   no_encoding = mbfl_name2no_encoding(name);
-   if (no_encoding == mbfl_no_encoding_invalid) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
encoding \%s\, name);
-   RETURN_FALSE;
-   }
-
-   name = (char *)mbfl_no_encoding2name(no_encoding);
-   if (name != NULL) {
-   RETURN_STRING(name, 1);
-   } else {
-   RETURN_FALSE;
-   }
+   array_init(return_value);
+   i = 0;
+   encodings = mbfl_get_supported_encodings();
+   while ((encoding = encodings[i++]) != NULL) {
+   add_next_index_string(return_value, (char *) encoding-name, 1);
}
 }
 /* }}} */
 
-/* {{{ proto array mb_list_encodings_alias_names([string encoding])
-   Returns an array of all supported alias encodings */
-PHP_FUNCTION(mb_list_encodings_alias_names)
+/* {{{ proto array mb_list_encoding_aliases(string encoding)
+   Returns an array of the aliases of a given encoding name */
+PHP_FUNCTION(mb_list_encoding_aliases)
 {
-   const mbfl_encoding **encodings;
const mbfl_encoding *encoding;
-   enum mbfl_no_encoding no_encoding;
-   int i, j;
-   zval *row;
char *name = NULL;
int name_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, name, 
name_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, name, 
name_len) == FAILURE) {
RETURN_FALSE;
}
 
-   if (name == NULL) {
-   

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

2008-09-12 Thread Moriyoshi Koizumi
Moriyoshi Koizumi wrote:
 moriyoshi Fri Sep 12 23:59:51 2008 UTC
 
   Modified files:  
 /php-src/ext/mbstring mbstring.c 
   Log:
   - The mb_list_* issue has been resolved in the following way:
 - Keep the same prototype as 5.2 for mb_list_encodings().
 - Add mb_list_encoding_aliases() with the mandatory parameter.
 - Remove mb_list_mime_names() as the list can be made from iteration
   on mb_list_encodings() with mb_preferred_mime_name().
   

Just to note I already discussed this with the other mbstring
developers. Thanks Nuno for reminding me.

Regards,
Moriyoshi

-- 
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/sqlite config.m4

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 00:14:31 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/sqlite config.m4 
  Log:
  - MFH: Add missing =DIR
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/config.m4?r1=1.41.2.1.2.2r2=1.41.2.1.2.2.2.1diff_format=u
Index: php-src/ext/sqlite/config.m4
diff -u php-src/ext/sqlite/config.m4:1.41.2.1.2.2 
php-src/ext/sqlite/config.m4:1.41.2.1.2.2.2.1
--- php-src/ext/sqlite/config.m4:1.41.2.1.2.2   Tue Jul  3 17:25:35 2007
+++ php-src/ext/sqlite/config.m4Sat Sep 13 00:14:31 2008
@@ -1,9 +1,9 @@
-dnl $Id: config.m4,v 1.41.2.1.2.2 2007/07/03 17:25:35 sniper Exp $
+dnl $Id: config.m4,v 1.41.2.1.2.2.2.1 2008/09/13 00:14:31 moriyoshi Exp $
 dnl config.m4 for extension sqlite
 dnl vim:et:ts=2:sw=2
 
 PHP_ARG_WITH(sqlite, for sqlite support,
-[  --without-sqliteDo not include sqlite support.  DIR is the sqlite 
base
+[  --without-sqlite=DIR   Do not include sqlite support.  DIR is the sqlite 
base
   install directory [BUNDLED]], yes)
 
 PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite 
(default: ISO-8859-1),



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite config.m4

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 00:14:49 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite config.m4 
  Log:
  - MFH: Add missing =DIR
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/config.m4?r1=1.41.2.1.2.2r2=1.41.2.1.2.3diff_format=u
Index: php-src/ext/sqlite/config.m4
diff -u php-src/ext/sqlite/config.m4:1.41.2.1.2.2 
php-src/ext/sqlite/config.m4:1.41.2.1.2.3
--- php-src/ext/sqlite/config.m4:1.41.2.1.2.2   Tue Jul  3 17:25:35 2007
+++ php-src/ext/sqlite/config.m4Sat Sep 13 00:14:49 2008
@@ -1,9 +1,9 @@
-dnl $Id: config.m4,v 1.41.2.1.2.2 2007/07/03 17:25:35 sniper Exp $
+dnl $Id: config.m4,v 1.41.2.1.2.3 2008/09/13 00:14:49 moriyoshi Exp $
 dnl config.m4 for extension sqlite
 dnl vim:et:ts=2:sw=2
 
 PHP_ARG_WITH(sqlite, for sqlite support,
-[  --without-sqliteDo not include sqlite support.  DIR is the sqlite 
base
+[  --without-sqlite=DIR   Do not include sqlite support.  DIR is the sqlite 
base
   install directory [BUNDLED]], yes)
 
 PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite 
(default: ISO-8859-1),



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



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

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 00:22:10 2008 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c mbstring.h 
  Log:
  - mb_encoding_aliases() is more consistent with mb_preferred_mime_name()
despite the unconformance with the naming convention.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.300r2=1.301diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.300 
php-src/ext/mbstring/mbstring.c:1.301
--- php-src/ext/mbstring/mbstring.c:1.300   Fri Sep 12 23:59:51 2008
+++ php-src/ext/mbstring/mbstring.c Sat Sep 13 00:22:10 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.300 2008/09/12 23:59:51 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.301 2008/09/13 00:22:10 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -393,7 +393,7 @@
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_list_encoding_aliases, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_encoding_aliases, 0, 0, 1)
ZEND_ARG_INFO(0, encoding)
 ZEND_END_ARG_INFO()
 
@@ -582,7 +582,7 @@
PHP_FE(mb_convert_encoding, arginfo_mb_convert_encoding)
PHP_FE(mb_detect_encoding,  arginfo_mb_detect_encoding)
PHP_FE(mb_list_encodings,   arginfo_mb_list_encodings)
-   PHP_FE(mb_list_encoding_aliases,
arginfo_mb_list_encoding_aliases)
+   PHP_FE(mb_encoding_aliases, arginfo_mb_encoding_aliases)
PHP_FE(mb_convert_kana, arginfo_mb_convert_kana)
PHP_FE(mb_encode_mimeheader,arginfo_mb_encode_mimeheader)
PHP_FE(mb_decode_mimeheader,arginfo_mb_decode_mimeheader)
@@ -3140,9 +3140,9 @@
 }
 /* }}} */
 
-/* {{{ proto array mb_list_encoding_aliases(string encoding)
+/* {{{ proto array mb_encoding_aliases(string encoding)
Returns an array of the aliases of a given encoding name */
-PHP_FUNCTION(mb_list_encoding_aliases)
+PHP_FUNCTION(mb_encoding_aliases)
 {
const mbfl_encoding *encoding;
char *name = NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.h?r1=1.83r2=1.84diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.83 
php-src/ext/mbstring/mbstring.h:1.84
--- php-src/ext/mbstring/mbstring.h:1.83Sat Aug  2 20:48:30 2008
+++ php-src/ext/mbstring/mbstring.h Sat Sep 13 00:22:10 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mbstring.h,v 1.83 2008/08/02 20:48:30 moriyoshi Exp $ */
+/* $Id: mbstring.h,v 1.84 2008/09/13 00:22:10 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring (currently only for Japanese)
@@ -117,8 +117,7 @@
 PHP_FUNCTION(mb_convert_encoding);
 PHP_FUNCTION(mb_detect_encoding);
 PHP_FUNCTION(mb_list_encodings);
-PHP_FUNCTION(mb_list_encodings_alias_names);
-PHP_FUNCTION(mb_list_mime_names);
+PHP_FUNCTION(mb_encoding_aliases);
 PHP_FUNCTION(mb_convert_kana);
 PHP_FUNCTION(mb_encode_mimeheader);
 PHP_FUNCTION(mb_decode_mimeheader);



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite config.m4

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 00:24:12 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite config.m4 
  Log:
  - MFH: WS
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/config.m4?r1=1.41.2.1.2.3r2=1.41.2.1.2.4diff_format=u
Index: php-src/ext/sqlite/config.m4
diff -u php-src/ext/sqlite/config.m4:1.41.2.1.2.3 
php-src/ext/sqlite/config.m4:1.41.2.1.2.4
--- php-src/ext/sqlite/config.m4:1.41.2.1.2.3   Sat Sep 13 00:14:49 2008
+++ php-src/ext/sqlite/config.m4Sat Sep 13 00:24:12 2008
@@ -1,9 +1,9 @@
-dnl $Id: config.m4,v 1.41.2.1.2.3 2008/09/13 00:14:49 moriyoshi Exp $
+dnl $Id: config.m4,v 1.41.2.1.2.4 2008/09/13 00:24:12 moriyoshi Exp $
 dnl config.m4 for extension sqlite
 dnl vim:et:ts=2:sw=2
 
 PHP_ARG_WITH(sqlite, for sqlite support,
-[  --without-sqlite=DIR   Do not include sqlite support.  DIR is the sqlite 
base
+[  --without-sqlite=DIRDo not include sqlite support.  DIR is the sqlite 
base
   install directory [BUNDLED]], yes)
 
 PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite 
(default: ISO-8859-1),



-- 
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/mbstring mbstring.c mbstring.h /ext/mbstring/tests mb_encoding_aliases.phpt mb_list_encodings.phpt

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 00:30:51 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mbstring/tests mb_encoding_aliases.phpt 
mb_list_encodings.phpt 

  Modified files:  
/php-src/ext/mbstring   mbstring.c mbstring.h 
  Log:
  - MFH: mb_list_*() issue settlements
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.33r2=1.224.2.22.2.25.2.34diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.33 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.34
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.33Fri Sep 12 
23:35:01 2008
+++ php-src/ext/mbstring/mbstring.c Sat Sep 13 00:30:51 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.25.2.33 2008/09/12 23:35:01 moriyoshi Exp $ 
*/
+/* $Id: mbstring.c,v 1.224.2.22.2.25.2.34 2008/09/13 00:30:51 moriyoshi Exp $ 
*/
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -401,6 +401,11 @@
 ZEND_END_ARG_INFO()
 
 static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_encoding_aliases, 0, 0, 1)
+   ZEND_ARG_INFO(0, encoding)
+ZEND_END_ARG_INFO()
+
+static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_encode_mimeheader, 0, 0, 1)
ZEND_ARG_INFO(0, str)
ZEND_ARG_INFO(0, charset)
@@ -585,6 +590,7 @@
PHP_FE(mb_convert_encoding, arginfo_mb_convert_encoding)
PHP_FE(mb_detect_encoding,  arginfo_mb_detect_encoding)
PHP_FE(mb_list_encodings,   arginfo_mb_list_encodings)
+   PHP_FE(mb_encoding_aliases, arginfo_mb_encoding_aliases)
PHP_FE(mb_convert_kana, arginfo_mb_convert_kana)
PHP_FE(mb_encode_mimeheader,arginfo_mb_encode_mimeheader)
PHP_FE(mb_decode_mimeheader,arginfo_mb_decode_mimeheader)
@@ -3298,117 +3304,29 @@
 }
 /* }}} */
 
-/* {{{ proto array mb_list_encodings_alias_names([string encoding])
-   Returns an array of all supported alias encodings */
-PHP_FUNCTION(mb_list_encodings_alias_names)
+/* {{{ proto array mb_encoding_aliases(string encoding)
+   Returns an array of the aliases of a given encoding name */
+PHP_FUNCTION(mb_encoding_aliases)
 {
-   const mbfl_encoding **encodings;
const mbfl_encoding *encoding;
-   enum mbfl_no_encoding no_encoding;
-   int i, j;
-   zval *row;
char *name = NULL;
int name_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, name, 
name_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, name, 
name_len) == FAILURE) {
RETURN_FALSE;
}
 
-   if (name == NULL) {
-   array_init(return_value);
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   MAKE_STD_ZVAL(row);
-   array_init(row);
-   if (encoding-aliases != NULL) {
-   j = 0;
-   while ((*encoding-aliases)[j] != NULL) {
-   add_next_index_string(row, (char 
*)(*encoding-aliases)[j], 1);
-   j++;
-   }
-   }
-   add_assoc_zval(return_value, (char *) encoding-name, 
row);
-   }
-   } else {
-   no_encoding = mbfl_name2no_encoding(name);
-   if (no_encoding == mbfl_no_encoding_invalid) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
encoding \%s\, name);
-   RETURN_FALSE;
-   }
-
-   name = (char *)mbfl_no_encoding2name(no_encoding);
-   if (name != NULL) {
-   i = 0;
-   encodings = mbfl_get_supported_encodings();
-   while ((encoding = encodings[i++]) != NULL) {
-   if (strcmp(encoding-name, name) != 0){ 
continue; }
-
-   array_init(return_value);
-   if (encoding-aliases != NULL) {
-   j = 0;
-   while ((*encoding-aliases)[j] != NULL) 
{
-   
add_next_index_string(return_value, (char *)(*encoding-aliases)[j], 1);
-   j++;
-   }
-   }
-
-   break;
-   }
-   } else {
-   RETURN_FALSE;
-   }
-   }
-}
-/* }}} */
-
-/* {{{ proto mixed mb_list_mime_names([string encoding])
-   Returns an array or string of all supported mime names */

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

2008-09-12 Thread Moriyoshi Koizumi
moriyoshi   Sat Sep 13 02:32:51 2008 UTC

  Modified files:  
/php-src/ext/mbstring   php_mbregex.c 
  Log:
  - Properly initialize/finalize the library. This plugs the leaks caused by
onig_new().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/php_mbregex.c?r1=1.65r2=1.66diff_format=u
Index: php-src/ext/mbstring/php_mbregex.c
diff -u php-src/ext/mbstring/php_mbregex.c:1.65 
php-src/ext/mbstring/php_mbregex.c:1.66
--- php-src/ext/mbstring/php_mbregex.c:1.65 Mon Aug 18 00:36:03 2008
+++ php-src/ext/mbstring/php_mbregex.c  Sat Sep 13 02:32:51 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_mbregex.c,v 1.65 2008/08/18 00:36:03 felipe Exp $ */
+/* $Id: php_mbregex.c,v 1.66 2008/09/13 02:32:51 moriyoshi Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -114,6 +114,7 @@
 /* {{{ PHP_MINIT_FUNCTION(mb_regex) */
 PHP_MINIT_FUNCTION(mb_regex)
 {
+   onig_init();
return SUCCESS;
 }
 /* }}} */
@@ -121,6 +122,7 @@
 /* {{{ PHP_MSHUTDOWN_FUNCTION(mb_regex) */
 PHP_MSHUTDOWN_FUNCTION(mb_regex)
 {
+   onig_end();
return SUCCESS;
 }
 /* }}} */



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