Re: [PHP-DEV] Constanst are case-insensitive
You can't have two constants with the same string but different case sensitivity. It's a limitation of the current implementation. Zeev At 09:03 05/08/2001, Andrei Zmievski wrote: At 06:34 PM 8/4/01 +0300, Zeev Suraski wrote: If you register the constant with CONST_CS, it will be case sensitive. Most of the constants in PHP are case sensitive. But it doesn't work. I register GDK_A with CONST_CS and then when I try to register GDK_a with CONST_CS as well it complains that it's already registered. Try it yourself. -Andrei -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12573: URGENT: Can't start Netscape Enterprise 3.6 web server
From: [EMAIL PROTECTED] Operating system: Solaris 2.6 PHP version: 4.0.6 PHP Bug Type: *Web Server problem Bug description: URGENT: Can't start Netscape Enterprise 3.6 web server I compiled php4 (as an nsapi module) in solaris 2.6 server running netscape enterprise 3.6 web server. I followed all the instructions in the installation guide of php.net. I add the mime type and configure obj.conf. I already double checked teh changes i made but i'm still getting this error message: pclose() failed (2 unknown early startup error) i already searched it on the web but i still haven't got any solution. I need to run the web server immediately. Please help!!! Thanks in advance. -- Edit bug report at: http://bugs.php.net/?id=12573edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: Bug #12241 Updated: imap.so: undefined symbol:
On Wed, 01 Aug 2001 03:04:29 +0200, Jani Taskinen [EMAIL PROTECTED] wrote: I guess this problem exists only when it's configured as shared extension? If so, I know how to fix it.. I just tried the latest snapshot. Now everything works. One last strange thing: The shared imap extension used to be called imap.so. Now it's called imap.a. Personally, I don't care, but maybe it will cause some confusion and a new wave of bug reports because people aren't aware that their php.ini files need to be adjusted. -- Greetings from Troels Arvin, Copenhagen, Denmark -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12574: Documented void session_end() doesn't exist
From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.0.6 PHP Bug Type: Session related Bug description: Documented void session_end() doesn't exist The manual states: Description void session_end () End the current session and store session data. Calling gives: Fatal error: Call to undefined function: session_end() in -- Edit bug report at: http://bugs.php.net/?id=12574edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Shared imap extension..
On Sun, 5 Aug 2001, Troels Arvin wrote: On Wed, 01 Aug 2001 03:04:29 +0200, Jani Taskinen [EMAIL PROTECTED] wrote: I guess this problem exists only when it's configured as shared extension? If so, I know how to fix it.. I just tried the latest snapshot. Now everything works. Good. One last strange thing: The shared imap extension used to be called imap.so. Now it's called imap.a. Personally, I don't care, but maybe it will cause some What was your configure line? It should create a .so NOT .a (works for me) Did you use phpize? Was it the phpize greated by latest CVS? Was php-config correct one? --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] SOCKS support
I implemented socks support ( with redundant proxies as well) for php. How can I submit the code for inclusion in the code base? Thanks Paolo Prandini S.P.E.Sistemi e Progetti Elettronici s.a.s. Via Liguria 5 I-25125 Brescia (BS) Tel +39 0302427266 Fax +39 0302449252 Email [EMAIL PROTECTED] World Wide Web http://www.spe.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Shared imap extension..
On Sun, 05 Aug 2001 11:52:02 +0200, Jani Taskinen [EMAIL PROTECTED] wrote: The shared imap extension used to be called imap.so. Now it's called imap.a. Personally, I don't care, but maybe it will cause some What was your configure line? It should create a .so NOT .a (works for me) See below. Did you use phpize? No. PHP code-base: PHP-snapshot php4-200108050135 Imap-devel package: 2000c. The package was built with ssl-support, but without kerberos support, see http://rpms.arvin.dk/imap-no_kerberos/ (Based on Red Hat Rawhide, but without Kerberos stuff.) Contents of config.nice: --- #! /bin/sh # # Created by configure CFLAGS='-O2 -march=i686' \ CXXFLAGS='-O2 -march=i686' \ './configure' \ '--prefix=/home/troels/local-php' \ '--without-mysql' \ '--disable-session' \ '--disable-xml' \ '--with-imap=shared' \ '--with-imap-ssl' \ '--without-pcre-regex' \ $@ --- Output from ./configure, relevant to this issue: --- ... checking for IMAP support... yes, shared ... creating ext/imap/Makefile ... --- Output from make, relevant to this issue: --- ... make[1]: Entering directory `/home/troels/temp2/php4-200108050135/ext' Making all in imap make[2]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' make[2]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' ... Making install in imap make[2]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Nothing to be done for `install-p'. make[3]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' make[2]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' ... --- The imap.a file contains one object-file: php_imap.o Content of ext/imap/libs.mk: --- include $(top_builddir)/config_vars.mk LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) LTLIBRARY_SHARED_OBJECTS = $(LTLIBRARY_OBJECTS:.lo=.slo) $(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_SHARED_OBJECTS) $(LTLIBRARY_DEPENDENCIES) $(SHARED_LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD) $(SHARED_LIBTOOL) --mode=install cp $@ $(phplibdir) targets = $(LTLIBRARY_SHARED_NAME) --- Content of ext/imap/imap.la: --- # imap.la - a libtool library file # Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18) # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='' # Names of this library. library_names='' # The name of the static archive. old_library='imap.a' # Libraries that this one depends upon. dependency_libs=' -lcrypto -lssl -lc-client' # Version information for imap. current=0 age=0 revision=0 # Is this an already installed library? installed=no # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='/home/troels/temp2/php4-200108050135/modules' --- Content of ext/imap/Makefile: --- top_srcdir = /home/troels/temp2/php4-200108050135 top_builddir = /home/troels/temp2/php4-200108050135 srcdir = /home/troels/temp2/php4-200108050135/ext/imap builddir = /home/troels/temp2/php4-200108050135/ext/imap VPATH= /home/troels/temp2/php4-200108050135/ext/imap LTLIBRARY_NAME= libimap.la LTLIBRARY_SOURCES = php_imap.c LTLIBRARY_SHARED_NAME = imap.la LTLIBRARY_SHARED_LIBADD = $(IMAP_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk --- -- Greetings from Troels Arvin, Copenhagen, Denmark -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Shared imap extension..
On Sun, 05 Aug 2001 11:52:02 +0200, Jani Taskinen [EMAIL PROTECTED] wrote: The shared imap extension used to be called imap.so. Now it's called imap.a. Personally, I don't care, but maybe it will cause some What was your configure line? It should create a .so NOT .a (works for me) See below. Did you use phpize? No. PHP code-base: PHP-snapshot php4-200108050135 Imap-devel package: 2000c. The package was built with ssl-support, but without kerberos support, see http://rpms.arvin.dk/imap-no_kerberos/ (Based on Red Hat Rawhide, but without Kerberos stuff.) Contents of config.nice: --- #! /bin/sh # # Created by configure CFLAGS='-O2 -march=i686' \ CXXFLAGS='-O2 -march=i686' \ './configure' \ '--prefix=/home/troels/local-php' \ '--without-mysql' \ '--disable-session' \ '--disable-xml' \ '--with-imap=shared' \ '--with-imap-ssl' \ '--without-pcre-regex' \ $@ --- Output from ./configure, relevant to this issue: --- ... checking for IMAP support... yes, shared ... creating ext/imap/Makefile ... --- Output from make, relevant to this issue: --- ... make[1]: Entering directory `/home/troels/temp2/php4-200108050135/ext' Making all in imap make[2]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' make[2]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' ... Making install in imap make[2]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Entering directory `/home/troels/temp2/php4-200108050135/ext/imap' make[3]: Nothing to be done for `install-p'. make[3]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' make[2]: Leaving directory `/home/troels/temp2/php4-200108050135/ext/imap' ... --- The imap.a file contains one object-file: php_imap.o Content of ext/imap/libs.mk: --- include $(top_builddir)/config_vars.mk LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) LTLIBRARY_SHARED_OBJECTS = $(LTLIBRARY_OBJECTS:.lo=.slo) $(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_SHARED_OBJECTS) $(LTLIBRARY_DEPENDENCIES) $(SHARED_LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD) $(SHARED_LIBTOOL) --mode=install cp $@ $(phplibdir) targets = $(LTLIBRARY_SHARED_NAME) --- Content of ext/imap/imap.la: --- # imap.la - a libtool library file # Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18) # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='' # Names of this library. library_names='' # The name of the static archive. old_library='imap.a' # Libraries that this one depends upon. dependency_libs=' -lcrypto -lssl -lc-client' # Version information for imap. current=0 age=0 revision=0 # Is this an already installed library? installed=no # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='/home/troels/temp2/php4-200108050135/modules' --- Content of ext/imap/Makefile: --- top_srcdir = /home/troels/temp2/php4-200108050135 top_builddir = /home/troels/temp2/php4-200108050135 srcdir = /home/troels/temp2/php4-200108050135/ext/imap builddir = /home/troels/temp2/php4-200108050135/ext/imap VPATH= /home/troels/temp2/php4-200108050135/ext/imap LTLIBRARY_NAME= libimap.la LTLIBRARY_SOURCES = php_imap.c LTLIBRARY_SHARED_NAME = imap.la LTLIBRARY_SHARED_LIBADD = $(IMAP_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk --- -- Greetings from Troels Arvin, Copenhagen, Denmark -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Portability concerns
On Saturday 04 August 2001 22:06, Stig Sæther Bakken wrote: Say PHP had a function to put it in portable mode changing the behaviour of a few functions. Then for example PEAR classes would have to deal with running both with and without this mode, since the user can enable or disable it at will. So this would in fact add complexity to the process of writing portable PHP code. No this isn't the case. You can drop in and out of this mode in your own code, so PEAR classes would switch into it and there would be no problem. I think André is right that it's better to educate users (for example by telling them to disable magic_quotes :-). I agree about the education bit as well, but I think it would be good to have a mechanism that help to future proof old code for when the rules changed. Cheers -- Phil Driscoll -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12341 Updated: Don't is appears the object
ID: 12341 Updated by: phanto Reported By: [EMAIL PROTECTED] Old Status: Feedback Status: Closed Bug Type: COM related Operating System: NT 4.0 WorkStation PHP Version: 4.0.6 New Comment: if the webserver runs as service it doesn't have access to the userspace (e.g. the desktop). if you want to open a window you have to execute php from the command line. harald Previous Comments: [2001-07-24 14:19:44] [EMAIL PROTECTED] I thought this is what the commands were supposed to do. If you wanted to open word wouldn't you do something like this: exec(c:\path\to\winword); [2001-07-24 12:17:04] [EMAIL PROTECTED] Did the document save correctly? [2001-07-24 10:43:11] [EMAIL PROTECTED] A take a sample of function COM. $word = new COM(word.application) or die(Unable to instanciate Word); print Loaded Word, version {$word-Version}\n; $word-Visible = 1; // command that show window $word-Documents-Add(); $word-Selection-TypeText(This is a test...); $word-Documents[1]-SaveAs(Useless test.doc); The commands execute, but the window of word don't appears. I make a test with Autocad too, but the window don't appears. When a had a ohter version PHP, don't remember, the window appears thanks Luiz Fernando Edit this bug report at http://bugs.php.net/?id=12341edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12471 Updated: DCOM don't running
ID: 12471 Updated by: phanto Reported By: [EMAIL PROTECTED] Status: Open Bug Type: COM related Operating System: PHP Version: 4.0.5 New Comment: could you provide a short code snippet and your settings in the [com] ini section. Previous Comments: [2001-07-30 14:28:28] [EMAIL PROTECTED] Teste PHP COM/DCOM Warning: Unable to obtain IDispatch interface for CLSID {B3017363-43C6-11D5-9848-00E04C3919F8}: O servidor de RPC não está disponível. in C:\Inetpub\wwwroot\Dcom_remote.php on line 22 Objeto COM não instânciado! Edit this bug report at http://bugs.php.net/?id=12471edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12126 Updated: the com example 1 does not work
ID: 12126 Updated by: phanto Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: COM related Operating System: 2k PHP Version: 4.0.6 New Comment: is anyone able to reproduse this ? works fine for me with word xp (v10.0). reopen if this still happens with the latest cvs version. Previous Comments: [2001-07-13 01:34:30] [EMAIL PROTECTED] From page: http://www.php.net/manual/en/class.com.php example 1 loads word (v.9) okay but then returns the following errors: Loaded Word, version 9.0 Warning: Invoke() failed: No description available in C:\host\test\word.php on line 9 Warning: Invoke() failed: Exception occurred. in C:\host\test\word.php on line 13 Fatal error: NULL pointer exception in C:\host\test\word.php on line 13 Edit this bug report at http://bugs.php.net/?id=12126edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12575: Session register destroy flaws/bugs(?)
From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.0.6 PHP Bug Type: Session related Bug description: Session register destroy flaws/bugs(?) Whilst the PHP session support is a great feature, handling session state as of 4.0.6 is inconsistent and arguably flawed and has some gotchas, as illustrated in the two scripts after these details. There are workarounds which I'll explain. This assumes track vars enabled, as it always is since 4.0.3 anyway, and register globals is enabled. In summary 1) Registering a global with session_register() doesn't update $HTTP_SESSION_VARS until the session is restored, so don't use $HTTP_SESSION_VARS for accessing intra-session state changes unless you set $HTTP_SESSION_VARS as well as your global. 2) Destroying a session doesn't reset the state of $HTTP_SESSION_VARS. Ouch! Creating a new session immediately afterwards does work as expected though, and produces a clean session. 3) BUT, destroying a session never unsets the state of registered globals. Ouch again! So be wary of using globals rather than HTTP_SESSION_VARS for getting at session state if you ever conditionally destroy sessions and subsequently access session data, unless of course you explicitly unset your globals too. Executing x.php then y.php illustrate the problems. The output is: Assert failed: OOPS, foo session var is unset Assert failed: OOPS, foo session var still set on destroyed session Assert failed: OOPS, global foo is still set x.php: ?php // -*- c++ -*- // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Get a clean session session_start(); session_destroy(); session_start(); // Style 1. We use HTTP_SESSION_VARS to access session state // This works fine for a restored session, but intra-session // it doesn't. e.g. $foo = 'bar'; // Set it session_register('foo');// Register global // Assert fails - foo isn't a useable session variable (yet) after all myassert(isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var is unset); ? y.php: ?php // -*- c++ -*- ob_start(); // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Restore session with foo set from x.php session_start(); // Style 2. As HTTP_SESSION_VARS doesn't get set intra-session, lets // try using globals as our session mechanism instead. myassert(isset($foo), Global foo not restored); // OK. global restored myassert(isset($HTTP_SESSION_VARS['foo']), Session foo not restored); // OK // Now lets try destroying the session as, for example, our script was // passed a logout request somehow session_destroy(); // This should do it myassert(!isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var still set on destroyed session); // FAILS session_start(); myassert(!isset($HTTP_SESSION_VARS['foo']), foo session var still set on destroyed session); // OK, not it's not // But remember that we decided to use globals because of the problems with // HTTP_SESSION_VARS not being updated intra-session, well lets check the // state of our global $foo myassert(!isset($foo), OOPS, global foo is still set); /// FAILS, oh dear! ob_end_flush(); ? -- Edit bug report at: http://bugs.php.net/?id=12575edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: gmp_init with a base argument
On Thu, 02 Aug 2001 19:16:26 +0200, Stanislav Malyshev [EMAIL PROTECTED] wrote: on the quick glance your patch looks OK. OK. It seems that I don't have sufficient karma. I tried to commit the below patch with the following commit message: (gmp_init) Added extra (optional) argument to gmp_init(): a base argument which indicates the number base. E.g.: gmp_init('1010101010',2); // feed gmp a binary value. @- Added optional extra argument to gmp_init(). The extra argument @ indicates which number base gmp should use when converting a @ string to the gmp-number. (Troels) Suggested patch is attached below (the patch is against current CVS). /Troels --- php4-orig/ext/gmp/gmp.c Sun Aug 5 12:51:42 2001 +++ php4/ext/gmp/gmp.c Sun Aug 5 13:24:02 2001 @@ -178,7 +178,7 @@ if(Z_TYPE_PP(zval) == IS_RESOURCE) { \ ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ } else {\ - if(convert_to_gmp(gmpnumber,zval) == FAILURE) {\ + if(convert_to_gmp(gmpnumber,zval,0) == FAILURE) {\ RETURN_FALSE;\ }\ ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ @@ -190,7 +190,7 @@ /* {{{ convert_to_gmp * Convert zval to be gmp number */ -static int convert_to_gmp(mpz_t * *gmpnumber, zval **val) +static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base) { int ret = 0; @@ -207,11 +207,14 @@ case IS_STRING: { char *numstr = Z_STRVAL_PP(val); - if(numstr[0] == '0' (numstr[1] == 'x' || numstr[1] == 'X')) { - ret = mpz_init_set_str(**gmpnumber, numstr+2, 16); - } else { - ret = mpz_init_set_str(**gmpnumber, numstr, 10); + if (base==0) { + if(numstr[0] == '0' (numstr[1] == 'x' || numstr[1] +== 'X')) { + base=16; + } else { + base=10; + } } + ret = mpz_init_set_str(**gmpnumber, numstr, base); } break; default: @@ -434,22 +437,30 @@ } /* }}} */ -/* Remove the following function when you have succesfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - -/* {{{ proto resource gmp_init(mixed number) +/* {{{ proto resource gmp_init(mixed number [, int base]) Initializes GMP number */ ZEND_FUNCTION(gmp_init) { - zval **number_arg; + zval **number_arg, **base_arg; mpz_t * gmpnumber; + int argc; + int base=0; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, number_arg) == FAILURE){ + argc = ZEND_NUM_ARGS(); + if (argc 1 || argc 2 || zend_get_parameters_ex(argc, number_arg, +base_arg) == FAILURE){ WRONG_PARAM_COUNT; } - if(convert_to_gmp(gmpnumber,number_arg) == FAILURE) { + if (argc==2) { + convert_to_long_ex(base_arg); + base = Z_LVAL_PP(base_arg); + if(base 2 || base 36) { + zend_error(E_WARNING, Bad base for conversion: %d (should be +between 2 and 36), base); + RETURN_FALSE; + } + } + + if(convert_to_gmp(gmpnumber,number_arg,base) == FAILURE) { RETURN_FALSE; } -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] incomplete class broken?
hi, the following code breaks php: ?php class tubu { } $thies = unserialize('O:1:a:0:{}'); ? X-Powered-By: PHP/4.0.7-dev Content-type: text/html ../../php4/Zend/zend_hash.c(176) : Freeing 0x084B3A54 (64 bytes), script=../ser2.php Last leak repeated 1 time ../../php4/Zend/zend_compile.c(1532) : Freeing 0x084B39AC (4 bytes), script=../ser2.php ../../php4/Zend/zend_language_scanner.l(1144) : Freeing 0x084B390C (5 bytes), script=../ser2.php [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_opcode.c(117) : Block 0x084B3988 status: Beginning: Overrun (magic=0x08450298, expected=0x7312F8DC) End: Unknown --- [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_hash.c(548) : Block 0x084B39C0 status: Beginning: Overrun (magic=0x40B49080, expected=0x7312F8DC) End: Unknown --- [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_hash.c(548) : Block 0x084B3A30 status: Beginning: Overrun (magic=0x40B49040, expected=0x7312F8DC) End: Unknown --- if you comment out the tubu class everything works. i'm not too sure if this is due to saschas work in var.c or some changes in the engine. does anybody have a clue what might be wrong? re, tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: gmp_init with a base argument
On Thu, 02 Aug 2001 19:16:26 +0200, Stanislav Malyshev [EMAIL PROTECTED] wrote: TA By the way: TA I think that the decbin() function should bail out if you pass it a TA value which contains more bits than PHP is able to handle. - Perhaps TA with a hint about using GMP for large numbers. I'd say give a warning istead of bail out, but that's a good idea, generally. OK. Here is a suggestion for an adjustment in math.c. The patch could probably be improved: The check for strings with more than 31 chars should probably be less hard-coded, but I'm not sure which contant to use for determining maximum size of a LONG. /Troels --- php4-orig/ext/standard/math.c Sun Aug 5 12:51:38 2001 +++ php4/ext/standard/math.cSun Aug 5 12:52:35 2001 @@ -813,6 +813,11 @@ } convert_to_string_ex(arg); + + if ((*arg)-value.str.len 31) { + php_error(E_WARNING, bindec: input string too long (max is a 31-bit +value)); + } + ret = _php_math_basetolong(*arg, 2); RETVAL_LONG(ret); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
i would say so, yes. and if you do md5(microtime()) you have to do a substr() on the result to get the desired length. easy done, yes. but still.. maybe something for PEAR instead of the core? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 3:41 Subject: Re: [PHP-DEV] Re: rand_str is it that much more useful than md5(microtime()) ? ah-oh, you want to be able to specify the set of characters... At 04:28 8/5/2001, Daniel Andersson wrote the following: -- sounds useful and cool, me thinks :o) / d [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm thinking about a new function: [mt_]rand_str Syntax: string [mt_]rand_str(minlen,maxlen[,charlist]); where charlist is in addcslashes (and now also [l|r]trim) syntax. Charlist defaults to 0..9a..zA..Z IMHO, this would be a very useful function. Any comments? Maybe not minmaxlen, but simply a fixed len? (since randomness on the length is ambigious to implement, there are less possibilities with shorter strings, which raises some issues). As an extension, the function could also accept an array as charlist, containing small strings, to produce pronouncable strings. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12576: php_pdf.dll is expired
From: [EMAIL PROTECTED] Operating system: Windows 98 PHP version: 4.0.6 PHP Bug Type: *PDF functions Bug description: php_pdf.dll is expired I have PHP 4.0.6 installed on a Windows 98 System with gd,pdf and zlib extensions. When I try to call a function from the pdflib it says: Fatal error: PDFlib error: Beta expired - retrieve new version from www.pdflib.com in .php on line 4 On that website I found the following information: 2001-05-18: PDFlib 4.0.0 accidentally contains a time-bomb feature from the beta test which makes PDFlib 4.0.0 expire in July 2001. The php_pdf.dll you can download from www.pdflib.com is not free and displays a message across all pdf-pages. They offer a patch on that website, but that does not work with windows dll's. Please add a working php_pdf.dll to your PHP-distribution for win32. Thanks, Robert Grellmann -- Edit bug report at: http://bugs.php.net/?id=12576edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] include_path with .
Yep, it's using __FILE__. Andi On 3 Aug 2001, Stig Sæther Bakken wrote: [Stig S. Bakken [EMAIL PROTECTED]] Hi, I would like to suggest that we change how . in the include_path is treated to being relative to the file doing an include, instead of relative to the main script file. There was some mention of this a few weeks ago, and it's a problem for PEAR users using ISPs that won't let them change their include_path. [Andi Gutmans [EMAIL PROTECTED]] I have already commited a change that if I file isn't found in the include_path then PHP will check for the file in the running scripts' cwd. Ah, in the cwd of __FILE__ then (which is what I meant), not $PATH_TRANSLATED? - Stig -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12577: cpdf_import_jpeg() not working at all
From: [EMAIL PROTECTED] Operating system: Windows 98 PHP version: 4.0.6 PHP Bug Type: ClibPDF related Bug description: cpdf_import_jpeg() not working at all I wrote a script using the cpdf_* functions and everything is working fine. Only the cpdf_import_jpeg() function does not produce any output at all. There is no error message. I called the function like this: $pdf = cpdf_open(0); cpdf_page_init($pdf,1,0,842,595,1); cpdf_import_jpeg($pdf,image.jpg,10,10,0,300,109,0,0,1); cpdf_finalize($pdf); Header(Content-type: application/pdf); cpdf_output_buffer($pdf); cpdf_close($pdf); The pdf-file does not show anything. Thanks, Robert Grellmann -- Edit bug report at: http://bugs.php.net/?id=12577edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, and it is extremely easy to implement in userland: function str_rand() { $len = func_num_args() ? func_get_arg(0) : 32 ; return substr(md5(microtime()),0,$len); } At 13:57 8/5/2001, Daniel Andersson wrote the following: -- i would say so, yes. and if you do md5(microtime()) you have to do a substr() on the result to get the desired length. easy done, yes. but still.. maybe something for PEAR instead of the core? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 3:41 Subject: Re: [PHP-DEV] Re: rand_str is it that much more useful than md5(microtime()) ? ah-oh, you want to be able to specify the set of characters... At 04:28 8/5/2001, Daniel Andersson wrote the following: -- sounds useful and cool, me thinks :o) / d [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm thinking about a new function: [mt_]rand_str Syntax: string [mt_]rand_str(minlen,maxlen[,charlist]); where charlist is in addcslashes (and now also [l|r]trim) syntax. Charlist defaults to 0..9a..zA..Z IMHO, this would be a very useful function. Any comments? Maybe not minmaxlen, but simply a fixed len? (since randomness on the length is ambigious to implement, there are less possibilities with shorter strings, which raises some issues). As an extension, the function could also accept an array as charlist, containing small strings, to produce pronouncable strings. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Coding standard: API functions
At 07:57 AM 8/5/2001 +0200, [EMAIL PROTECTED] wrote: Hi, Some PHPAPI function demand a char* and int when they want a string, others a zval which is expected to be IS_STRING. Which one is preferred? I think in any case the function should accept a char * and a length so that it'll be binary safe. It doesn't really matter too much if it's a zval or C types. Maybe C-types would be more general. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
At 12:17 AM 8/5/01 +0300, Zeev Suraski wrote: You can't have two constants with the same string but different case sensitivity. It's a limitation of the current implementation. That's exactly what I'm complaining about. ;-) Can we fix it soon? -Andrei -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12574 Updated: Documented void session_end() doesn't exist
ID: 12574 Updated by: jon Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Session related Operating System: Linux PHP Version: 4.0.6 New Comment: Neither session_end() or session_readonly() actually exist yet. Previous Comments: [2001-08-05 05:37:08] [EMAIL PROTECTED] The manual states: Description void session_end () End the current session and store session data. Calling gives: Fatal error: Call to undefined function: session_end() in Edit this bug report at http://bugs.php.net/?id=12574edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
No time for this in the near future, I'm afraid :I Zeev At 16:58 05/08/2001, Andrei Zmievski wrote: At 12:17 AM 8/5/01 +0300, Zeev Suraski wrote: You can't have two constants with the same string but different case sensitivity. It's a limitation of the current implementation. That's exactly what I'm complaining about. ;-) Can we fix it soon? -Andrei -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: gmp_init with a base argument
TA OK. Here is a suggestion for an adjustment in math.c. The patch TA could probably be improved: The check for strings with more than TA 31 chars should probably be less hard-coded, but I'm not sure TA which contant to use for determining maximum size of a LONG. I have made a bit more general patch, see CVS of math.c -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
yes, totally agree. but why not put it into PEAR? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 13:52 Subject: Re: [PHP-DEV] Re: rand_str I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, and it is extremely easy to implement in userland: function str_rand() { $len = func_num_args() ? func_get_arg(0) : 32 ; return substr(md5(microtime()),0,$len); } At 13:57 8/5/2001, Daniel Andersson wrote the following: -- i would say so, yes. and if you do md5(microtime()) you have to do a substr() on the result to get the desired length. easy done, yes. but still.. maybe something for PEAR instead of the core? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 3:41 Subject: Re: [PHP-DEV] Re: rand_str is it that much more useful than md5(microtime()) ? ah-oh, you want to be able to specify the set of characters... At 04:28 8/5/2001, Daniel Andersson wrote the following: -- sounds useful and cool, me thinks :o) / d [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm thinking about a new function: [mt_]rand_str Syntax: string [mt_]rand_str(minlen,maxlen[,charlist]); where charlist is in addcslashes (and now also [l|r]trim) syntax. Charlist defaults to 0..9a..zA..Z IMHO, this would be a very useful function. Any comments? Maybe not minmaxlen, but simply a fixed len? (since randomness on the length is ambigious to implement, there are less possibilities with shorter strings, which raises some issues). As an extension, the function could also accept an array as charlist, containing small strings, to produce pronouncable strings. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
I'm not against putting it into pear. ask the pear guys what they think... but there's no Strings class AFAIK, and I think they'll hesitate to create a top-level class for just one function. :) At 16:47 8/5/2001, Daniel Andersson wrote the following: -- yes, totally agree. but why not put it into PEAR? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 13:52 Subject: Re: [PHP-DEV] Re: rand_str I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, and it is extremely easy to implement in userland: function str_rand() { $len = func_num_args() ? func_get_arg(0) : 32 ; return substr(md5(microtime()),0,$len); } At 13:57 8/5/2001, Daniel Andersson wrote the following: -- i would say so, yes. and if you do md5(microtime()) you have to do a substr() on the result to get the desired length. easy done, yes. but still.. maybe something for PEAR instead of the core? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 3:41 Subject: Re: [PHP-DEV] Re: rand_str is it that much more useful than md5(microtime()) ? ah-oh, you want to be able to specify the set of characters... At 04:28 8/5/2001, Daniel Andersson wrote the following: -- sounds useful and cool, me thinks :o) / d [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm thinking about a new function: [mt_]rand_str Syntax: string [mt_]rand_str(minlen,maxlen[,charlist]); where charlist is in addcslashes (and now also [l|r]trim) syntax. Charlist defaults to 0..9a..zA..Z IMHO, this would be a very useful function. Any comments? Maybe not minmaxlen, but simply a fixed len? (since randomness on the length is ambigious to implement, there are less possibilities with shorter strings, which raises some issues). As an extension, the function could also accept an array as charlist, containing small strings, to produce pronouncable strings. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
heh.. possibly. ;) forwarded. / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 15:59 Subject: Re: [PHP-DEV] Re: rand_str I'm not against putting it into pear. ask the pear guys what they think... but there's no Strings class AFAIK, and I think they'll hesitate to create a top-level class for just one function. :) At 16:47 8/5/2001, Daniel Andersson wrote the following: -- yes, totally agree. but why not put it into PEAR? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 13:52 Subject: Re: [PHP-DEV] Re: rand_str I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, and it is extremely easy to implement in userland: function str_rand() { $len = func_num_args() ? func_get_arg(0) : 32 ; return substr(md5(microtime()),0,$len); } At 13:57 8/5/2001, Daniel Andersson wrote the following: -- i would say so, yes. and if you do md5(microtime()) you have to do a substr() on the result to get the desired length. easy done, yes. but still.. maybe something for PEAR instead of the core? / d - Original Message - From: Cynic [EMAIL PROTECTED] To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 3:41 Subject: Re: [PHP-DEV] Re: rand_str is it that much more useful than md5(microtime()) ? ah-oh, you want to be able to specify the set of characters... At 04:28 8/5/2001, Daniel Andersson wrote the following: -- sounds useful and cool, me thinks :o) / d [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm thinking about a new function: [mt_]rand_str Syntax: string [mt_]rand_str(minlen,maxlen[,charlist]); where charlist is in addcslashes (and now also [l|r]trim) syntax. Charlist defaults to 0..9a..zA..Z IMHO, this would be a very useful function. Any comments? Maybe not minmaxlen, but simply a fixed len? (since randomness on the length is ambigious to implement, there are less possibilities with shorter strings, which raises some issues). As an extension, the function could also accept an array as charlist, containing small strings, to produce pronouncable strings. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] incomplete class broken?
On Sun, Aug 05, 2001 at 01:46:35PM +0200, Thies C. Arntzen wrote: hi, the following code breaks php: after some more testing: it seems that one can no longer call zend_register_internal_class when the script is already executing. my testscript unserializes an object from a class that has no definition loaded, so we call php_create_incomplete_class() to setup our incomplete class. this used to work just fine... ... zend_class_entry *php_create_incomplete_class(TSRMLS_D) { zend_class_entry incomplete_class; INIT_OVERLOADED_CLASS_ENTRY(incomplete_class, INCOMPLETE_CLASS, NULL, incomplete_class_call_func, incomplete_class_get_property, incomplete_class_set_property); BG(incomplete_class) = zend_register_internal_class(incomplete_class TSRMLS_CC); return (BG(incomplete_class)); } ... this together with (atleast) one user-level class will cause the mentioned crash. i tend to think that something in zend is causing this. zeev, andi? BTW: if i call php_create_incomplete_class() from MINIT(basic_functions) the problem goes away. tc ?php class tubu { } $thies = unserialize('O:1:a:0:{}'); ? X-Powered-By: PHP/4.0.7-dev Content-type: text/html ../../php4/Zend/zend_hash.c(176) : Freeing 0x084B3A54 (64 bytes), script=../ser2.php Last leak repeated 1 time ../../php4/Zend/zend_compile.c(1532) : Freeing 0x084B39AC (4 bytes), script=../ser2.php ../../php4/Zend/zend_language_scanner.l(1144) : Freeing 0x084B390C (5 bytes), script=../ser2.php [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_opcode.c(117) : Block 0x084B3988 status: Beginning:Overrun (magic=0x08450298, expected=0x7312F8DC) End:Unknown --- [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_hash.c(548) : Block 0x084B39C0 status: Beginning:Overrun (magic=0x40B49080, expected=0x7312F8DC) End:Unknown --- [Sun Aug 5 13:44:17 2001] Script: '../ser2.php' --- ../../php4/Zend/zend_hash.c(548) : Block 0x084B3A30 status: Beginning:Overrun (magic=0x40B49040, expected=0x7312F8DC) End:Unknown --- if you comment out the tubu class everything works. i'm not too sure if this is due to saschas work in var.c or some changes in the engine. does anybody have a clue what might be wrong? re, tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12578: Segfault with vanilla php in apache
From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.0.6 PHP Bug Type: Reproducible crash Bug description: Segfault with vanilla php in apache With vanilla php (rasmus take note please), here's a b/t from the latest segfaults. Actually looks like possibly the same problem that I reported when the optimiser was enabled. Since this is in vanilla php, I trust that this *is* the right place to report the crash. Now I understand the use for the apache MaxRequestsPerChild :-) GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-suse-linux... (gdb) run -X Starting program: /usr/local/builds/apache-1.3.12/bin/httpd -X Program received signal SIGSEGV, Segmentation fault. 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 2886zend_hash_move_forward_ex(Z_ARRVAL_PP(input), pos); (gdb) where #0 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 #1 0x81067ff in execute (op_array=0x8281858) at ./zend_execute.c:1504 #2 0x81069fd in execute (op_array=0x82815b8) at ./zend_execute.c:1544 #3 0x81069fd in execute (op_array=0x827bcf0) at ./zend_execute.c:1544 #4 0x81069fd in execute (op_array=0x8275bd8) at ./zend_execute.c:1544 #5 0x81069fd in execute (op_array=0x829969c) at ./zend_execute.c:1544 #6 0x81069fd in execute (op_array=0x82988c4) at ./zend_execute.c:1544 #7 0x81069fd in execute (op_array=0x82b846c) at ./zend_execute.c:1544 #8 0x81069fd in execute (op_array=0x82abf9c) at ./zend_execute.c:1544 #9 0x81069fd in execute (op_array=0x82ac0c4) at ./zend_execute.c:1544 #10 0x81069fd in execute (op_array=0x82a2834) at ./zend_execute.c:1544 #11 0x81069fd in execute (op_array=0x82a2d0c) at ./zend_execute.c:1544 #12 0x81069fd in execute (op_array=0x82a4c6c) at ./zend_execute.c:1544 #13 0x81069fd in execute (op_array=0x82ac964) at ./zend_execute.c:1544 #14 0x81069fd in execute (op_array=0x8285a2c) at ./zend_execute.c:1544 #15 0x81069fd in execute (op_array=0x8262934) at ./zend_execute.c:1544 #16 0x80dde0b in zend_execute_scripts (type=8, file_count=3) at zend.c:752 #17 0x806a6fb in php_execute_script (primary_file=0xb748) at main.c:1206 #18 0x80eaa1b in apache_php_module_main (r=0x8245fa4, display_source_mode=0) at sapi_apache.c:89 #19 0x8067bee in send_php () #20 0x8067c36 in send_parsed_php () #21 0x8111609 in ap_invoke_handler () #22 0x8126a1f in process_request_internal () #23 0x8126a92 in ap_process_request () #24 0x811d8a6 in child_main () #25 0x811da85 in make_child () #26 0x811dc06 in startup_children () ---Type return to continue, or q return to quit--- #27 0x811e27d in standalone_main () #28 0x811eacc in main () #29 0x400c4a5e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93 (gdb) -- Edit bug report at: http://bugs.php.net/?id=12578edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
but why not put it into PEAR? PEAR can be useful, but the power of PHP is, that is has so many helpful build-in functions. And with pear, it will always be longer. I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, To generate random passwords, with characters you decide, and length? I think it is useful, but usefulness indeed is a good point. Does everyone here doubt the usefulness? and it is extremely easy to implement in userland: That is not true, md5 will always return hex, and is of specific length. I can image users don't want (so much) digits, and/or want to exclude certain look-alike chars ( 0 (zero) and O (o), for example). Greetz, Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
At 17:21 8/5/2001, Jeroen van Wolffelaar wrote the following: -- but why not put it into PEAR? PEAR can be useful, but the power of PHP is, that is has so many helpful build-in functions. And with pear, it will always be longer. I think that new functions should be added on basis of usefulness, not the coolness factor. IMNSHO this function isn't very useful, To generate random passwords, with characters you decide, and length? I think it is useful, but usefulness indeed is a good point. Does everyone here doubt the usefulness? and it is extremely easy to implement in userland: That is not true, So how about this? function str_rand($len=8) { $retval = strtr(md5(microtime()), chr(0x30), chr(0x4F)); return substr($retval,0,$len); } for($i=0; $i10; $i++){ echo str_rand(), \n; } md5 will always return hex, and is of specific length. I can image users don't want (so much) digits, and/or want to exclude certain look-alike chars ( 0 (zero) and O (o), for example). [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
At 05:35 PM 8/5/01 +0300, Zeev Suraski wrote: No time for this in the near future, I'm afraid :I Um, the fix is trivial. Want me to do it? -Andrei -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
I don't believe the fix is trivial at all. Hint - if it's just nuking the strtolower there, you got it wrong :) At 18:34 05/08/2001, Andrei Zmievski wrote: At 05:35 PM 8/5/01 +0300, Zeev Suraski wrote: No time for this in the near future, I'm afraid :I Um, the fix is trivial. Want me to do it? -Andrei -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
At 10:34 AM 8/5/2001 -0500, Andrei Zmievski wrote: At 05:35 PM 8/5/01 +0300, Zeev Suraski wrote: No time for this in the near future, I'm afraid :I Um, the fix is trivial. Want me to do it? Are you sure we want to have non-capitalized constants? It might be good practice to always have constant as capital letters. I'll let Zeev answer the fixing part because he knows the code but I'm just wondering about the capitalizing issue from a general language perspective. It might be nice to always have it as capitals. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12579: Java support does not work
From: [EMAIL PROTECTED] Operating system: NT 2000 PHP version: 4.0.6 PHP Bug Type: Reproducible crash Bug description: Java support does not work When attempting to use PHP with JDK 1.3 or 1.2.2 php will invoke java the first time ok, but after rapid sucessive calls process dies and will either bring down tomcat, or hang appache. Any help would be appreated. Thanks -- Edit bug report at: http://bugs.php.net/?id=12579edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Constanst are case-insensitive
At 06:43 PM 8/5/01 +0300, Zeev Suraski wrote: I don't believe the fix is trivial at all. Hint - if it's just nuking the strtolower there, you got it wrong :) You are right, it is not trivial. I spoke in haste. I have some ideas on how to make it work, but I'll have to test the performance impact. -Andrei -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12580: sunos 4 doesn't have strtoul. using strtol works...
From: [EMAIL PROTECTED] Operating system: SunOS 4. PHP version: 4.0.6 PHP Bug Type: Compile Failure Bug description: sunos 4 doesn't have strtoul. using strtol works... compiling ext/standard/scanf.c on sunos 4 is a problem - there's a declaration problem with strtol in php_sscanf_internal, and strtoul doesn't exist at all. -- Edit bug report at: http://bugs.php.net/?id=12580edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12578 Updated: Segfault with vanilla php in apache
ID: 12578 Updated by: rasmus Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.0.6 New Comment: Can you provide a simple script that causes this? Previous Comments: [2001-08-05 11:18:11] [EMAIL PROTECTED] With vanilla php (rasmus take note please), here's a b/t from the latest segfaults. Actually looks like possibly the same problem that I reported when the optimiser was enabled. Since this is in vanilla php, I trust that this *is* the right place to report the crash. Now I understand the use for the apache MaxRequestsPerChild :-) GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-suse-linux... (gdb) run -X Starting program: /usr/local/builds/apache-1.3.12/bin/httpd -X Program received signal SIGSEGV, Segmentation fault. 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 2886zend_hash_move_forward_ex(Z_ARRVAL_PP(input), pos); (gdb) where #0 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 #1 0x81067ff in execute (op_array=0x8281858) at ./zend_execute.c:1504 #2 0x81069fd in execute (op_array=0x82815b8) at ./zend_execute.c:1544 #3 0x81069fd in execute (op_array=0x827bcf0) at ./zend_execute.c:1544 #4 0x81069fd in execute (op_array=0x8275bd8) at ./zend_execute.c:1544 #5 0x81069fd in execute (op_array=0x829969c) at ./zend_execute.c:1544 #6 0x81069fd in execute (op_array=0x82988c4) at ./zend_execute.c:1544 #7 0x81069fd in execute (op_array=0x82b846c) at ./zend_execute.c:1544 #8 0x81069fd in execute (op_array=0x82abf9c) at ./zend_execute.c:1544 #9 0x81069fd in execute (op_array=0x82ac0c4) at ./zend_execute.c:1544 #10 0x81069fd in execute (op_array=0x82a2834) at ./zend_execute.c:1544 #11 0x81069fd in execute (op_array=0x82a2d0c) at ./zend_execute.c:1544 #12 0x81069fd in execute (op_array=0x82a4c6c) at ./zend_execute.c:1544 #13 0x81069fd in execute (op_array=0x82ac964) at ./zend_execute.c:1544 #14 0x81069fd in execute (op_array=0x8285a2c) at ./zend_execute.c:1544 #15 0x81069fd in execute (op_array=0x8262934) at ./zend_execute.c:1544 #16 0x80dde0b in zend_execute_scripts (type=8, file_count=3) at zend.c:752 #17 0x806a6fb in php_execute_script (primary_file=0xb748) at main.c:1206 #18 0x80eaa1b in apache_php_module_main (r=0x8245fa4, display_source_mode=0) at sapi_apache.c:89 #19 0x8067bee in send_php () #20 0x8067c36 in send_parsed_php () #21 0x8111609 in ap_invoke_handler () #22 0x8126a1f in process_request_internal () #23 0x8126a92 in ap_process_request () #24 0x811d8a6 in child_main () #25 0x811da85 in make_child () #26 0x811dc06 in startup_children () ---Type return to continue, or q return to quit--- #27 0x811e27d in standalone_main () #28 0x811eacc in main () #29 0x400c4a5e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93 (gdb) Edit this bug report at http://bugs.php.net/?id=12578edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12578 Updated: Segfault with vanilla php in apache
Hi Rasmus, Sorry but no for this one. I've been emailing with Andi for a bit, and I'm trawling through with gdb. It's very bizarre, and looks like just a symptom of some general memory corruption at the moment. I'm not sure that array_reduce is itself to blame. Any number of minor changes stop the problem from happening - such as the call stack depth, what the function to array_reduce does, and so on. I've eliminated a certain amount of complexity, and up to a point, as long as I keep the call stack depth the same with dummy functions then I can keep the crash happening, but I've reached a point where if I further simplify then things don't fail. I'm going to see if I can further simplify and will give an update if I have anything more tangible to add on this. Thanks for your email, Best regards, Nick -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] RFC: mt_* functions
Both function families are the same in syntax returning, only the algorithm is different. I.e.: the semantics is the same. The algorithm - if correct - shouldn't bother, and shouldn't be the concern of the programmer, but rather the system maintainer (specific cases excluded, but than you leave the high-level of PHP, and go to low-level implementation issues.). But they are different in that each will produce a deterministic sequence based on their seeds. If I, as an application developer, distributes a regression test harness which tests my app with a specific seed expecting a specific sequence and the server my app runs on has switched rand() to use the mt_rand() algorithm my regression test will fail. True... though IMHO a regression test is not strictly using PHP in a high-level way, but goes into internal behaviour of it. In the documentation, rand() is defined to return a pseudo-random value between 0 and RAND_MAX. It states nothing about that the same seed yields the same sequence. True, this is the case in (almost) any pseudo-random-generator. But relying on that behaviour is IMO using low-level implementation knowledge. Of course, it is not forbidden to use that knowledge, but if you do, I believe that it is your own responsibility to keep an eye on the changelog when upgrading. And with a rand_generator = system setting, you actually have a guarantee that the system's rand is used, with all it's properties. I'm not denying that this change could break a script (though IMO it would be rare). A solution would be to have it defaulted to 'system', and let the mt_* functions always use mt, regardless of the ini-setting. By default, no result will be different then, while still rand()'s behaviour is determined by an ini-setting. In the end, it'd be best (IMO) to switch the default to mt, and that change - though with less impact - has technically the same consequences as turning register_globals off by default. This is somewhat like saying that we should make crypt() just be an alias for md5() since md5() is a better algorithm. The fact that it is better is rather irrelevant since the output of the algorithm itself is sometimes important. Many times you can swap crypt() for md5(), but many times you can't. Same goes for rand() and mt_rand(). 'somewhat like', indeed, since crypt is defined to use DES, and is targetted at being the same on the same input. This definitely not the case with rand(), it is a regretful consequence of the way computers work why it sometimes can be predicted. -Rasmus Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12575 Updated: Session register destroy flaws/bugs(?)
ID: 12575 Updated by: rasmus Reported By: [EMAIL PROTECTED] Old Status: Open Status: Analyzed Bug Type: Session related Operating System: Linux PHP Version: 4.0.6 New Comment: I think this is consistent behaviour. session_start() brings data from your session backend into your current script. session_destroy() destroys the session data in your session backend. It does not and should not affect variables which are currently active in your script. The session_start() and session_unset() functions are designed to affect the current active symbol table. Previous Comments: [2001-08-05 07:32:21] [EMAIL PROTECTED] Whilst the PHP session support is a great feature, handling session state as of 4.0.6 is inconsistent and arguably flawed and has some gotchas, as illustrated in the two scripts after these details. There are workarounds which I'll explain. This assumes track vars enabled, as it always is since 4.0.3 anyway, and register globals is enabled. In summary 1) Registering a global with session_register() doesn't update $HTTP_SESSION_VARS until the session is restored, so don't use $HTTP_SESSION_VARS for accessing intra-session state changes unless you set $HTTP_SESSION_VARS as well as your global. 2) Destroying a session doesn't reset the state of $HTTP_SESSION_VARS. Ouch! Creating a new session immediately afterwards does work as expected though, and produces a clean session. 3) BUT, destroying a session never unsets the state of registered globals. Ouch again! So be wary of using globals rather than HTTP_SESSION_VARS for getting at session state if you ever conditionally destroy sessions and subsequently access session data, unless of course you explicitly unset your globals too. Executing x.php then y.php illustrate the problems. The output is: Assert failed: OOPS, foo session var is unset Assert failed: OOPS, foo session var still set on destroyed session Assert failed: OOPS, global foo is still set x.php: ?php // -*- c++ -*- // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Get a clean session session_start(); session_destroy(); session_start(); // Style 1. We use HTTP_SESSION_VARS to access session state // This works fine for a restored session, but intra-session // it doesn't. e.g. $foo = 'bar'; // Set it session_register('foo');// Register global // Assert fails - foo isn't a useable session variable (yet) after all myassert(isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var is unset); ? y.php: ?php // -*- c++ -*- ob_start(); // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Restore session with foo set from x.php session_start(); // Style 2. As HTTP_SESSION_VARS doesn't get set intra-session, lets // try using globals as our session mechanism instead. myassert(isset($foo), Global foo not restored); // OK. global restored myassert(isset($HTTP_SESSION_VARS['foo']), Session foo not restored); // OK // Now lets try destroying the session as, for example, our script was // passed a logout request somehow session_destroy(); // This should do it myassert(!isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var still set on destroyed session); // FAILS session_start(); myassert(!isset($HTTP_SESSION_VARS['foo']), foo session var still set on destroyed session); // OK, not it's not // But remember that we decided to use globals because of the problems with // HTTP_SESSION_VARS not being updated intra-session, well lets check the // state of our global $foo myassert(!isset($foo), OOPS, global foo is still set); /// FAILS, oh dear! ob_end_flush(); ? Edit this bug report at http://bugs.php.net/?id=12575edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12575 Updated: Session register destroy flaws/bugs(?)
I think that your comments are a fair point, but given that session_start() will create or open/restore a previous session, affecting state of the script that's directly related to session state, surely session_destroy() should do the converse, destroying the backend and also the program state that session_start() introduced in the first place. Incidentally, when session_end() is implemented, it should possibly also clear registered variables, although that depends on whether you regard a closed session to still exist - which of course it technically does. Just because it's not actually open may not mean that values obtained from that session aren't an accurate reflection of the session, but the problem comes if you then change variables associated with a closed session because you then do have an incorrect view of session state. Perhaps variables that are associated with a closed session should then become 'const' or read only, and modifying them should create at least a warning, because this is likely to be symptomatic of a design flaw in the users application - they're changing session state that isn't going to take effect. Not all applications that call session_destroy() will be ending at that point, in fact for mine, it's merely beginning. If you link program state, which you are doing via session_register(), to a session, I think that this state should *always* accurately reflect the state of the session. Calling session_unset() may be useful to reset an active session, but if there's no session then there can be no data. In essence, once you've associated a variable to a session entity, you should always be able to look to that variable to determine an accurate reflection of the session state. - but perhaps we can agree to differ :-) Nick On Sun, Aug 05, 2001 at 06:34:22PM -, Bug Database wrote: ID: 12575 Updated by: rasmus Reported By: [EMAIL PROTECTED] Old Status: Open Status: Analyzed Bug Type: Session related Operating System: Linux PHP Version: 4.0.6 New Comment: I think this is consistent behaviour. session_start() brings data from your session backend into your current script. session_destroy() destroys the session data in your session backend. It does not and should not affect variables which are currently active in your script. The session_start() and session_unset() functions are designed to affect the current active symbol table. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
and it is extremely easy to implement in userland: That is not true, So how about this? function str_rand($len=8) { $retval = strtr(md5(microtime()), chr(0x30), chr(0x4F)); return substr($retval,0,$len); } for($i=0; $i10; $i++){ echo str_rand(), \n; } I find rand_str($len , 1..9a..f\x4F) easier... ;-) And this is still yielding exactly 16 differerent characters. As you saw for yourself, it is not trivial to implement something like this in userland. For example str_pad is way easier to implement, only some playing with str_repeat. Are there any objections if I implement this? Are you still against this new function? Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] New ZendEngine2 CVS tree
Hi, I started the new CVS tree. The point where it was split from the Engine 1 tree was tagged PRE_ENGINE_SPLIT. Please if you commit to the old CVS make sure you also commit to the new one if needed. Thanks, Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] PHP Notes
Since I have started maintaining the document notes, I have roughly estimated that 1/2-2/3 of the notes have to be deleted because people are not following the guidelines. The page that tells these guidelines is setup in paragraph form, which not too many people seem to read. I propose shortening this page and/or putting the guidelines in bulleted form. Anybody agree/disagree? (*Andy*) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
At 21:17 8/5/2001, Jeroen van Wolffelaar wrote the following: -- [...] function str_rand($len=8) { $retval = strtr(md5(microtime()), chr(0x30), chr(0x4F)); return substr($retval,0,$len); } for($i=0; $i10; $i++){ echo str_rand(), \n; } I find rand_str($len , 1..9a..f\x4F) easier... ;-) And this is still yielding exactly 16 differerent characters. As you saw for yourself, it is not trivial to implement something like this in userland. For example str_pad is way easier to implement, only some playing with str_repeat. Are there any objections if I implement this? Are you still against this new function? Jeroen Hi Jeroen, I think we're not on the same page. :) I consider both versions of str_rand() I posted trivial... Also, and this is strictly subjective, I don't think the function needs to be implemented natively. As I said, it's trivial. :) But my stance could be rated as -0.3... Actually, as I'm thinking about it, -0.2. as for the rand_str($len , 1..9a..f\x4F) proto: I don't like it. KISS. [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12578 Updated: Segfault with vanilla php in apache
I've provided a single script to Andi that blows up. I started simplifiying from the other end of the app and that was successful. It's still around 250 lines so I won't include it here but please email me direct if you'ld like a copy to work with. Good luck with this and lets hope this gets bugs gets squashed! Cheers, Nick On Sun, Aug 05, 2001 at 06:03:58PM -, Bug Database wrote: ID: 12578 Updated by: rasmus Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.0.6 New Comment: Can you provide a simple script that causes this? Previous Comments: [2001-08-05 11:18:11] [EMAIL PROTECTED] With vanilla php (rasmus take note please), here's a b/t from the latest segfaults. Actually looks like possibly the same problem that I reported when the optimiser was enabled. Since this is in vanilla php, I trust that this *is* the right place to report the crash. Now I understand the use for the apache MaxRequestsPerChild :-) GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-suse-linux... (gdb) run -X Starting program: /usr/local/builds/apache-1.3.12/bin/httpd -X Program received signal SIGSEGV, Segmentation fault. 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 2886zend_hash_move_forward_ex(Z_ARRVAL_PP(input), pos); (gdb) where #0 0x80f5b39 in php_if_array_reduce (ht=3, return_value=0x8347944, this_ptr=0x0, return_value_used=1) at array.c:2886 #1 0x81067ff in execute (op_array=0x8281858) at ./zend_execute.c:1504 #2 0x81069fd in execute (op_array=0x82815b8) at ./zend_execute.c:1544 #3 0x81069fd in execute (op_array=0x827bcf0) at ./zend_execute.c:1544 #4 0x81069fd in execute (op_array=0x8275bd8) at ./zend_execute.c:1544 #5 0x81069fd in execute (op_array=0x829969c) at ./zend_execute.c:1544 #6 0x81069fd in execute (op_array=0x82988c4) at ./zend_execute.c:1544 #7 0x81069fd in execute (op_array=0x82b846c) at ./zend_execute.c:1544 #8 0x81069fd in execute (op_array=0x82abf9c) at ./zend_execute.c:1544 #9 0x81069fd in execute (op_array=0x82ac0c4) at ./zend_execute.c:1544 #10 0x81069fd in execute (op_array=0x82a2834) at ./zend_execute.c:1544 #11 0x81069fd in execute (op_array=0x82a2d0c) at ./zend_execute.c:1544 #12 0x81069fd in execute (op_array=0x82a4c6c) at ./zend_execute.c:1544 #13 0x81069fd in execute (op_array=0x82ac964) at ./zend_execute.c:1544 #14 0x81069fd in execute (op_array=0x8285a2c) at ./zend_execute.c:1544 #15 0x81069fd in execute (op_array=0x8262934) at ./zend_execute.c:1544 #16 0x80dde0b in zend_execute_scripts (type=8, file_count=3) at zend.c:752 #17 0x806a6fb in php_execute_script (primary_file=0xb748) at main.c:1206 #18 0x80eaa1b in apache_php_module_main (r=0x8245fa4, display_source_mode=0) at sapi_apache.c:89 #19 0x8067bee in send_php () #20 0x8067c36 in send_parsed_php () #21 0x8111609 in ap_invoke_handler () #22 0x8126a1f in process_request_internal () #23 0x8126a92 in ap_process_request () #24 0x811d8a6 in child_main () #25 0x811da85 in make_child () #26 0x811dc06 in startup_children () ---Type return to continue, or q return to quit--- #27 0x811e27d in standalone_main () #28 0x811eacc in main () #29 0x400c4a5e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93 (gdb) ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=12578edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
Hi Jeroen, I think we're not on the same page. :) I consider both versions of str_rand() I posted trivial... Agree. But they are not what rand_str could do. The result has 16 different chars, just because md5 happens to have that much. Implementing something that has NOT that limitation, is far less trivial. Below is a - limited - implementation Also, and this is strictly subjective, I don't think the function needs to be implemented natively. As I said, it's trivial. :) But my stance could be rated as -0.3... Actually, as I'm thinking about it, -0.2. k, mine is 0.8, 0.9, on the idea, not the details as for the rand_str($len , 1..9a..f\x4F) proto: I don't like it. KISS. Better suggestions? Simple length and a list of characters... and the list-of-characters way is also in addcslashes, and the trims. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: PHP Notes
No No No, I mean that the USER needs to confirm in that case. Hey, i've found a question mark in your note. You realize that it is not allowed to ask questions here? do that on php-general. If this is not a question, and you're sure you obeyed the rule, click here to commit the note... Jeroen - Original Message - From: Andy [EMAIL PROTECTED] To: Jeroen van Wolffelaar [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 9:47 PM Subject: Re: PHP Notes confirmation would be even worse, then I'd (we'd) STILL have to go through all of the notes (and this time even confirm them)the point of this is so that we don't have to do to much with the notes ;) (also, people will never get answers to there questions, etc on doc notes, so if they get it the first time that doc notes aren't the way, then they can go to the right place and not get all mad at us) On Sun, 05 Aug 2001, Jeroen van Wolffelaar wrote: Agree, does css have relative fonts? +20% is fine, I suppose (didn't test) Anyway, it's about the idea of a bigger font, not _how_ bigger. And another idea: ask for confirmation if one submits a note with a question mark in it, since questions are forbidden. This would help greatly, I think Greetz, Jeroen - Original Message - From: Andy [EMAIL PROTECTED] To: Jeroen van Wolffelaar [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 9:42 PM Subject: Re: PHP Notes 20pt font? That's a bit big, don't you think? On Sun, 05 Aug 2001, Jeroen van Wolffelaar wrote: Since I have started maintaining the document notes, I have roughly estimated that 1/2-2/3 of the notes have to be deleted because people are not following the guidelines. The page that tells these guidelines is setup in paragraph form, which not too many people seem to read. I propose shortening this page and/or putting the guidelines in bulleted form. +1 and font size=+4... O no, css, well: .guidelines { font-size: 20pt } Anybody agree/disagree? (*Andy*) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12341 additional information
if the webserver runs as service it doesn't have access to the userspace (e.g. the desktop). if you want to open a window you have to execute php from the command line. Not really an addition to the bug update, but it is possible to allow a service to interact with the desktop under Windows 2000. I'm not sure whether this holds true for previous versions. It can be accessed by going to the properties of a service, and is under the log on tab. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12581: boolean fields not imported (patches enclosed)
From: [EMAIL PROTECTED] Operating system: Linux 2.2.16-3 PHP version: 4.0.6 PHP Bug Type: dBase related Bug description: boolean fields not imported (patches enclosed) Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; -- Edit bug report at: http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12581 Updated: boolean fields not imported (patches enclosed)
ID: 12581 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: dBase related Operating System: Linux 2.2.16-3 PHP Version: 4.0.6 New Comment: The file name to which the patches apply is ext/dbase/dbase.c. Previous Comments: [2001-08-05 16:16:32] [EMAIL PROTECTED] Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; Edit this bug report at http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12581 Updated: boolean fields not imported (patches enclosed)
ID: 12581 Updated by: andy Reported By: [EMAIL PROTECTED] Status: Open Bug Type: dBase related Operating System: Linux 2.2.16-3 PHP Version: 4.0.6 New Comment: this is not a bug...already forwarded to [EMAIL PROTECTED] Thanks for your help, but next time just send it to [EMAIL PROTECTED] and don't open a bug about it. Previous Comments: [2001-08-05 16:17:47] [EMAIL PROTECTED] The file name to which the patches apply is ext/dbase/dbase.c. [2001-08-05 16:16:32] [EMAIL PROTECTED] Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; Edit this bug report at http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12581 Updated: boolean fields not imported (patches enclosed)
ID: 12581 Updated by: andy Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: dBase related Operating System: Linux 2.2.16-3 PHP Version: 4.0.6 New Comment: status - bogus Previous Comments: [2001-08-05 16:18:03] [EMAIL PROTECTED] this is not a bug...already forwarded to [EMAIL PROTECTED] Thanks for your help, but next time just send it to [EMAIL PROTECTED] and don't open a bug about it. [2001-08-05 16:17:47] [EMAIL PROTECTED] The file name to which the patches apply is ext/dbase/dbase.c. [2001-08-05 16:16:32] [EMAIL PROTECTED] Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; Edit this bug report at http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12581 Updated: boolean fields not imported (patches enclosed)
Andy, this is not a bug...already forwarded to [EMAIL PROTECTED] Thanks for your help, but next time just send it to [EMAIL PROTECTED] and don't open a bug about it. Man, what a fast reply! I didn't think I should open a bug report about it, but I submitted the same patches to somewhere in php-land in 3/01 and never heard anything back Just out of curiosity, why is this not a bug? The program behavior is incorrect, and patches fix it. Surely it's not a feature? In fact, there is a bug report (#7374) from 10/20/2000 for the same problem that remains open (i.e., unsolved). :) Cheers - Larry -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
At 21:53 8/5/2001, Jeroen van Wolffelaar wrote the following: -- Hi Jeroen, I think we're not on the same page. :) I consider both versions of str_rand() I posted trivial... Agree. But they are not what rand_str could do. The result has 16 different chars, just because md5 happens to have that much. Implementing something that has NOT that limitation, is far less trivial. function str_rand($len = 8, $class = 'a-zA-Z1-9') { static $init = 1; if(1 == $init){ mt_srand((double) microtime() * 100); $init = 0; } $chars = array(); for($i = 0; $i $len; $i++){ $chars[] = chr(mt_rand(0,255)); } return implode('', preg_grep('|['.preg_quote($class).']|',$chars)); } Just a little bit different syntax for the second argument. What's the big deal? :) Also, and this is strictly subjective, I don't think the function needs to be implemented natively. As I said, it's trivial. :) But my stance could be rated as -0.3... Actually, as I'm thinking about it, -0.2. k, mine is 0.8, 0.9, on the idea, not the details as for the rand_str($len , 1..9a..f\x4F) proto: I don't like it. KISS. Better suggestions? Simple length and a list of characters... and the list-of-characters way is also in addcslashes, and the trims. Jeroen --end of quote-- [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: PHP Notes
On Sun, Aug 05, 2001 at 09:56:09PM +0200, Jeroen van Wolffelaar wrote: No No No, I mean that the USER needs to confirm in that case. Hey, i've found a question mark in your note. You realize that it is not allowed to ask questions here? do that on php-general. If this is not a question, and you're sure you obeyed the rule, click here to commit the note... It is allowed to ask questions on this list. Please realize that the documentation notes are belonging to the phpweb repository and there is no separate list for that case. Another list would be php-doc, but most of the authors and translators are not maintaining the phpweb site and haven't the karma to do that. Andy have a CVS account and his job is Notes/bug db maintenance. -Egon -- All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Fw: Re: [PHP-CVS] cvs: php4 /ext/standard math.c
Can't post to php-cvs :-( jeroen Sun Aug 5 16:27:04 2001 EDT Modified files: /php4/ext/standard math.c Log: Bugfix in abs(), abs(LONG_MIN) was bogus ---AND--- - Replaced the pow(LONG_MIN,1) fix for a better one - Removed bogus left-over comment in pow() -- (thought I already committed that...) Index: php4/ext/standard/math.c diff -u php4/ext/standard/math.c:1.51 php4/ext/standard/math.c:1.52 --- php4/ext/standard/math.c:1.51 Sun Aug 5 10:40:14 2001 +++ php4/ext/standard/math.c Sun Aug 5 16:27:03 2001 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: math.c,v 1.51 2001/08/05 14:40:14 stas Exp $ */ +/* $Id: math.c,v 1.52 2001/08/05 20:27:03 jeroen Exp $ */ #include php.h #include php_math.h @@ -49,7 +49,11 @@ if (Z_TYPE_PP(value) == IS_DOUBLE) { RETURN_DOUBLE(fabs(Z_DVAL_PP(value))); } else if (Z_TYPE_PP(value) == IS_LONG) { - RETURN_LONG(Z_LVAL_PP(value) 0 ? -Z_LVAL_PP(value) : Z_LVAL_PP(value)); + if (Z_LVAL_PP(value) == LONG_MIN) { + RETURN_DOUBLE(-(double)LONG_MIN); + } else { + RETURN_LONG(Z_LVAL_PP(value) 0 ? -Z_LVAL_PP(value) : Z_LVAL_PP(value)); + } } RETURN_FALSE; @@ -466,19 +470,10 @@ } case 1: RETURN_LONG(1); - case LONG_MIN: /* special case since -LONG_MIN == 0 */ - /* lexp != 0, and only lexp==1 is LONG, DOUBLE otherwise */ - if (lexp == 1) { - RETURN_LONG(LONG_MIN); - } else { - dval = exp(log(-(double)LONG_MIN) * (double)lexp); - RETURN_DOUBLE(lexp1 ? -dval : dval); - } default: /* abs(lbase) 1 */ - dval = exp(log((double) (lbase0?lbase:-lbase)) * + dval = exp(log(lbase0? (double)lbase : -(double)lbase ) * (double) lexp); - /* long result = 1; */ if (lexp 0 || dval (double) LONG_MAX) { /* 1/n ( abs(n) 1 ) || overflow */ RETURN_DOUBLE(((lexp 1) lbase0) ? -dval : dval); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Chora now the default cvs.php.net system
I switched Chora over to be the default web cvs system behind cvs.php.net now. The old viewcvs site is still available at viewcvs.php.net (dns may not have updated yet) -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
Implementing something that has NOT that limitation, is far less trivial. function str_rand($len = 8, $class = 'a-zA-Z1-9') { static $init = 1; if(1 == $init){ mt_srand((double) microtime() * 100); $init = 0; } $chars = array(); for($i = 0; $i $len; $i++){ $chars[] = chr(mt_rand(0,255)); } return implode('', preg_grep('|['.preg_quote($class).']|',$chars)); } Just a little bit different syntax for the second argument. What's the big deal? :) Okay, but hey, you're a PHP-expert with probably many years of experience... By the way, your function won't return strings of length $len... ;) And you could say that preg_grep is quite a hack. Anyway, this didn't convince me it's trivial... I'm sorry. Better suggestions? Simple length and a list of characters... and the list-of-characters way is also in addcslashes, and the trims. Jeroen -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
At 22:50 8/5/2001, Jeroen van Wolffelaar wrote the following: -- Implementing something that has NOT that limitation, is far less trivial. function str_rand($len = 8, $class = 'a-zA-Z1-9') { static $init = 1; if(1 == $init){ mt_srand((double) microtime() * 100); $init = 0; } $chars = array(); for($i = 0; $i $len; $i++){ $chars[] = chr(mt_rand(0,255)); } return implode('', preg_grep('|['.preg_quote($class).']|',$chars)); } Just a little bit different syntax for the second argument. What's the big deal? :) Okay, but hey, you're a PHP-expert with probably many years of experience... Fr from that. :) By the way, your function won't return strings of length $len... ;) Oh, shit. Optimization instead of a function. :) I've been sitting before the CRT for 30 hours... And you could say that preg_grep is quite a hack. Well, it nicely fits the bill - if you use the second argument as a character class, preg_quote/grep() lends itself. Or do you mean the concatenation? That's just a matter of formatting. Take it out of the preg_grep() call, and it'll look better. Anyway, this didn't convince me it's trivial... I'm sorry. ok. :) seems like the only function that'll be missing from PHP will be write_the_app(); :))) But this is really a non-issue. I'm fine with or without str_rand(), I was just trying to show that it's pretty easy to write one in PHP, and so the function isn't really necessary. I know, there's nl2br() which _is_ simple, but that's backed by the fact that in a web-oriented language, _everybody_ would write their own nl2br(). This is not the case with str_rand()... And now help me down off that soap box. :) [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: rand_str
This sort of function should be implemented in PHP. It doesn't say good things about a language when such trivial functionality needs to be implemented non-natively. And it doesn't need to be: function str_rand($len = 8, $class = 'a..zA..Z0..9') { if (!preg_match_all('/(.)\.\.(.)/', $class, $matches)) { return ''; } $chars = array(); $m1 = $matches[1]; $m2 = $matches[2]; for ($i = 0; $i count($m1); $i++) { $chars = array_merge($chars, range(ord($m1[$i]), ord($m2[$i]))); } if (($nchars=count($chars)) == 0) { return ''; } else if ($nchars == 1) { return str_pad('', $len, chr($chars[0])); } $str = ''; for ($i = 0; $i $len; $i++) { $str .= chr($chars[mt_rand(0, $nchars-1]); } return $str; } A translation into C might run about 100 times faster. In most applications, that doesn't justify sacrificing the flexibility and safety of a native implementation. On a related note, I don't see why PHP shouldn't ship with a standard library written in PHP. -Dan - Original Message - From: Cynic [EMAIL PROTECTED] To: Jeroen van Wolffelaar [EMAIL PROTECTED] Cc: PHP Developers Mailing List [EMAIL PROTECTED] Sent: Sunday, August 05, 2001 5:16 PM Subject: Re: [PHP-DEV] Re: rand_str At 22:50 8/5/2001, Jeroen van Wolffelaar wrote the following: -- Implementing something that has NOT that limitation, is far less trivial. function str_rand($len = 8, $class = 'a-zA-Z1-9') { static $init = 1; if(1 == $init){ mt_srand((double) microtime() * 100); $init = 0; } $chars = array(); for($i = 0; $i $len; $i++){ $chars[] = chr(mt_rand(0,255)); } return implode('', preg_grep('|['.preg_quote($class).']|',$chars)); } Just a little bit different syntax for the second argument. What's the big deal? :) Okay, but hey, you're a PHP-expert with probably many years of experience... Fr from that. :) By the way, your function won't return strings of length $len... ;) Oh, shit. Optimization instead of a function. :) I've been sitting before the CRT for 30 hours... And you could say that preg_grep is quite a hack. Well, it nicely fits the bill - if you use the second argument as a character class, preg_quote/grep() lends itself. Or do you mean the concatenation? That's just a matter of formatting. Take it out of the preg_grep() call, and it'll look better. Anyway, this didn't convince me it's trivial... I'm sorry. ok. :) seems like the only function that'll be missing from PHP will be write_the_app(); :))) But this is really a non-issue. I'm fine with or without str_rand(), I was just trying to show that it's pretty easy to write one in PHP, and so the function isn't really necessary. I know, there's nl2br() which _is_ simple, but that's backed by the fact that in a web-oriented language, _everybody_ would write their own nl2br(). This is not the case with str_rand()... And now help me down off that soap box. :) [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12583: Some children get stuck and consume all CPU time (bug #11676?)
From: [EMAIL PROTECTED] Operating system: Linux 2.4.7 PHP version: 4.0.6 PHP Bug Type: Scripting Engine problem Bug description: Some children get stuck and consume all CPU time (bug #11676?) After some unexplainable crash of our webserver, i managed tracking down some children who had incredibly high running time (in the order of hundreds of minutes!) and CPU consumption... I backtraced 2 of 'em and this is what i got: #0 0x4012c248 in chunk_free () #1 0x4012bfaa in __cfree () #2 0x8109741 in zend_hash_destroy () #3 0x807bc95 in php_shutdown_config () #4 0x80799a0 in php_config_ini_shutdown () #5 0x8079e85 in php_module_shutdown () #6 0x8079e58 in php_module_shutdown_wrapper () #7 0x8077c45 in php_child_exit_handler () #8 0x814af41 in ap_child_exit_modules () #9 0x8150c5d in clean_child_exit () #10 0x8153a87 in child_main () #11 0x81540ac in make_child () #12 0x8154426 in perform_idle_server_maintenance () #13 0x8154965 in standalone_main () #14 0x8154f23 in main () #15 0x400ea9f3 in __libc_start_main () #0 0x4012c243 in chunk_free () #1 0x4012bfaa in __cfree () #2 0x80f5b4c in shutdown_memory_manager () #3 0x8079978 in php_request_shutdown () #4 0x8077291 in php_apache_request_shutdown () #5 0x8145a0e in run_cleanups () #6 0x814423d in ap_clear_pool () #7 0x81442b1 in ap_destroy_pool () #8 0x8153ebd in child_main () #9 0x81540ac in make_child () #10 0x8154426 in perform_idle_server_maintenance () #11 0x8154965 in standalone_main () #12 0x8154f23 in main () #13 0x400ea9f3 in __libc_start_main () I searched through the bug reports and it looks exactly like bug #11676 adn probably #11723, but that bug has not been solved, or at least it looks so... We're running php 4.0.6(+memory limit fix) on apache 1.3.20 on a linux 2.4.7 with glibc 2.1.3-6 (caldera eserver 2.3). My conf line was: CFLAGS= \ ./configure \ --with-apache=../apache_1.3.20 \ --with-mysql \ --enable-memory-limit Let me know if I have to do something to help you more. Michele Sollazzo -- Edit bug report at: http://bugs.php.net/?id=12583edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12584: Var. comparison
From: [EMAIL PROTECTED] Operating system: Debian GNU/Linux [woody] PHP version: 4.0.5 PHP Bug Type: *General Issues Bug description: Var. comparison Hi $reader, perhaps I'm tired out...but: ? $testvar = true; if ($testvar == DOUBLE) echo WHY?; ? ...why the script output is 'WHY?' ? Bug or feature? :-) Bye, Oliver -- Edit bug report at: http://bugs.php.net/?id=12584edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12584 Updated: Var. comparison
ID: 12584 Updated by: andy Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: *General Issues Operating System: Debian GNU/Linux [woody] PHP Version: 4.0.5 New Comment: any string that is not empty evaluates true. (*Andy*) Previous Comments: [2001-08-05 18:39:20] [EMAIL PROTECTED] Hi $reader, perhaps I'm tired out...but: ? $testvar = true; if ($testvar == DOUBLE) echo WHY?; ? ...why the script output is 'WHY?' ? Bug or feature? :-) Bye, Oliver Edit this bug report at http://bugs.php.net/?id=12584edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12563 Updated: Imlib2 Issue
ID: 12563 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Compile Failure Operating System: RedHat 7.1 / 2.4.7 Kernel PHP Version: 4.0.6 New Comment: The Imlib2 guys say it's a PHP bug: I reported what I thought to be a PHP bug, they say it's a bug in Imlib2. Please have a look. I don't see how this can be an imlib2 bug. it's a bug in php's autoconf/make etc. setup - probably related to how they do imlib2 detection and li checking. they should use imlib2-config [- 10:07AM ~ -]imlib2-config --version 1.0.4 [- 10:07AM ~ -]imlib2-config --cflags -I/usr/local/include -I/usr/X11R6/include [- 10:07AM ~ -]imlib2-config --libs -L/usr/local/lib -lImlib2 -lttf -lm -ldl -lXext -lXext -lX11 -L/usr/X11R6/lib [- 10:07AM ~ -]imlib2-config --prefix /usr/local [- 10:07AM ~ -]imlib2-config --help Usage: imlib2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] to figure out cflags and link flags. this is likely a type.missing character or missing logic statement in their build procedure. it's not an imlib2 bug - unless your imlib2-config is spewing out empty results for --libs or --cflags... which it shoudln't. Previous Comments: [2001-08-04 00:19:43] [EMAIL PROTECTED] Not a PHP bug. Report this to the imlib author instead. [2001-08-04 00:17:05] [EMAIL PROTECTED] make fails while trying to add Imlib2 support. ./configure --with-xml --with-apxs=/usr/sbin/apxs --with-mysql=/usr --with-pgsql --with-imlib I can see the configure script finds my new Imlib2 install: snip checking for imlib2 support... yes checking for imlib_load_image in -lImlib2... yes /snip anyway, here's the error: Making all in . make[1]: Entering directory `/usr/src/php-4.0.6' /bin/sh /usr/src/php-4.0.6/libtool --silent --mode=link gcc -I. -I/usr/src/php-4.0.6/ -I/usr/src/php-4.0.6/main -I/usr/src/php-4.0.6 -I/usr/include/apache -I/usr/src/php-4.0.6/Zend -I/usr/include/mysql -I/usr/src/php-4.0.6/ext/xml/expat/xmltok -I/usr/src/php-4.0.6/ext/xml/expat/xmlparse -I/usr/src/php-4.0.6/TSRM -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2 -o libphp4.la -rpath /usr/src/php-4.0.6/libs -avoid-version -L/usr/local/pgsql/lib -R /usr/local/pgsql/lib stub.lo Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la ext/imlib/libimlib.la ext/mysql/libmysql.la ext/pcre/libpcre.la ext/pgsql/libpgsql.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la ext/xml/libxml.la TSRM/libtsrm.la -lpam -ldl -lpq -lmysqlclient -l -lcrypt -lresolv -lm -ldl -lnsl -lresolv /usr/bin/ld: cannot find -l--library=crypt collect2: ld returned 1 exit status make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/usr/src/php-4.0.6' make: *** [all-recursive] Error 1 I also tried adding a couple of paths to the --with-imlib switch, /usr/local/lib and /usr/local/include. Both variations produced the same error as above. I am trying to add imlib support. This is an upgrade on the same version of PHP I'm already running, 4.06. I experienced no missing crypt libraries on the previous install. I don't exactly understand why it's failing on this error: /usr/bin/ld: cannot find -l--library=crypt I don't see any kind of crypt files listed in the requirements for Imlib2: http://www.mcclanahan.cx/php_imlib/downloads.php If I leave off the --with-imlib option I get no errors, so I know that's the part that's breaking. When I installed Imlib2 there were no errors, and I see the files: locate Imlib2 /usr/local/lib/libImlib2.so.1.0.1 /usr/local/lib/libImlib2.so.1 /usr/local/lib/libImlib2.so /usr/local/lib/libImlib2.la /usr/local/lib/libImlib2.a /usr/local/include/Imlib2.h So I had a look at /etc/ld.so.conf. I added /usr/local/lib and ran ldconfig. This didn't help, same errors as above. A friend pointed out this: -lpq -lmysqlclient -l -lcrypt -lresolv -lm -ldl -lnsl -lresolv ^ | Here's the problem I have no idea how to fix it, if this is the issue... I am using PHP 4.0.6 Apache 1.3.20 MySQL 3.23.40 Postgresql 7.1.2 Imlib2 1.0.1 RedHat 7.1 Edit this bug report at http://bugs.php.net/?id=12563edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [PHP-DOC] Bug #10398 Updated: configuration chapter still has the old php 3 error_reporting values
ok, i'll change it to closed... On Sun, 05 Aug 2001, Cynic wrote: Hi Egon. I checked the page, and it seems like it's been corrected meanwhile. It now contains info for both PHP 3 and 4. The bug should be prolly closed, not bogusified. At 02:30 8/6/2001, [EMAIL PROTECTED] wrote the following: -- On Sun, Aug 05, 2001 at 11:51:19PM -, [EMAIL PROTECTED] wrote: ID: 10398 Updated by: andy Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Documentation problem Operating System: * PHP Version: 4.0.4pl1 New Comment: status - bogus [...] Why? I know Hartmut very well, and he writes no nonsens on the bugs.list. Please reopen that bug. -Egon [EMAIL PROTECTED] - And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] PArameters optionally by Reference and linking against pthread
Hi, How can I within my PHP_FUNCTION() test if a given parameter was passed ByReference ? There used to hang around ParameterPassedByReference() which is gone now. I know I can tell functions via PHP_FE(foo, {1, BYREF_FORCE) etc. if they need references but I need to make a parameter optionally being passed by reference (depending on a value from another paramter). Is using PZVAL_IS_REF( *arg1) on zval **arg1 the proper way ? The other thing .. how can I add -lpthread to libaries when I build the linux CGI version ? Currently its catched in aclocal.m4 and not added to the library list and I only can overcome this my issuing LDFLAGS=-lpthread make; why this ? kind regards, Markus -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] RE: Bug #12536 Updated: fread does not look to be working right
I have not tried it with the 4.0.6 php, is that a stable version yet??? Can I use the ms 6.0 compiler to compile php? Does it matter what compiler I use?? What compiler do you recommend? I will update the message with a example Brendan Ferguson -Original Message- From: Bug Database [mailto:[EMAIL PROTECTED]] Sent: August 2, 2001 5:38 PM To: [EMAIL PROTECTED] Subject: Bug #12536 Updated: fread does not look to be working right ID: 12536 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Performance problem Operating System: win 98 box PHP Version: 4.0.4pl1 New Comment: Have you tried with PHP 4.0.6? And could you also add a short example script into this bug report? --Jani Previous Comments: [2001-08-02 17:34:06] [EMAIL PROTECTED] fread does not look like it is reading the EOF. when i use a large (HUDGE) number to tell the fread() how many characters to read, it takes a l o n g time for this to complete this happens even when the file is very short. i descoverd this when i was trying to read an entire file into a string. is fread the best way to do this?? it does not seem to be working very well. there is also a error reporting problem with fread. after the same number gets too big, php stops processing the entire page, (it does check syntax) there is als no error message when this happens. Knight ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=12536edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12536 Updated: fread does not look to be working right
ID: 12536 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Old Status: Feedback Status: Open Bug Type: Performance problem Operating System: win 98 box PHP Version: 4.0.4pl1 New Comment: $filefill = fread($fp, 1); //will take a long time on a very small file. if you add another 0, it will cause a Internal Server Error - this is not surprising. computers dont deal well with BIG numbers. i could not get php to re-create the error where it silently did not work. Previous Comments: [2001-08-02 17:38:11] [EMAIL PROTECTED] Have you tried with PHP 4.0.6? And could you also add a short example script into this bug report? --Jani [2001-08-02 17:34:06] [EMAIL PROTECTED] fread does not look like it is reading the EOF. when i use a large (HUDGE) number to tell the fread() how many characters to read, it takes a l o n g time for this to complete this happens even when the file is very short. i descoverd this when i was trying to read an entire file into a string. is fread the best way to do this?? it does not seem to be working very well. there is also a error reporting problem with fread. after the same number gets too big, php stops processing the entire page, (it does check syntax) there is als no error message when this happens. Knight Edit this bug report at http://bugs.php.net/?id=12536edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11885 Updated: Link problems with OpenSSL 0.9.6a
ID: 11885 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Feedback Status: Assigned Bug Type: OpenSSL related Operating System: Solaris 7 08/99 PHP Version: 4.0.6 Old Assigned To: Assigned To: sniper New Comment: Still happens with latest CVS. Previous Comments: [2001-08-04 19:47:37] [EMAIL PROTECTED] Could you please try the latest CVS snapshot from http://snaps.php.net/ to verify if this is fixed now? --Jani [2001-07-04 15:14:50] [EMAIL PROTECTED] I'm unable to link libphp4.la using --with-openssl. I'm using: gcc version 2.95.3 20010315 (release) ltmain.sh (GNU libtool) 1.4 (1.920 2001/04/24 23:26:18) GNU ld 2.11.2 Apache/1.3.20 (Unix) openssl-0.9.6a binutils-2.11.2 make[1]: Entering directory `/usr/local/src/newapache/apachee/t2/php-4.0.6' /bin/sh /usr/local/src/newapache/apachee/t2/php-4.0.6/libtool --silent --mode=compile gcc -I. -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ -I/usr/local/src/newapache/apachee/t2/php-4.0.6/main -I/usr/local/src/newapache/apachee/t2/php-4.0.6 -I/usr/local/newapache/include -I/usr/local/src/newapache/apachee/t2/php-4.0.6/Zend -I/usr/local/apachedeps/include -I/usr/local/apachedeps/include/freetype2/freetype -I/usr/local/apachedeps/include/c-client -I/usr/local/apachedeps/include/mysql -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ext/xml/expat/xmltok -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ext/xml/expat/xmlparse -I/usr/local/src/newapache/apachee/t2/php-4.0.6/TSRM -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_EXPAT -DSHARED_CORE -DSUPPORT_UTF8 -DXML_BYTE_ORDER=21 -Os -c stub.c /bin/sh /usr/local/src/newapache/apachee/t2/php-4.0.6/libtool --silent --mode=link gcc -I. -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ -I/usr/local/src/newapache/apachee/t2/php-4.0.6/main -I/usr/local/src/newapache/apachee/t2/php-4.0.6 -I/usr/local/newapache/include -I/usr/local/src/newapache/apachee/t2/php-4.0.6/Zend -I/usr/local/apachedeps/include -I/usr/local/apachedeps/include/freetype2/freetype -I/usr/local/apachedeps/include/c-client -I/usr/local/apachedeps/include/mysql -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ext/xml/expat/xmltok -I/usr/local/src/newapache/apachee/t2/php-4.0.6/ext/xml/expat/xmlparse -I/usr/local/src/newapache/apachee/t2/php-4.0.6/TSRM -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_EXPAT -DSHARED_CORE -DSUPPORT_UTF8 -DXML_BYTE_ORDER=21 -Os -o libphp4.la -rpath /usr/local/src/newapache/apachee/t2/php-4.0.6/libs -avoid-version -L/usr/ucblib -L/usr/local/apachedeps/lib -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3 -L/usr/local/apachedeps/lib/mysql -R /usr/ucblib -R /usr/local/apachedeps/lib -R /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3 -R /usr/local/apachedeps/lib/mysql stub.lo Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la ext/zlib/libzlib.la ext/bz2/libbz2.la ext/db/libdb.la ext/dba/libdba.la ext/ftp/libftp.la ext/gd/libgd.la ext/gettext/libgettext.la ext/imap/libimap.la ext/mysql/libmysql.la ext/openssl/libopenssl.la ext/pcre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la ext/sysvsem/libsysvsem.la ext/sysvshm/libsysvshm.la ext/xml/libxml.la TSRM/libtsrm.la -lgdbm -lpam -lc-client -ldl -lmysqlclient -lz -lpam -lintl -lgd -lfreetype -lpng -lz -ljpeg -lgdbm -lbz2 -lz -lcrypt -lssl -lcrypto -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc /usr/local/sparc-sun-solaris2.7/bin/ld: .libs/libphp4.so: undefined versioned symbol name des_encrypt1@@SUNWprivate_1.1 /usr/local/sparc-sun-solaris2.7/bin/ld: failed to set dynamic section sizes: Bad value collect2: ld returned 1 exit status make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/usr/local/src/newapache/apachee/t2/php-4.0.6' make: *** [all-recursive] Error 1 All the above mentioned tools except gcc are built from source. I've also tried linking some of them with Sun's ld (/usr/ccs/bin/ld), resulting in the same link error (php uses libtool and GNU ld any way). If I leave out --with-openssl, building and linking goes fine. My complete configure command: # CFLAGS=-Os ./configure --enable-sysvsem --enable-sysvshm --enable-ftp \ --with-mysql=/usr/local/apachedeps --with-apxs=/usr/local/newapache/bin/apxs \ --with-zlib=/usr/local/apachedeps --with-bz2=/usr/local/apachedeps \ --with-jpeg-dir=/usr/local/apachedeps --with-tiff-dir=/usr/local/apachedeps \ --with-png-dir=/usr/local/apachedeps --enable-shared --enable-libgcc \ --with-freetype-dir=/usr/local/apachedeps --with-gd=/usr/local/apachedeps \ --with-gdbm=/usr/local/apachedeps --with-openssl=/usr/local/apachedeps \ --with-imap=/usr/local/apachedeps --with-config-file-path=/etc \ --with-gettext=/usr/local/apachedeps
[PHP-DEV] CVS Account Request
Full name: Chris Lambert Email: [EMAIL PROTECTED] ID:chris Purpose: Password reset. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12580 Updated: sunos 4 doesn't have strtoul. using strtol works...
ID: 12580 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Compile Failure Operating System: SunOS 4. PHP Version: 4.0.6 New Comment: See bug #7474. I've send you the patch..but you should really consider updating your OS. --Jani Previous Comments: [2001-08-05 13:58:10] [EMAIL PROTECTED] compiling ext/standard/scanf.c on sunos 4 is a problem - there's a declaration problem with strtol in php_sscanf_internal, and strtoul doesn't exist at all. Edit this bug report at http://bugs.php.net/?id=12580edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #12575 Updated: Session register destroyflaws/bugs(?)
Closed? Or a Feature/Change request? --Jani On 5 Aug 2001 [EMAIL PROTECTED] wrote: ID: 12575 Updated by: rasmus Reported By: [EMAIL PROTECTED] Old Status: Open Status: Analyzed Bug Type: Session related Operating System: Linux PHP Version: 4.0.6 New Comment: I think this is consistent behaviour. session_start() brings data from your session backend into your current script. session_destroy() destroys the session data in your session backend. It does not and should not affect variables which are currently active in your script. The session_start() and session_unset() functions are designed to affect the current active symbol table. Previous Comments: [2001-08-05 07:32:21] [EMAIL PROTECTED] Whilst the PHP session support is a great feature, handling session state as of 4.0.6 is inconsistent and arguably flawed and has some gotchas, as illustrated in the two scripts after these details. There are workarounds which I'll explain. This assumes track vars enabled, as it always is since 4.0.3 anyway, and register globals is enabled. In summary 1) Registering a global with session_register() doesn't update $HTTP_SESSION_VARS until the session is restored, so don't use $HTTP_SESSION_VARS for accessing intra-session state changes unless you set $HTTP_SESSION_VARS as well as your global. 2) Destroying a session doesn't reset the state of $HTTP_SESSION_VARS. Ouch! Creating a new session immediately afterwards does work as expected though, and produces a clean session. 3) BUT, destroying a session never unsets the state of registered globals. Ouch again! So be wary of using globals rather than HTTP_SESSION_VARS for getting at session state if you ever conditionally destroy sessions and subsequently access session data, unless of course you explicitly unset your globals too. Executing x.php then y.php illustrate the problems. The output is: Assert failed: OOPS, foo session var is unset Assert failed: OOPS, foo session var still set on destroyed session Assert failed: OOPS, global foo is still set x.php: ?php // -*- c++ -*- // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Get a clean session session_start(); session_destroy(); session_start(); // Style 1. We use HTTP_SESSION_VARS to access session state // This works fine for a restored session, but intra-session // it doesn't. e.g. $foo = 'bar'; // Set it session_register('foo'); // Register global // Assert fails - foo isn't a useable session variable (yet) after all myassert(isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var is unset); ? y.php: ?php // -*- c++ -*- ob_start(); // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Restore session with foo set from x.php session_start(); // Style 2. As HTTP_SESSION_VARS doesn't get set intra-session, lets // try using globals as our session mechanism instead. myassert(isset($foo), Global foo not restored); // OK. global restored myassert(isset($HTTP_SESSION_VARS['foo']), Session foo not restored); // OK // Now lets try destroying the session as, for example, our script was // passed a logout request somehow session_destroy(); // This should do it myassert(!isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var still set on destroyed session); // FAILS session_start(); myassert(!isset($HTTP_SESSION_VARS['foo']), foo session var still set on destroyed session); // OK, not it's not // But remember that we decided to use globals because of the problems with // HTTP_SESSION_VARS not being updated intra-session, well lets check the // state of our global $foo myassert(!isset($foo), OOPS, global foo is still set); /// FAILS, oh dear! ob_end_flush(); ? Edit this bug report at http://bugs.php.net/?id=12575edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #12581 Updated: boolean fields not imported (patchesenclosed)
Could you please tell me what is the 'Bogus' in this report? It's a bug report which happens to have a patch for the bug too. This is far from bogus report. Reopened. --Jani On 5 Aug 2001 [EMAIL PROTECTED] wrote: ID: 12581 Updated by: andy Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: dBase related Operating System: Linux 2.2.16-3 PHP Version: 4.0.6 New Comment: status - bogus Previous Comments: [2001-08-05 16:18:03] [EMAIL PROTECTED] this is not a bug...already forwarded to [EMAIL PROTECTED] Thanks for your help, but next time just send it to [EMAIL PROTECTED] and don't open a bug about it. [2001-08-05 16:17:47] [EMAIL PROTECTED] The file name to which the patches apply is ext/dbase/dbase.c. [2001-08-05 16:16:32] [EMAIL PROTECTED] Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; Edit this bug report at http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: Bug #12580 Updated: sunos 4 doesn't have strtoul. using strtol works...
See bug #7474. I've send you the patch..but you should really consider updating your OS. Grin. What else runs on my ancient SPARC? :-) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12581 Updated: boolean fields not imported (patches enclosed)
ID: 12581 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Bogus Status: Feedback Bug Type: dBase related Operating System: Linux 2.2.16-3 PHP Version: 4.0.6 New Comment: This is not a bogus report. But please put the patch file somewhere where it can be downloaded and add the url here. Also, create it in unified format against latest CVS: # cvs diff -u ext/dbase/dbase.c This will make it more appealing to be committed.. :) --Jani Previous Comments: [2001-08-05 16:18:21] [EMAIL PROTECTED] status - bogus [2001-08-05 16:18:03] [EMAIL PROTECTED] this is not a bug...already forwarded to [EMAIL PROTECTED] Thanks for your help, but next time just send it to [EMAIL PROTECTED] and don't open a bug about it. [2001-08-05 16:17:47] [EMAIL PROTECTED] The file name to which the patches apply is ext/dbase/dbase.c. [2001-08-05 16:16:32] [EMAIL PROTECTED] Below are patches that fix the problem reported 10/20/2000 in bug report #7374. The problem is that when boolean (TRUE or FALSE) fields are present in an imported Dbase file, the value is always imported as FALSE (0). This problem has been present since 4.0.3. The patches below were generated using distribution 4.0.6. 466,467c466 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 473a473,486 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y' ) ){ add_next_index_long(return_value, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_next_index_long(return_value, strtol(0, NULL, 10)); } else { add_next_index_long(return_value, strtol( , NULL, 10)); } } break; 544,545c557 case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ --- case 'N': 551a564,578 case 'L': /* we used to FALLS THROUGH, but now we check for T/Y and F/N and insert 1 or 0, respectively. db_fdc is the number of decimals, which we don't care about. 3/14/01 LEW */ if ( (*str_value == 'T') || ( *str_value == 'Y') ){ add_assoc_long(return_value, cur_f-db_fname, strtol(1, NULL, 10)); } else { if ( (*str_value == 'F') || ( *str_value == 'N' ) ){ add_assoc_long(return_value, cur_f-db_fname,strtol(0, NULL, 10)); } else { add_assoc_long(return_value, cur_f-db_fname,strtol( , NULL, 10)); } } break; Edit this bug report at http://bugs.php.net/?id=12581edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: Bug #12580 Updated: sunos 4 doesn't have strtoul.using strtol works...
On Sun, 5 Aug 2001, Christopher A. Kantarjiev wrote: See bug #7474. I've send you the patch..but you should really consider updating your OS. Grin. What else runs on my ancient SPARC? :-) Linux? :) --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #12575 Updated: Session register destroyflaws/bugs(?)
Closed? Or a Feature/Change request? Close it, I guess. It is working as it was designed and we can't really change this at this point because it would break a bunch of existing scripts. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12575 Updated: Session register destroy flaws/bugs(?)
ID: 12575 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Analyzed Status: Closed Bug Type: Session related Operating System: Linux PHP Version: 4.0.6 New Comment: Not a bug. Previous Comments: [2001-08-05 14:34:22] [EMAIL PROTECTED] I think this is consistent behaviour. session_start() brings data from your session backend into your current script. session_destroy() destroys the session data in your session backend. It does not and should not affect variables which are currently active in your script. The session_start() and session_unset() functions are designed to affect the current active symbol table. [2001-08-05 07:32:21] [EMAIL PROTECTED] Whilst the PHP session support is a great feature, handling session state as of 4.0.6 is inconsistent and arguably flawed and has some gotchas, as illustrated in the two scripts after these details. There are workarounds which I'll explain. This assumes track vars enabled, as it always is since 4.0.3 anyway, and register globals is enabled. In summary 1) Registering a global with session_register() doesn't update $HTTP_SESSION_VARS until the session is restored, so don't use $HTTP_SESSION_VARS for accessing intra-session state changes unless you set $HTTP_SESSION_VARS as well as your global. 2) Destroying a session doesn't reset the state of $HTTP_SESSION_VARS. Ouch! Creating a new session immediately afterwards does work as expected though, and produces a clean session. 3) BUT, destroying a session never unsets the state of registered globals. Ouch again! So be wary of using globals rather than HTTP_SESSION_VARS for getting at session state if you ever conditionally destroy sessions and subsequently access session data, unless of course you explicitly unset your globals too. Executing x.php then y.php illustrate the problems. The output is: Assert failed: OOPS, foo session var is unset Assert failed: OOPS, foo session var still set on destroyed session Assert failed: OOPS, global foo is still set x.php: ?php // -*- c++ -*- // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Get a clean session session_start(); session_destroy(); session_start(); // Style 1. We use HTTP_SESSION_VARS to access session state // This works fine for a restored session, but intra-session // it doesn't. e.g. $foo = 'bar'; // Set it session_register('foo');// Register global // Assert fails - foo isn't a useable session variable (yet) after all myassert(isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var is unset); ? y.php: ?php // -*- c++ -*- ob_start(); // track vars and register globals enabled function myassert($b, $what) { if ($b !== true) { echo preAssert failed: $what/pre; } } // Restore session with foo set from x.php session_start(); // Style 2. As HTTP_SESSION_VARS doesn't get set intra-session, lets // try using globals as our session mechanism instead. myassert(isset($foo), Global foo not restored); // OK. global restored myassert(isset($HTTP_SESSION_VARS['foo']), Session foo not restored); // OK // Now lets try destroying the session as, for example, our script was // passed a logout request somehow session_destroy(); // This should do it myassert(!isset($HTTP_SESSION_VARS['foo']), OOPS, foo session var still set on destroyed session); // FAILS session_start(); myassert(!isset($HTTP_SESSION_VARS['foo']), foo session var still set on destroyed session); // OK, not it's not // But remember that we decided to use globals because of the problems with // HTTP_SESSION_VARS not being updated intra-session, well lets check the // state of our global $foo myassert(!isset($foo), OOPS, global foo is still set); /// FAILS, oh dear! ob_end_flush(); ? Edit this bug report at http://bugs.php.net/?id=12575edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12536 Updated: fread does not look to be working right
ID: 12536 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Performance problem Operating System: win 98 box PHP Version: 4.0.4pl1 New Comment: You should consider using something like the first example is on this page: http://www.php.net/manual/en/function.fread.php Anyway, works very nicely for me with PHP 4.0.6 in WindowsME. --Jani Previous Comments: [2001-08-05 22:25:21] [EMAIL PROTECTED] $filefill = fread($fp, 1); //will take a long time on a very small file. if you add another 0, it will cause a Internal Server Error - this is not surprising. computers dont deal well with BIG numbers. i could not get php to re-create the error where it silently did not work. [2001-08-02 17:38:11] [EMAIL PROTECTED] Have you tried with PHP 4.0.6? And could you also add a short example script into this bug report? --Jani [2001-08-02 17:34:06] [EMAIL PROTECTED] fread does not look like it is reading the EOF. when i use a large (HUDGE) number to tell the fread() how many characters to read, it takes a l o n g time for this to complete this happens even when the file is very short. i descoverd this when i was trying to read an entire file into a string. is fread the best way to do this?? it does not seem to be working very well. there is also a error reporting problem with fread. after the same number gets too big, php stops processing the entire page, (it does check syntax) there is als no error message when this happens. Knight Edit this bug report at http://bugs.php.net/?id=12536edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP Extensions: C or C++?
On Wed, 25 Jul 2001, J Smith wrote: I have a few PHP extensions that I'd be willing to share but I've never done this sort of thing before. I wrote a few extensions for work, and my company sees no problem in donating them to the open source world and to the PHP project, but I'm curious about something: Are extensions for PHP required to be coded in C, or will C++ do? I'm a C++ guy myself, and since PHP is largely written in C, does this cause a huge problem? If there's enough interest in any of my extensions, I'd consider a re-write from C++ to C, but I don't want to do that if I don't have to. The only extension really ready for prime-time right now is a rather simple Porter stemmer, written in ANSI/ISO C++ using things like the standard C++ string library and such. It's a simple extension that we're using to make the search engine we're building a bit easier to manage. Any future extensions are going to be focused on making search engines easier to implement in PHP. (We're building a search engine that uses PHP.) Any interest in that sort of thing? And if so, C or C++? Using C++ in a PHP extension is pretty simple. I have developed a framework called Zpp for implementing PHP extensions and most notably PHP classes in C++ making it even simpler (at least for me :-) Zpp is part of a PHP extension called Universe that uses the C++ CORBA ORB named MICO to connect PHP to CORBA objects. (Universe is an improved version of my old PHP extension called Satellite.) I plan to release Universe this week, so keep an eye on php-dev... Regards, David Eriksson -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP Extensions: C or C++?
On Mon, 6 Aug 2001, David Eriksson wrote: named MICO to connect PHP to CORBA objects. (Universe is an improved version of my old PHP extension called Satellite.) I plan to release Universe this week, so keep an eye on php-dev... Is it going to replace ext/satellite or be a new one?? Is Satellite not maintained anymore? There are couple of bugs reported.. --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP Extensions: C or C++?
Quoting Jani Taskinen [EMAIL PROTECTED]: On Mon, 6 Aug 2001, David Eriksson wrote: named MICO to connect PHP to CORBA objects. (Universe is an improved version of my old PHP extension called Satellite.) I plan to release Universe this week, so keep an eye on php-dev... Is it going to replace ext/satellite or be a new one?? Is Satellite not maintained anymore? There are couple of bugs reported.. (One bug, I believe. But that's one too many of course.) I do not maintain Satellite any more and Universe is indeed intended to replace Satellite. I will contact the person who issued the bug and offer to help him use Universe when I release it. Regards, -\- David Eriksson -/- An expert in a particular computer language is really an expert in the work-arounds necessary to use this language to perform useful work. - Richard B. Johnson -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]