Re: [PHP-DEV] Re: cvs: ZendEngine2 / Zend.m4 php-src acinclude.m4

2005-04-01 Thread David Sklar
On Feb 27, 2005 8:19 AM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > On Sun, 27 Feb 2005, Sebastian Bergmann wrote: > > > Jani Taskinen wrote: > >> AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75 or 1.875 if you want > > > > bison 2.0 also works (at least for me). > > Let's not add that to

Re: [PHP-DEV] Re: cvs: ZendEngine2 / Zend.m4 php-src acinclude.m4

2005-04-04 Thread David Sklar
On Apr 2, 2005 1:55 AM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > On Fri, 1 Apr 2005, David Sklar wrote: > > > On Feb 27, 2005 8:19 AM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > >> On Sun, 27 Feb 2005, Sebastian Bergmann wrote: > >> > >>>

[PHP-DEV] [PATCH] getting current request's response code

2008-06-16 Thread David Sklar
Any interest in the attached patch? It introduces a "headers_response_code()" function which returns SG(sapi_headers).http_response code. This information does not seem to be otherwise available -- the status line does not come back with headers_list(). Index: ext/standard/basic_functions.c ===

RE: [PHP-DEV] issues with gettext on multithreaded servers

2003-03-21 Thread David Sklar
On Friday, March 21, 2003 1:11 PM, Wez Furlong wrote: > Perhaps it would be a good idea to develop a PEAR package that sits on > top of the win32nls and/or UNIX nls functions to provide a portable > API for PHP scripts? This is a good idea. The extension can be told whether thread-specific settin

[PHP-DEV] max_execution_time - ITIMER_REAL vs ITIMER_PROF

2007-04-04 Thread David Sklar
I'm interested in having a timeout that corresponds to clock time as opposed to PHP execution time (the current behavior of max_execution_time). A cursory scan of the source implies that (on Unix at least) something that behaves like zend_set_timeout() but uses setitimer()'s ITIMER_REAL timer inst

[PHP-DEV] Trapping "memory exhausted" error

2007-04-16 Thread David Sklar
I am interested in being able to trap the (currently) fatal error that results when memory usage exceeds the defined memory limit. I was thinking it could work as follows: - in addition to a memory_limit configuration directive, there could be a "memory_limit_grace" configuration directive. This

Re: [PHP-DEV] Trapping "memory exhausted" error

2007-04-17 Thread David Sklar
On 4/16/07, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > - in addition to a memory_limit configuration directive, there could > be a "memory_limit_grace" configuration directive. This gets stored in > the struct _zend_mm_heap, along with the limit. That could be a problem because it's very ha

Re: [PHP-DEV] Trapping "memory exhausted" error

2007-04-17 Thread David Sklar
On 4/17/07, Peter Hodge <[EMAIL PROTECTED]> wrote: Hello, A soft memory limit could be very useful; it doesn't necessarily need to throw an error, but it would provide an opportunity to free some memory and prevent the script from crashing. Perhaps something like: // function to call when me

Re: [PHP-DEV] Trapping "memory exhausted" error

2007-04-18 Thread David Sklar
On 4/17/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Tue, April 17, 2007 3:16 am, David Sklar wrote: > Richard Lynch <[EMAIL PROTECTED]> wrote: >> You might also come at it from the other direction and detect/notify >> at some number smaller than the current

Re: [PHP-DEV] Trapping "memory exhausted" error

2007-04-18 Thread David Sklar
On 4/17/07, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > In my current situation, bail out, but gracefully -- perhaps just send > a 302 to an error page and exit; maybe instead throw away the output > buffer and then directly output some friendly error text. I think you can do it with shutdow

Re: [PHP-DEV] require_once

2007-04-24 Thread David Sklar
require_once verifies (via stat()) each path component in the path being loaded so that it can canonicalize it to check it against the canonicalized list of already-required files. Run your script below under strace and you will see all of those stats gumming up the works. Note also that if you

[PHP-DEV] Internal zvals can't be arrays

2004-05-13 Thread David Sklar
zend_declare_property() tells me that I can't use it to create a class property that is an array. Why is that? What is the recommended way to create an array class property? Thanks, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Internal zvals can't be arrays

2004-05-13 Thread David Sklar
I think your humor is too subtle for me. I don't understand what you mean. If I do this: PHP_METHOD(test_class,__construct); zend_class_entry *test_class_ce_ptr = NULL; static zend_function_entry test_class_functions[] = { PHP_ME(test_class, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL

Re: [PHP-DEV] Internal zvals can't be arrays

2004-05-13 Thread David Sklar
I think your humor is too subtle for me. I don't understand what you mean. If I do this: sorry i just wanted to say that if you find out a solution you should tell it to me and that atm i don't have any idea how to do it. [...] Your code was absolute correct. OK, I figured that since you wrote

[PHP-DEV] fputcsv commit

2004-04-27 Thread David Sklar
Is my fputcsv patch going to be committed before or after the release of PHP 5.0.0? I don't particularly care either way (it's not a bugfix so presumably after 5.0.0?) but if it will be before 5.0.0 then I will mention it in an in-progress book; otherwise not. Thanks, David -- PHP Internals - P

Re: [PHP-DEV] Re: Internal properties

2004-07-22 Thread David Sklar
Marcus and I briefly discussed creating properties that are arrays in this thread: --> http://www.zend.com/lists/php-dev/200405/msg00221.html I posted some code that was working for me, but perhaps it has problems? David Andi Gutmans wrote: At 11:01 PM 7/21/2004 -0700, Andrei Zmievski wrote: Hi,

[PHP-DEV] SimpleXML returning attributes as objects instead of strings

2004-08-02 Thread David Sklar
SimpleXML returns attribute values as SimpleXMLElement objects instead of strings. E.g, given this: $sxe = simplexml_load_string('Doc Ock'); $sxe['arms'] and $sxe['legs'] are SimpleXMLElement objects. This mostly works OK, but causes problems when using empty() to test if an attribute has a va

Re: [PHP-DEV] SimpleXML returning attributes as objects instead of strings

2004-08-02 Thread David Sklar
Ahh. Thanks. David Sterling Hughes wrote: iterators... On Mon, 02 Aug 2004 16:53:49 -0400, David Sklar <[EMAIL PROTECTED]> wrote: SimpleXML returns attribute values as SimpleXMLElement objects instead of strings. E.g, given this: $sxe = simplexml_load_string('Doc Ock'); $sxe['

[PHP-DEV] fputcsv()

2004-08-11 Thread David Sklar
Attached is my fputcsv() patch (and a test case) from April. Could someone commit this to 5.1 or 5.0.1? Thanks, David Index: ext/standard/file.c === RCS file: /repository/php-src/ext/standard/file.c,v retrieving revision 1.380 diff -

Re: [PHP-DEV] fputcsv()

2004-09-02 Thread David Sklar
Marcus Boerger wrote: Hello David, as promised i looked at the patch. Besides a small misstake it looks good. But it seems to work different then fgetcsv(). In other words if you write using fputcsv() you are not sure to get the same back with fgetcsv(). Though my current opinion is that fputcsv(

Re: [PHP-DEV] fputcsv()

2004-09-02 Thread David Sklar
Marcus Boerger wrote: Hello David, i looked up the fputcsv() magic in the file manually and agree that this is fairly correct (as i wrote before). But when i execute the test the second var_export() is supposed to show the input from the .phpt file. Unfortunatley i get a FAIL from run-tests.php: F

[PHP-DEV] regex operators

2003-10-14 Thread David Sklar
I was thinking about adding one or two regex-related features to the engine: 1. "preg_case": this would behave just like case but instead of doing an equality comparison, would match against a regular expression, e.g. switch($data) { preg_case '/^\d{5}(-\d{4})?$/': print "US Postal Code

RE: [PHP-DEV] regex operators

2003-10-14 Thread David Sklar
gt;> switch ($data, "preg_match") { >>case '/foo.*?bar/i' : /* computation here */ >> break; >> } >> >> >> The second argument is a callback. >> >> Andrey >> >> David Sklar wrote: >> >>> I was thinking ab

RE: [PHP-DEV] regex operators

2003-10-14 Thread David Sklar
On Tuesday, October 14, 2003 11:18 AM, mailto:[EMAIL PROTECTED] wrote: > Right, and as George's example already works I see no point in adding > more 'magic' operators that look like Perl to me. What about a match operator? I realize that similar functionality can be achieved with preg_match(), b

RE: [PHP-DEV] regex operators

2003-10-14 Thread David Sklar
On Tuesday, October 14, 2003 1:10 PM, mailto:[EMAIL PROTECTED] wrote: > You are pushing towards > > $_~=/^\.*?\$$/; > > This is not human-readable code and one of the basic characteristics > that sets PHP apart from Perl. Actually, I'm pushing towards if (! ($_REQUEST['email'] =~ '/[EMAIL PROT

RE: [PHP-DEV] regex operators

2003-10-14 Thread David Sklar
>> My motivation for this operator is to encourage regular expression >> use as part of the core toolbox of PHP programmers. I think, >> especially in a web context, where so much work has to do with data >> validation and manipulation, that this is a reasonable goal. The >> features that the preg_

[PHP-DEV] linking with VS.NET: executor_globals_id is an unresolved external symbol

2004-02-27 Thread David Sklar
Using Visual Studio.NET, I can build PHP fine using the php5ts project/solution. I have a problem, however, with another project I've added to the solution which is a custom extension with no external (to PHP) library dependencies. It was working (compiling, linking, and then being loaded into PHP

Re: [PHP-DEV] sqlite's oo api

2004-03-24 Thread David Sklar
George Schlossnagle wrote: Being concerned about BC before there is an actual release seems silly to me. The whole of PHP5 could be accurately described as 'experimental' atm. +INF Everyone who is using PHP5 right now knows (or plausibly should know) that it is experimental. Even the text acco

[PHP-DEV] fputcsv()

2004-04-11 Thread David Sklar
Attached is a patch that implements fputcsv() as a complement to fgetcsv(). There are two things that still need improvement: - It adds "\n" as a newline onto the end of each line. I think it would be better to add a platform-specific line ending. - It is not mbstring-aware. Any suggestions fo

Re: [PHP-DEV] fputcsv()

2004-04-11 Thread David Sklar
Perfect, thanks. I knew there was a #define lurking around somewhere that was \r\n, \r, or \n, as appropriate, I just didn't know what it was called. David Andi Gutmans wrote: How about using PHP_EOL? At 12:33 PM 4/11/2004 -0400, David Sklar wrote: Attached is a patch that imple

Re: [PHP-DEV] fputcsv()

2004-04-12 Thread David Sklar
Thanks for the line-ending feedback everyone, and Ilia for the code cleanup. Attached is a diff that implements the (cleaned up) function and a test file for tests/basic. If someone with appropriate karma could commit these, that'd be great. Thanks, David Index: ext/standard/file.c =

Re: [PHP-DEV] Exceptions and Errors

2004-04-13 Thread David Sklar
George Schlossnagle wrote: This doesn't print "Brray" or maybe "Arraz"? :) David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php