l0t3k | 1 Jul 01:24 2006
Picon

[PHP-DEV] Re: TSRMLS_D/C persistence

Andrew,
  i've only skimmed your question, and at the risk of being irrelevant ...

check out

http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/property.c?revision=1.14&view=markup

and search for  PHP_FUNCTION(char_enum_names).

Pay attention to the macro
  TSRMLS_SET_CTX(ectx.thread_ctx)in that function, and the macro 
TSRMLS_FETCH_FROM_CTX(ctx->thread_ctx);in the callback 
php_enum_char_type_range()l0t3k

""Andrew MatherBt"" <an.dromeda <at> btconnect.com> wrote in message 
news:200606302354.02272.an.dromeda <at> btconnect.com...
>
> How long are the TSRMLS_D/C parameters good for?
>
> Can the resultant tsrm_ls value be safely stored?
>
> I presume the answer is no, and these paramters
> should be passed in each time a function is called,
> but I would be curious to know differently, if for example
> it could be passed in once at (external object) creation time,
> and that object could use the trsm_ls directly, rather than the
> TSRMLS_D/C semantics.
>
> ...
>
(Continue reading)

Sara Golemon | 1 Jul 03:18 2006
Picon
Picon

[PHP-DEV] Re: TSRMLS_D/C persistence

> How long are the TSRMLS_D/C parameters good for?
>
The life of a given thread.

> Can the resultant tsrm_ls value be safely stored?
>
Yes, but only during the life of a thread.  For practical purposes, you 
should consider this to mean the life of a request since there is no 
guarantee that subsequent requests will be serviced by the same thread.

> I presume the answer is no, and these paramters
> should be passed in each time a function is called,
> but I would be curious to know differently, if for example
> it could be passed in once at (external object) creation time,
> and that object could use the trsm_ls directly, rather than the
> TSRMLS_D/C semantics.
>
Yes, and I've done that on more than one occasion.

A given tsrm_ls value is tied to a thread (and uniquely identifies that 
thread).  Since a given request never jumps from one thread to another (It 
stays in the thread it was born in), the tsrm_ls you get at one point in a 
request will be the tsrm_ls you get at another point in a request.

-Sara
http://blog.libssh2.org/index.php?/archives/22-What-the-heck-is-TSRMLS_CC-anyway.html 

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)

Gwynne | 1 Jul 11:17 2006

[PHP-DEV] Configure summary

I was poking around at the TODO and I saw this:

     * make configure print out a summary when it's done (like XEmacs)

I'm working on a patch to bring in this functionality, out of sheer  
"I need to learn more about autoconf and I want to contribute to PHP"- 
ness :). Does anyone have any thoughts on what might go into such a  
summary? So far, I have install prefix, SAPI, debug on/off, things of  
that simple nature. Also, any thoughts on whether the summary should  
be printed from configure itself or config.status?

-- Gwynne, Daughter of the Code
"This whole world is an asylum for the incurable."

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Matt W | 1 Jul 12:30 2006

Re: [PHP-DEV] [PATCH] array_fill: Allow an array to specify keys

Hi all,

I didn't receive any feedback about the first patch I sent (against
PHP_5_1), but have since realized that I should just use the MAIN branch, is
that correct?  Will someone then take care of backporting to older versions
if needed...?  (Also, from looking at http://cvs.php.net it looks like
PHP_5_1 was branched to 5_2 -- sorry about the 5_1 patch. :-/)

So here's the patch to extend array_fill() for MAIN.  Did I get it right
this time? :-)

Thanks,
Matt

----- Original Message ----- 

> Hi all,
>
> I'm on Windows and haven't tried submitting a patch before, so I JUST now
> installed WinCvs since I don't think you want just a diff of my local
file.
> I used PHP_5_1 since: 5.1's the "regular" download I started working on;
if
> you use it, I assume this can go in 5.1; and I don't know what to do. :-)
>
> I've been casually browsing through the PHP source for a while, but never
> modified it or used C.  Just found out about VC++ Express, etc. and set it
> up to try messing with PHP.  Had some missing file errors while building
> (don't know if that's my problem, or a bug...), but got it done after
> changing a few files that were causing them.  Just some background... ;-)
(Continue reading)

Marcus Boerger | 1 Jul 12:53 2006
Picon
Picon

Re: [PHP-DEV] [PATCH] array_fill: Allow an array to specify keys

Hello Matt,

  patch looks fine now, once we agree to this set you'd have to provide
a patch for 5.2 as well. Another thing we need is tests to ensure all
is working as expected.

best regards
marcus

Saturday, July 1, 2006, 12:30:48 PM, you wrote:

> Index: ext/standard/array.c
> ===================================================================
> RCS file: /repository/php-src/ext/standard/array.c,v
> retrieving revision 1.350
> diff -u -r1.350 array.c
> --- ext/standard/array.c        25 Jun 2006 19:19:31 -0000      1.350
> +++ ext/standard/array.c        1 Jul 2006 09:58:26 -0000
>  <at>  <at>  -1625,46 +1625,83  <at>  <at> 
>     Create an array containing num elements starting with index start_key each initialized to val */
>  PHP_FUNCTION(array_fill)
>  {
> -       zval **start_key, **num, **val, *newval;
> +       zval **key_data, **num, **val, **entry;
>         long i;
> +       HashPosition pos;
>  
> -       if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &start_key, &num, &val) == FAILURE) {
> +       if ((ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &key_data, &num, &val) == FAILURE) &&
> +               (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &key_data, &val) == FAILURE)) {
(Continue reading)

Patt Emmawat | 1 Jul 14:08 2006
Picon

[PHP-DEV] CVS Account Request: sailomsaengdaed

sailomsaengdaed

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Sara Golemon | 1 Jul 18:49 2006
Picon
Picon

[PHP-DEV] Re: TSRMLS_D/C persistence

> That also implies then that if I create a handler for eg: an
> external stream/file, and keep it as a singleton instance in the
> extension, then it could be reasonably called by any number
> of different threads.
>
There's a plan B though.

void foo(int bar) { }

foo() doesn't have room for trms_ls in its prototype so it just won't be 
available inside the function right?  Wrong.  Zend exports TSRMLS_FETCH(); 
which can recover (through a slightly expensive process) the thread 
appropriate value for tsrm_ls.  Thus:

void foo(int bar TSRMLS_DC)
{
    somefoo(bar TSRMLS_CC);
}

and

void foo(int bar)
{
    TSRMLS_FETCH();

    somefoo(bar TSRMLS_CC);
}

Are functionally identical.

(Continue reading)

Byron Adams | 2 Jul 06:14 2006
Picon

[PHP-DEV] CVS Account Request: badams

Contribute 

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Pierre | 2 Jul 15:07 2006
Picon

Re: [PHP-DEV] CVS Account Request: badams

Hi,

On 7/2/06, Byron Adams <byron.adams54 <at> gmail.com> wrote:
> Contribute

Byron seems to have clicked submit too early. He needs an account to
contribute to PEAR Validate, New Zealand Locale.

I will take care of the karma thing,

Thanks,
--Pierre

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

GEORGE PETERS | 2 Jul 20:03 2006
Picon

[PHP-DEV] CVS Account Request: georgepeters

For my sending of mails

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane