Re: [PHP-DEV] [PATCH] ereg to pcre conversion
On Thu, Oct 31, 2002 at 02:47:27PM -0500, Ilia A. wrote: I would like to propose that we drop the old ereg library and use only a single regular expression library, PCRE. For BC purposes I've written a patch (see attached file), which emulates the old ereg_* functions for people who still rely on those, using PCRE. We probably have to make a bunch of tests to see if we don't break BC with this patch. If we don't break BC, and only then, I would give +1 on this patch. Too many people rely on the ereg_* functions, so IMO we really can't afford changing any behaviour. Sander -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ext/imap finding libraries
The following patch allows to find the kerberos libraries to be found in /usr, /usr/local, /usr/kerberos and a given path. If there are no objections i will commit this. marcus cvs -z3 -q diff ext\imap\config.m4 (in directory S:\php4-HEAD\) Index: ext/imap/config.m4 === RCS file: /repository/php4/ext/imap/config.m4,v retrieving revision 1.48 diff -u -r1.48 config.m4 --- ext/imap/config.m4 20 Aug 2002 23:08:24 - 1.48 +++ ext/imap/config.m4 1 Nov 2002 10:31:21 - -67,15 +67,20 test -d /usr/kerberos PHP_KERBEROS=/usr/kerberos fi - if test $PHP_KERBEROS != no; then -if test ! -f $PHP_KERBEROS/lib/libkrb5.a test ! -f $PHP_KERBEROS/lib/libkrb5.$SHLIB_SUFFIX_NAME; then - AC_MSG_ERROR([Kerberos libraries not found in $PHP_KERBEROS/lib. + for i in /usr /usr/local /usr/kerberos $PHP_KERBEROS; do +test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME -o -f $i/lib/libkrb5.a PHP_KERBEROS_DIR=$i + done + + if test -z $PHP_KERBEROS_DIR; then +AC_MSG_ERROR([Kerberos libraries not found. Check the path given to --with-kerberos (if no path is given, defaults to /usr/kerberos ) - ]) -fi +]) + fi + + if test $PHP_KERBEROS != no; then AC_DEFINE(HAVE_IMAP_KRB,1,[ ]) -PHP_ADD_LIBPATH($PHP_KERBEROS/lib, IMAP_SHARED_LIBADD) +PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(gssapi_krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(k5crypto, 1, IMAP_SHARED_LIBADD)
[PHP-DEV] RE: [PHP-QA] 64-bit SGI account offer
-Original Message- From: Seth Price [mailto:sprice;wisc.edu] Sent: Friday, November 01, 2002 2:32 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-QA] 64-bit SGI account offer It sounds like there is a need to get some 64-bit test systems to work with PHP on. Where I work we have some 64-bit SGI systems that we use for various scientific global simulations. I don't use the systems personally, but I spoke with my boss and I may be able to get an ssh login account for someone to get a PHP build working if there is interest. Would you guys find this useful? It think this would be very useful, but I don't have the time to test PHP on just another platform. I even have Problems testing it at my platform, Alpha/Tru64, but I think someone should get an account on that machine. I would suggest someone from the dev-team like Jani or any other bug-hunter rather than someone from the QA-Team for this. Regards, Sebastian Nohn -- [EMAIL PROTECTED] - http://www.nohn.net/ PGP Key Available - Did I help you? Consider a gift: http://www.amazon.de/exec/obidos/wishlist/3HYH6NR8ZI0WI/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RE: [PHP-QA] 64-bit SGI account offer
What about an additional cronjob for automated builds which could then be included in snaps.php.net. This way all of us could verify the build results? marcus At 12:18 01.11.2002, Sebastian Nohn wrote: -Original Message- From: Seth Price [mailto:sprice;wisc.edu] Sent: Friday, November 01, 2002 2:32 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-QA] 64-bit SGI account offer It sounds like there is a need to get some 64-bit test systems to work with PHP on. Where I work we have some 64-bit SGI systems that we use for various scientific global simulations. I don't use the systems personally, but I spoke with my boss and I may be able to get an ssh login account for someone to get a PHP build working if there is interest. Would you guys find this useful? It think this would be very useful, but I don't have the time to test PHP on just another platform. I even have Problems testing it at my platform, Alpha/Tru64, but I think someone should get an account on that machine. I would suggest someone from the dev-team like Jani or any other bug-hunter rather than someone from the QA-Team for this. Regards, Sebastian Nohn -- [EMAIL PROTECTED] - http://www.nohn.net/ PGP Key Available - Did I help you? Consider a gift: http://www.amazon.de/exec/obidos/wishlist/3HYH6NR8ZI0WI/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] run-tests.php
Hi, attached a patch: 1) To get the right compiler version (see php-qa thread on this) 2) Add option to save results, by Michael Mauch [EMAIL PROTECTED] Any objections? With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PATCH] run-tests.php
On Fri, 1 Nov 2002, Melvyn Sopacua wrote: Hi, attached a patch: 1) To get the right compiler version (see php-qa thread on this) 2) Add option to save results, by Michael Mauch [EMAIL PROTECTED] Any objections? We can't object if there is no attachment :) Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PATCH] run-tests.php
At 15:37 1-11-2002, Derick Rethans wrote: Any objections? We can't object if there is no attachment :) ?php while($i100) { echo substr('#*!$%', mt_rand(1,6), 1); $i++; } ? With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? Index: run-tests.php === RCS file: /repository/php4/run-tests.php,v retrieving revision 1.104 diff -u -r1.104 run-tests.php --- run-tests.php 31 Oct 2002 14:01:58 - 1.104 +++ run-tests.php 1 Nov 2002 14:17:00 - -280,10 +280,12 /* We got failed Tests, offer the user to send and e-mail to QA team, unless NO_INTERACTION is set */ if ($sum_results['FAILED'] !getenv('NO_INTERACTION')) { $fp = fopen(php://stdin, r+); - echo Some tests have failed, would you like to send the\nreport to PHP's QA team? [Yn]: ; + echo Some tests have failed, would you like to send the\nreport to PHP's QA +team\n; + echo (choose \s\ to just save the results to a file)? [Yns]: ; $user_input = fgets($fp, 10); + $just_save_results = (strtolower($user_input[0]) == 's'); - if (strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { + if ($just_save_results || strlen(trim($user_input)) == 0 || +strtolower($user_input[0]) == 'y') { /* * Collect information about the host system for our report * Fetch phpinfo() output so that we can see the PHP enviroment -300,7 +302,16 $automake = shell_exec('automake --version'); $autoconf = shell_exec('autoconf --version'); $libtool = shell_exec('libtool --version'); - $compiler = shell_exec(getenv('CC').' -v 21'); + /* Try the most common flags for 'version' */ + $flags = array('-v', '-V', '--version'); + $cc_status=0; + foreach($flags AS $flag) { + system(getenv('CC'). $flag /dev/null 21, +$cc_status); + if($cc_status == 0) { + $compiler = shell_exec(getenv('CC'). $flag +21); + break; + } + } } $failed_tests_data .= Automake:\n$automake\n; $failed_tests_data .= Autoconf:\n$autoconf\n; -323,13 +334,15 $compression = 0; - if (!mail_qa_team($failed_tests_data, $compression)) { + if ($just_save_results || !mail_qa_team($failed_tests_data, +$compression)) { $output_file = 'php_test_results_' . date('Ymd') . ( $compression ? '.txt.gz' : '.txt' ); $fp = fopen($output_file, w); fwrite($fp, $failed_tests_data); fclose($fp); - echo \nThe test script was unable to automatically send the report to PHP's QA Team\nPlease send .$output_file. to .PHP_QA_EMAIL. manually, thank you.\n; + if (!$just_save_results) + echo \nThe test script was unable to automatically send +the report to PHP's QA Team\n; + echo Please send .$output_file. to .PHP_QA_EMAIL. +manually, thank you.\n; } else { fwrite($fp, \nThank you for helping to make PHP better.\n); fclose($fp); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Segfault when an error message is displayed during shutdown
Hey, See backtrace, it's immediate clear what happens... the filename is already freed. (gdb) run -X Starting program: /dat/dev/php/apache_1.3.27/src/httpd -X Program received signal SIGSEGV, Segmentation fault. 0x080afdbf in php_strlcpy (dst=0x832bdc0 /home/httpd/html/pres/show.php, src=0x5a5a5a5a Address 0x5a5a5a5a out of bounds, siz=1024) at /dat/dev/php/php-4.3.0dev/main/strlcpy.c:58 58 if ((*d++ = *s++) == 0) (gdb) bt #0 0x080afdbf in php_strlcpy (dst=0x832bdc0 /home/httpd/html/pres/show.php, src=0x5a5a5a5a Address 0x5a5a5a5a out of bounds, siz=1024) at /dat/dev/php/php-4.3.0dev/main/strlcpy.c:58 #1 0x080a6fe4 in php_error_cb (type=1, error_filename=0x5a5a5a5a Address 0x5a5a5a5a out of bounds, error_lineno=0, format=0x82a64bf PDFlib error: %s, args=0xbfffe6a8) at /dat/dev/php/php-4.3.0dev/main/main.c:545 #2 0x080d1df7 in zend_error (type=1, format=0x82a64bf PDFlib error: %s) at /dat/dev/php/php-4.3.0dev/Zend/zend.c:710 #3 0x0817f646 in custom_errorhandler (p=0x86afef4, type=3, shortmsg=0xbfffe6d0 function 'PDF_delete' must not be called in 'page' scope) at /dat/dev/php/php-4.3.0dev/ext/pdf/pdf.c:280 #4 0x40066ce5 in pdf_error (p=0x86afef4, type=3, fmt=0x400a8660 function '%s' must not be called in '%s' scope) at p_basic.c:207 #5 0x40066db8 in pdf_scope_error (p=0x86afef4, funame=0x400a884d PDF_delete) at p_basic.c:291 #6 0x40067345 in PDF_delete (p=0x86afef4) at p_basic.c:657 #7 0x0817f5d9 in _free_pdf_doc (rsrc=0x8539b3c) at /dat/dev/php/php-4.3.0dev/ext/pdf/pdf.c:248 #8 0x080d9097 in list_entry_destructor (ptr=0x8539b3c) at /dat/dev/php/php-4.3.0dev/Zend/zend_list.c:177 #9 0x080d74b4 in zend_hash_apply_deleter (ht=0x8341d68, p=0x8539fd4) ---Type return to continue, or q return to quit--- at /dat/dev/php/php-4.3.0dev/Zend/zend_hash.c:598 #10 0x080d76ea in zend_hash_graceful_reverse_destroy (ht=0x8341d68) at /dat/dev/php/php-4.3.0dev/Zend/zend_hash.c:664 #11 0x080d91d1 in zend_destroy_rsrc_list (ht=0x8341d68) at /dat/dev/php/php-4.3.0dev/Zend/zend_list.c:233 #12 0x080c809c in shutdown_executor () at /dat/dev/php/php-4.3.0dev/Zend/zend_execute_API.c:213 #13 0x080d1b8a in zend_deactivate () at /dat/dev/php/php-4.3.0dev/Zend/zend.c:624 #14 0x080a7d28 in php_request_shutdown (dummy=0x0) at /dat/dev/php/php-4.3.0dev/main/main.c:913 #15 0x0809fb04 in php_apache_request_shutdown () #16 0x08250ca8 in run_cleanups () #17 0x0824f546 in ap_clear_pool () #18 0x0824f5c6 in ap_destroy_pool () #19 0x0824f532 in ap_clear_pool () #20 0x0825f89d in child_main () #21 0x0825feb0 in make_child () #22 0x08260024 in startup_children () #23 0x082606a0 in standalone_main () #24 0x08260f0f in main () #25 0x40552306 in __libc_start_main (main=0x8260b60 main, argc=2, ubp_av=0xbad4, init=0x807cbec _init, fini=0x82777f0 _fini, ---Type return to continue, or q return to quit--- rtld_fini=0x4000d2dc _dl_fini, stack_end=0xbacc) at ../sysdeps/generic/libc-start.c:129 Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
The only thing I see wrong, is perhaps that Shane and I are working on a new run-tests script (see run-tests2.php) Since the script (at least the CLI class) basically works just as well as the current run-tests.php (as far as I've seen thus far)... Well, I'm just worried your patch will end up disappearing :( All IMHO of course. John |-Original Message- |From: Melvyn Sopacua [mailto:msopacua;php.net] |Sent: Friday, November 01, 2002 10:05 AM |To: Derick Rethans |Cc: Php Dev List; Ilia Alshanetsky; Preston L.Bannister; |Marcus Boerger; Sander Roobol |Subject: [PHP-DEV] Re: [PATCH] run-tests.php | | |At 15:37 1-11-2002, Derick Rethans wrote: | | Any objections? | |We can't object if there is no attachment :) | |?php while($i100) { echo substr('#*!$%', mt_rand(1,6), 1); |$i++; } ? | | |With kind regards, | |Melvyn Sopacua |?php include(not_reflecting_employers_views.txt); ? | -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PATCH] run-tests.php
On November 1, 2002 10:05 am, Melvyn Sopacua wrote: At 15:37 1-11-2002, Derick Rethans wrote: Any objections? We can't object if there is no attachment :) ?php while($i100) { echo substr('#*!$%', mt_rand(1,6), 1); $i++; } ? With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? Looks fine to me, +1. Ilia -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/imap finding libraries
I've added similar patch. Please test. :) (I don't have kerberos enabled in my c-client lib) --Jani On Fri, 1 Nov 2002, Marcus Boerger wrote: The following patch allows to find the kerberos libraries to be found in /usr, /usr/local, /usr/kerberos and a given path. If there are no objections i will commit this. marcus cvs -z3 -q diff ext\imap\config.m4 (in directory S:\php4-HEAD\) Index: ext/imap/config.m4 === RCS file: /repository/php4/ext/imap/config.m4,v retrieving revision 1.48 diff -u -r1.48 config.m4 --- ext/imap/config.m4 20 Aug 2002 23:08:24 - 1.48 +++ ext/imap/config.m4 1 Nov 2002 10:31:21 - -67,15 +67,20 test -d /usr/kerberos PHP_KERBEROS=/usr/kerberos fi - if test $PHP_KERBEROS != no; then -if test ! -f $PHP_KERBEROS/lib/libkrb5.a test ! -f $PHP_KERBEROS/lib/libkrb5.$SHLIB_SUFFIX_NAME; then - AC_MSG_ERROR([Kerberos libraries not found in $PHP_KERBEROS/lib. + for i in /usr /usr/local /usr/kerberos $PHP_KERBEROS; do +test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME -o -f $i/lib/libkrb5.a PHP_KERBEROS_DIR=$i + done + + if test -z $PHP_KERBEROS_DIR; then +AC_MSG_ERROR([Kerberos libraries not found. Check the path given to --with-kerberos (if no path is given, defaults to /usr/kerberos ) - ]) -fi +]) + fi + + if test $PHP_KERBEROS != no; then AC_DEFINE(HAVE_IMAP_KRB,1,[ ]) -PHP_ADD_LIBPATH($PHP_KERBEROS/lib, IMAP_SHARED_LIBADD) +PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(gssapi_krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(k5crypto, 1, IMAP_SHARED_LIBADD) -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
Ouch, I really thought you we're working on 'run-tests2.php - the web edition'. Currently there's still a number of issues being worked on, with the current CLI interface, so your fork of that version, may be premature, or you should consider working on run-tests.php for the web, without breaking it. Unless all the authors and QA team agree that the current CLI version, is 'production-ready', but given recent discussions on php-qa, I doubt that :). Another option would be, to keep run-tests2.php in there and after 4.3.0-release merge the changes? At 17:39 1-11-2002, John Coggeshall wrote: The only thing I see wrong, is perhaps that Shane and I are working on a new run-tests script (see run-tests2.php) Since the script (at least the CLI class) basically works just as well as the current run-tests.php (as far as I've seen thus far)... Well, I'm just worried your patch will end up disappearing :( All IMHO of course. John |-Original Message- |From: Melvyn Sopacua [mailto:msopacua;php.net] |Sent: Friday, November 01, 2002 10:05 AM |To: Derick Rethans |Cc: Php Dev List; Ilia Alshanetsky; Preston L.Bannister; |Marcus Boerger; Sander Roobol |Subject: [PHP-DEV] Re: [PATCH] run-tests.php | | |At 15:37 1-11-2002, Derick Rethans wrote: | | Any objections? | |We can't object if there is no attachment :) | |?php while($i100) { echo substr('#*!$%', mt_rand(1,6), 1); |$i++; } ? | | |With kind regards, | |Melvyn Sopacua |?php include(not_reflecting_employers_views.txt); ? | -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
Wait wait wait.. I think I've been misunderstood... I'm not talking about the version 4.3 release, and yes we are working on the web edition of the test script.. However, Shane (rightly so, IMHO) re-wrote run-tests (now run-tests2) and made it a class (testHarness) from which to base the web-based testing from... I've made a few changes to it (to make life easier for everyone involved) and extended that class to make the web-based version. The idea here is (at least my understanding of the idea) that run-tests2 would get production-ready (NOT for 4.3) and then replace run-tests.php (Shane, please slap me upside the head if I'm wrong here in what I thought the idea was)... As far as I'm concerned, run-tests2.php doesn't need to be in any 4.3 release (since I know the web based stuff isn't stable yet)... Am I making sense here? John |-Original Message- |From: Melvyn Sopacua [mailto:msopacua;php.net] |Sent: Friday, November 01, 2002 12:14 PM |To: [EMAIL PROTECTED] |Cc: 'Php Dev List' |Subject: RE: [PHP-DEV] Re: [PATCH] run-tests.php | | |Ouch, | |I really thought you we're working on 'run-tests2.php - the |web edition'. | |Currently there's still a number of issues being worked on, |with the current CLI interface, so your fork of that version, |may be premature, or you should consider working on |run-tests.php for the web, without breaking it. | |Unless all the authors and QA team agree that the current CLI |version, is 'production-ready', but given recent discussions |on php-qa, I doubt that :). | |Another option would be, to keep run-tests2.php in there and |after 4.3.0-release merge the changes? | |At 17:39 1-11-2002, John Coggeshall wrote: | | |The only thing I see wrong, is perhaps that Shane and I are |working on |a new run-tests script (see run-tests2.php) | |Since the script (at least the CLI class) basically works |just as well |as the current run-tests.php (as far as I've seen thus far)... Well, |I'm just worried your patch will end up disappearing :( | |All IMHO of course. | |John | | ||-Original Message- ||From: Melvyn Sopacua [mailto:msopacua;php.net] ||Sent: Friday, November 01, 2002 10:05 AM ||To: Derick Rethans ||Cc: Php Dev List; Ilia Alshanetsky; Preston L.Bannister; Marcus ||Boerger; Sander Roobol ||Subject: [PHP-DEV] Re: [PATCH] run-tests.php || || ||At 15:37 1-11-2002, Derick Rethans wrote: || || Any objections? || ||We can't object if there is no attachment :) || ||?php while($i100) { echo substr('@#*!$%', mt_rand(1,6), |1); $i++; } ||? || || ||With kind regards, || ||Melvyn Sopacua ||?php include(not_reflecting_employers_views.txt); ? || | | |-- |PHP Development Mailing List http://www.php.net/ |To unsubscribe, visit: http://www.php.net/unsub.php | |With kind regards, | |Melvyn Sopacua |?php include(not_reflecting_employers_views.txt); ? | | |-- |PHP Development Mailing List http://www.php.net/ |To unsubscribe, visit: http://www.php.net/unsub.php | | -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] ereg to pcre conversion
On Fri, 1 Nov 2002, Sander Roobol wrote: On Thu, Oct 31, 2002 at 02:47:27PM -0500, Ilia A. wrote: I would like to propose that we drop the old ereg library and use only a single regular expression library, PCRE. For BC purposes I've written a patch (see attached file), which emulates the old ereg_* functions for people who still rely on those, using PCRE. We probably have to make a bunch of tests to see if we don't break BC with this patch. If we don't break BC, and only then, I would give +1 on this patch. Too many people rely on the ereg_* functions, so IMO we really can't afford changing any behaviour. IMO if some behaviour of ereg_* is simply wrong, and this change fixes it, it's acceptable 'breaking of BC'. :) --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
At 18:23 1-11-2002, John Coggeshall wrote: Wait wait wait.. sleep(3); I think I've been misunderstood... I'm not talking about the version 4.3 release, and yes we are working on the web edition of the test script.. However, Shane (rightly so, IMHO) re-wrote run-tests (now run-tests2) and made it a class (testHarness) from which to base the web-based testing from... I've made a few changes to it (to make life easier for everyone involved) and extended that class to make the web-based version. The idea here is (at least my understanding of the idea) that run-tests2 would get production-ready (NOT for 4.3) and then replace run-tests.php (Shane, please slap me upside the head if I'm wrong here in what I thought the idea was)... Ok - so unless Shane disagrees and gets physical, run-tests.php should be in 4.3 and will have a totally different code-base than the version for php 4.4/5.0. The problem with that is, that you guys can't keep up with code changes, but only feature changes. The features addressed in the patch, are IMO important though. As far as I'm concerned, run-tests2.php doesn't need to be in any 4.3 release (since I know the web based stuff isn't stable yet)... Am I making sense here? Yep. So the real question is: how can people who commit on run-tests.php make life easier for you, so that you can keep up with feature changes? With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
On November 1, 2002 12:23 pm, John Coggeshall wrote: Wait wait wait.. I think I've been misunderstood... I'm not talking about the version 4.3 release, and yes we are working on the web edition of the test script.. However, Shane (rightly so, IMHO) re-wrote run-tests (now run-tests2) and made it a class (testHarness) from which to base the web-based testing from... What made you decide to go for the OO model of the run-tests script, there does not seem to be any advantage in adding this overhead (imho)? Ilia -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
At 18:44 01.11.2002, Ilia A. wrote: On November 1, 2002 12:23 pm, John Coggeshall wrote: Wait wait wait.. I think I've been misunderstood... I'm not talking about the version 4.3 release, and yes we are working on the web edition of the test script.. However, Shane (rightly so, IMHO) re-wrote run-tests (now run-tests2) and made it a class (testHarness) from which to base the web-based testing from... What made you decide to go for the OO model of the run-tests script, there does not seem to be any advantage in adding this overhead (imho)? More important is that there are differences in ZE1 ZE2 but besides those problems i think this makes handling of different sapis easier. marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
|Ok - so unless Shane disagrees and gets physical, |run-tests.php should be in 4.3 and will have a totally |different code-base than the version for php 4.4/5.0. Exactly. |The features addressed in the patch, are IMO important though. I haven't looked at the patch in great detail, can someone forward me The commitlog? |Yep. |So the real question is: how can people who commit on |run-tests.php make life easier for you, so that you can keep |up with feature changes? Well, I think perhaps the best bet is to make sure we keep good communication Open on any work done in run-tests, so that run-tests2 keeps up with the pace.. Cheers, John s | |With kind regards, | |Melvyn Sopacua |?php include(not_reflecting_employers_views.txt); ? | | |-- |PHP Development Mailing List http://www.php.net/ |To unsubscribe, visit: http://www.php.net/unsub.php | | -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
|What made you decide to go for the OO model of the run-tests |script, there |does not seem to be any advantage in adding this overhead (imho)? There is most definitely an advantage. Using the OO model, we essentially created A test engine which had some default output code (direct to stdout) and ran all of The desired tests... It basically runs just like the current run-tests.php script (maybe Not as many pretty colors, etc). The reason the OO is cool though, is when we want to port that test script into another Medium or output it in a different format such as HTML. I just created a new object which Extended the base class and overload some of the functions (such as showstatus() which is Called every time a test passes/fails) to generate HTML output instead of text.. It's not done yet, but the plan I have here is to actually abstract run_tests() a step Further into run_test() and execute_test(), where execute_test() can be overloaded by Another class as well (to change the way a particlar test is executed seamlessly -- i.e. Via a HTTP request instead of a CLI command)... Making sense? John -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
At 19:02 1-11-2002, John Coggeshall wrote: I haven't looked at the patch in great detail, can someone forward me The commitlog? It hasn't been committed yet, as we agreed that only persons in 'Authors' should do that and agree, otherwise it'll be a mess. |Yep. |So the real question is: how can people who commit on |run-tests.php make life easier for you, so that you can keep |up with feature changes? Well, I think perhaps the best bet is to make sure we keep good communication Open on any work done in run-tests, so that run-tests2 keeps up with the pace.. Solid log messages and subscribing to php-cvs should be very usefull then :) With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
Ok - so unless Shane disagrees and gets physical, /me jumps around screaming after hiking up a large mountain carrying 2 40lb. boulders...physical enough? :) run-tests.php should be in 4.3 and will have a totally different code-base than the version for php 4.4/5.0. I don't expect we'll be done with the new test stuff in time for 4.3unless 4.3 takes *way too long* to get out. My personal goal with this is to have at least some kind of automated thread based testing for 5, and some way to test through sapi modules. The problem with that is, that you guys can't keep up with code changes, but only feature changes. The features addressed in the patch, are IMO important though. I'm more concerned about getting the architecture of the test system flexible enough to have different test modes (as John has described on this thread). If the layout is right, features should not be hard to backport into the new stuff. But we can also try to keep up with the new features as we go along to lessen any issues that may arise. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
On November 1, 2002 01:08 pm, John Coggeshall wrote: |What made you decide to go for the OO model of the run-tests |script, there |does not seem to be any advantage in adding this overhead (imho)? There is most definitely an advantage. Using the OO model, we essentially created A test engine which had some default output code (direct to stdout) and ran all of The desired tests... It basically runs just like the current run-tests.php script (maybe Not as many pretty colors, etc). The reason the OO is cool though, is when we want to port that test script into another Medium or output it in a different format such as HTML. I just created a new object which Extended the base class and overload some of the functions (such as showstatus() which is Called every time a test passes/fails) to generate HTML output instead of text.. In the most basic form testing process consists of 4 parts. Executing the script, parsing output, comparing the output to the expected output and comparing the results. Ideally (imho) the process would look something like this pseudo code: function execute_test(test, MODE) { $test_data = init_test(test); $result = run_test(test_script, MODE); $test_output = fetch_test_output($result, MODE); $bool_status = compare_output($test_output, $test_data['expected_output']); return_output($bool_status, $test_data, $test_output, MODE); } The MODE would indicate the mode of operation (cli/cgi/webserver and so on), each step where the MODE is relevant would then have a switch to determine which function should be executed at this point. So, if MODE is cli, we'd run cli_run_test() and similarly if the MODE is web, we'd run web_run_test(). This would make a simpler test, which would not need to rely on more advanced features like OO, which may change in their functionality once ZE2 comes around, as Marcus had pointed out. Since at this point we could have people running both ZE1 and ZE2 use the test, I think relying on OO is dangerous. My reasoning is that considering the simplicity of the testing 'engine', we do not need to add the OO layer of obfuscation. Now, I am not a big fan of OO, so my opinion on the matter maybe somewhat skewed in that regard, non Ilia -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
On Fri, 1 Nov 2002, Melvyn Sopacua wrote: At 15:37 1-11-2002, Derick Rethans wrote: Any objections? We can't object if there is no attachment :) ?php while($i100) { echo substr('#*!$%', mt_rand(1,6), 1); $i++; } ? Looks fine to me. Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PATCH] run-tests.php
On Fri, 1 Nov 2002, John Coggeshall wrote: The only thing I see wrong, is perhaps that Shane and I are working on a new run-tests script (see run-tests2.php) Since the script (at least the CLI class) basically works just as well as the current run-tests.php (as far as I've seen thus far)... Well, I'm just worried your patch will end up disappearing :( IMO the new script should not be used to QA PHP 4.x, but it should be replace it when we're heading for 5. It's really getting a bitch to make sure the testscript stays stable anyway. Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PATCH] run-tests.php
This would make a simpler test, which would not need to rely on more advanced features like OO, which may change in their functionality once ZE2 comes around, as Marcus had pointed out. Since at this point we could have people running both ZE1 and ZE2 use the test, I think relying on OO is dangerous. My reasoning is that considering the simplicity of the testing 'engine', we do not need to add the OO layer of obfuscation. Now, I am not a big fan of OO, so my opinion on the matter maybe somewhat skewed in that regard, non Ilia The basics of php OO, which is all that will get used, doesn't change enough between ze1 and ze2 to warrent any worry about it. If it does become an issue then we'll deal with it, but I find that highly unlikely. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ZE2 configure
The build system complains that LIBZEND_DLSYM_CHECK is not available. Should this be provided in Zend/Zend.m4? marcus cvs -z3 -q diff Zend\Zend.m4 (in directory S:\php4-HEAD\) Index: Zend/Zend.m4 === RCS file: /repository/ZendEngine2/Zend.m4,v retrieving revision 1.35 diff -u -r1.35 Zend.m4 --- Zend/Zend.m423 Aug 2002 22:11:10 - 1.35 +++ Zend/Zend.m41 Nov 2002 20:17:36 - -230,3 +230,6 ]) +AC_DEFUN(LIBZEND_DLSYM_CHECK,[ + +])
Re: [PHP-DEV] ext/imap finding libraries
Your version is a bit nicer work, too. marcus At 17:46 01.11.2002, Jani Taskinen wrote: I've added similar patch. Please test. :) (I don't have kerberos enabled in my c-client lib) --Jani On Fri, 1 Nov 2002, Marcus Boerger wrote: The following patch allows to find the kerberos libraries to be found in /usr, /usr/local, /usr/kerberos and a given path. If there are no objections i will commit this. marcus cvs -z3 -q diff ext\imap\config.m4 (in directory S:\php4-HEAD\) Index: ext/imap/config.m4 === RCS file: /repository/php4/ext/imap/config.m4,v retrieving revision 1.48 diff -u -r1.48 config.m4 --- ext/imap/config.m4 20 Aug 2002 23:08:24 - 1.48 +++ ext/imap/config.m4 1 Nov 2002 10:31:21 - -67,15 +67,20 test -d /usr/kerberos PHP_KERBEROS=/usr/kerberos fi - if test $PHP_KERBEROS != no; then -if test ! -f $PHP_KERBEROS/lib/libkrb5.a test ! -f $PHP_KERBEROS/lib/libkrb5.$SHLIB_SUFFIX_NAME; then - AC_MSG_ERROR([Kerberos libraries not found in $PHP_KERBEROS/lib. + for i in /usr /usr/local /usr/kerberos $PHP_KERBEROS; do +test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME -o -f $i/lib/libkrb5.a PHP_KERBEROS_DIR=$i + done + + if test -z $PHP_KERBEROS_DIR; then +AC_MSG_ERROR([Kerberos libraries not found. Check the path given to --with-kerberos (if no path is given, defaults to /usr/kerberos ) - ]) -fi +]) + fi + + if test $PHP_KERBEROS != no; then AC_DEFINE(HAVE_IMAP_KRB,1,[ ]) -PHP_ADD_LIBPATH($PHP_KERBEROS/lib, IMAP_SHARED_LIBADD) +PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(gssapi_krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(krb5, 1, IMAP_SHARED_LIBADD) PHP_ADD_LIBRARY(k5crypto, 1, IMAP_SHARED_LIBADD) -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: jstarkey
Steph asked me to apply via this form. I'll be helping with the PHP-Gtk manual. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: lhl
Would like an account to contribute to the pres2 system. Have experience in advanced DOM/CSS2 work. Also would like to help in improving XML tagging syntax, features to the project. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] ereg to pcre conversion
On Fri, 2002-11-01 at 18:28, Jani Taskinen wrote: On Fri, 1 Nov 2002, Sander Roobol wrote: On Thu, Oct 31, 2002 at 02:47:27PM -0500, Ilia A. wrote: I would like to propose that we drop the old ereg library and use only a single regular expression library, PCRE. For BC purposes I've written a patch (see attached file), which emulates the old ereg_* functions for people who still rely on those, using PCRE. We probably have to make a bunch of tests to see if we don't break BC with this patch. If we don't break BC, and only then, I would give +1 on this patch. Too many people rely on the ereg_* functions, so IMO we really can't afford changing any behaviour. IMO if some behaviour of ereg_* is simply wrong, and this change fixes it, it's acceptable 'breaking of BC'. :) Such as? - Stig -- Stig Sæther Bakken, Fast Search Transfer ASA, Trondheim, Norway http://pear.php.net/wishlist.php/ssb -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: cvs: php4 /ext/iconv config.m4
On Fri, 2002-11-01 at 01:47, Yasuo Ohgaki wrote: Moriyoshi Koizumi wrote: moriyoshi Thu Oct 31 15:23:53 2002 EDT Modified files: /php4/ext/iconv config.m4 Log: Fixed library capability detection behaviour. # Whew! I've fixed all the known problems. # And should I become a maintainer of this module? Sounds good to me, but Ask Rui and Stig. It's not even listed in EXTENSIONS. Feel free :-) - Stig -- Stig Sæther Bakken, Fast Search Transfer ASA, Trondheim, Norway http://pear.php.net/wishlist.php/ssb -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard css.c
On Wed, 2002-10-09 at 09:35, Yasuo Ohgaki wrote: Colin Viebrock wrote: I really think the best solution (not perfect, but best) is to specify some fonts so the pages look nice, and hard code in the ISO-8859-1 font hard code in the ISO-8859-1 font means assuming ISO 8859-1 and use ISO 8859-1 type face by converting chars to entities? Take a look at this page, for example. http://czyborra.com/charsets/iso8859.html Do you see converting text to entity assuming ISO 8859-1 breaks not only multibyte encoding but also other ISO 8859 encoding? I'm well aware of that I'm suggesting to make phpinfo() non XHTML, since it is more useful if it is not confirm XHTML perfectly. If use of HTML entities are preferred, only text that needs HTML entities should use entities. e.g. Names. Isn't using entities for names or like enough? Please no automatic entity conversion assuming ISO 8859-1. Thanks. A bit late, but I'd like to throw in my .02EUR. When dealing with multiple languages, the only reasonable charset to support internally is Unicode, encoded in utf-8. Now, while MSIE supports utf-8, it doesn't sent the Accept-Encoding header. NS4 is AFAIK the only browser that explicitly announces being able to handle utf-8 in the request, but it's not a big issue to figure out if the user agent is from a browser that can deal with utf-8. The real solution would be using iconv on the output buffer to change the utf-8 to whatever charset the browser prefers, or if iconv is not available, try converting to 8859-1 and replace characters that don't fit to ?. IMHO this is the only thing that will work for everyone. - Stig -- Stig Sæther Bakken, Fast Search Transfer ASA, Trondheim, Norway http://pear.php.net/wishlist.php/ssb -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard css.c
At 01:40 02.11.2002, Stig S. Bakken wrote: On Wed, 2002-10-09 at 09:35, Yasuo Ohgaki wrote: Colin Viebrock wrote: I really think the best solution (not perfect, but best) is to specify some fonts so the pages look nice, and hard code in the ISO-8859-1 font hard code in the ISO-8859-1 font means assuming ISO 8859-1 and use ISO 8859-1 type face by converting chars to entities? Take a look at this page, for example. http://czyborra.com/charsets/iso8859.html Do you see converting text to entity assuming ISO 8859-1 breaks not only multibyte encoding but also other ISO 8859 encoding? I'm well aware of that I'm suggesting to make phpinfo() non XHTML, since it is more useful if it is not confirm XHTML perfectly. If use of HTML entities are preferred, only text that needs HTML entities should use entities. e.g. Names. Isn't using entities for names or like enough? Please no automatic entity conversion assuming ISO 8859-1. Thanks. A bit late, but I'd like to throw in my .02EUR. When dealing with multiple languages, the only reasonable charset to support internally is Unicode, encoded in utf-8. Now, while MSIE supports utf-8, it doesn't sent the Accept-Encoding header. NS4 is AFAIK the only browser that explicitly announces being able to handle utf-8 in the request, but it's not a big issue to figure out if the user agent is from a browser that can deal with utf-8. The real solution would be using iconv on the output buffer to change the utf-8 to whatever charset the browser prefers, or if iconv is not available, try converting to 8859-1 and replace characters that don't fit to ?. IMHO this is the only thing that will work for everyone. Since mbstring is better integrated in php i HOPE that will be done by mbstring (and it is not even dependant on another library). marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: guifox
gfdgddstretryytuyyuyiitt -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] CVS Account Request: guifox
At 02:09 2-11-2002, guifox wrote: gfdgddstretryytuyyuyiitt Sorry, welsh is not considered an official language, so no translators are requested at this time. Thank you for you interest in PHP. Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Configure Error's
Ok, under 4.2.3 or 4.0.3pre2, when running the configure line: ./configure --prefix=/usr/local/php_4.2.3 --without-mysql --disable-session --disable-pcre-regex --disable-xml Everything seems to go fine, till the end where it says: creating ./config.status creating php4.spec sed: file conftest.s1 line 4: Unterminated `s' command creating Zend/Makefile sed: file conftest.s1 line 4: Unterminated `s' command creating main/build-defs.h sed: file conftest.s1 line 4: Unterminated `s' command creating pear/scripts/pear sed: file conftest.s1 line 4: Unterminated `s' command creating pear/scripts/phpize sed: file conftest.s1 line 4: Unterminated `s' command creating pear/scripts/php-config sed: file conftest.s1 line 4: Unterminated `s' command creating pear/scripts/pearize sed: file conftest.s1 line 4: Unterminated `s' command creating pear/scripts/phptar sed: file conftest.s1 line 4: Unterminated `s' command creating TSRM/Makefile sed: file conftest.s1 line 4: Unterminated `s' command creating main/php_config.h fastgen.sh: creating sapi/Makefile Now, here's where the versions differ, with 4.3.0pre2, I can still type make and it appears to be compiling ok, but when I do make after those error's on 4.2.3, I get: Making all in Zend make[1]: Entering directory `/usr/local/php/php-4.2.3/Zend' make[1]: *** No rule to make target `all'. Stop. make[1]: Leaving directory `/usr/local/php/php-4.2.3/Zend' Any idea's? Adam Voigt [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZE2 configure
Some people don't bother doing MFZE1... --Jani On Fri, 1 Nov 2002, Marcus Boerger wrote: The build system complains that LIBZEND_DLSYM_CHECK is not available. Should this be provided in Zend/Zend.m4? marcus cvs -z3 -q diff Zend\Zend.m4 (in directory S:\php4-HEAD\) Index: Zend/Zend.m4 === RCS file: /repository/ZendEngine2/Zend.m4,v retrieving revision 1.35 diff -u -r1.35 Zend.m4 --- Zend/Zend.m423 Aug 2002 22:11:10 - 1.35 +++ Zend/Zend.m41 Nov 2002 20:17:36 - -230,3 +230,6 ]) +AC_DEFUN(LIBZEND_DLSYM_CHECK,[ + +]) -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Problem w/ upgrade to 4.2.3
Just installed 4.2.3 from 4.2.2. Now when I have a PHP script that takes some time to process it will wait to send any of the HTML to the client. On 4.2.2 I could just include the PHP code after the HTML that I wanted to display, it would display the HTML before the PHP and when the PHP had finished it would display the rest of the HTML. Now it just waits for the PHP to finish to display ANY of the HTML on the page. What gives? Does anyone know if this is the proper behavior? Or is it proper now and was broken before? And I just happened to take advantage of it. Any input would be helpful. Thanks, Adam -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] ereg to pcre conversion
I somehow don't like the idea. Mostly because I fear we introduce some BC change regarding to the ereg* functionality we yet do not forsee which brings us in the end more trouble (i.e. use complaining) then it's really worth. Just let ereg* functions stay where they are, if people complain because something doesn't work, rather tell them to use the pcre* family. After your patch, how sure can you be that all ereg* pattern will work without any trouble? This would mean testing many use apps out there ... is it worth the work? Also, I haven't seen much maintainance needed in the both the existing regular expression code. I simply don't see a reason to change the inner functionality and risk to introduce BC problems. Also I don't see a reason to drop the ereg* function in some future point (I see the point with emulating them, but see above). -1 On Thu, Oct 31, 2002 at 02:47:27PM -0500, Ilia A. wrote : Currently PHP ships with two regular expression libraries that are both installed by default, PCRE regex. The regex library that is responsible for ereg_* functions is fairly old and offers a very limited functionality compared to the PCRE library. In most cases the PCRE functions are also much faster then the old ereg functions. I would like to propose that we drop the old ereg library and use only a single regular expression library, PCRE. For BC purposes I've written a patch (see attached file), which emulates the old ereg_* functions for people who still rely on those, using PCRE. This cleanup would mean we'd only need to maintain one set of regular expression code, which as far as code goes is pretty complex as well as give speed-up for people still using ereg. Perhaps, at some future point this would allow us to drop the ereg_* functions all together. Ilia Index: pcre/php_pcre.c === RCS file: /repository/php4/ext/pcre/php_pcre.c,v retrieving revision 1.130 diff -u -3 -p -r1.130 php_pcre.c --- pcre/php_pcre.c 24 Oct 2002 19:06:19 - 1.130 +++ pcre/php_pcre.c 31 Oct 2002 13:57:58 - -553,6 +553,110 static void php_pcre_match(INTERNAL_FUNC } /* }}} */ +/* {{{ ereg_to_pcre_convert +*/ +static inline zval *ereg_to_pcre_convert(zval **reg_expr, int case_sens) +{ + char *p, *pp; + int extra_len = 3; + zval *new_reg; + + if (case_sens) { + extra_len++; + } + + MAKE_STD_ZVAL(new_reg); + + Z_STRVAL_P(new_reg) = emalloc(Z_STRLEN_PP(reg_expr) * 2 + extra_len + 1); + Z_TYPE_P(new_reg) = IS_STRING; + + pp = Z_STRVAL_PP(reg_expr); + p = Z_STRVAL_P(new_reg); + + *p++ = '/'; + while (*pp) { + if (*pp != '/') { + *p++ = *pp; + } else { + *p++ = '\\'; + *p++ = '/'; + extra_len++; + } + pp++; + } + + *p++ = '/'; + if (case_sens) { + *p++ = 'i'; + } + *p++ = 's'; + *p = '\0'; + + Z_STRLEN_P(new_reg) = Z_STRLEN_PP(reg_expr) + extra_len; + + return new_reg; +} +/* }}} */ + +/* {{{ php_pcre_ereg_match +*/ +static void php_pcre_ereg_match(INTERNAL_FUNCTION_PARAMETERS, int case_sens) +{ + zval **old_regex, **m_string, **subpats = NULL; + zval **args[3]; + zval *retval, *pcre_func, *new_regx; + + int argc = ZEND_NUM_ARGS(); + + if ((argc != 2 argc != 3) || (zend_get_parameters_ex(argc, old_regex, m_string, subpats) == FAILURE)) { + WRONG_PARAM_COUNT; + } + + MAKE_STD_ZVAL(pcre_func); + ZVAL_STRING(pcre_func, preg_match, 1); + + convert_to_string_ex(old_regex); + + new_regx = ereg_to_pcre_convert(old_regex, case_sens); + + args[0] = new_regx; + args[1] = m_string; + args[2] = subpats; + + if (call_user_function_ex(EG(function_table), NULL, pcre_func, retval, argc, args, 0, NULL TSRMLS_CC) == SUCCESS) { + if (Z_LVAL_P(retval)) { + RETVAL_TRUE; + } else { + RETVAL_FALSE; + } + } else { + RETVAL_FALSE; + } + + zval_dtor(new_regx); + FREE_ZVAL(new_regx); + zval_dtor(pcre_func); + FREE_ZVAL(pcre_func); + FREE_ZVAL(retval); +} +/* }}} */ + +/* {{{ proto int ereg(string pattern, string string [, array registers]) + Regular expression match */ +PHP_FUNCTION(ereg) +{ + php_pcre_ereg_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); +} +/* }}} */ + +/* {{{ proto int eregi(string pattern, string string [, array registers]) + Case-insensitive regular expression match */ +PHP_FUNCTION(eregi) +{ + php_pcre_ereg_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); +} +/*