Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Ivan Enderlin @ Hoa

Hi Keyur,


On 07/02/13 06:40, Keyur Govande wrote:

Hello,

I've created a new RFC to improve support for setting a CLI process' title
on Linux. It is based off of the PostgreSQL implementation and is more
robust than the proctitle extension.

More details and patch here: https://wiki.php.net/rfc/cli_process_title

Very nice patch. It could be very useful for me.
Could you precise what extensions PHP needs to use these new functions, 
because in your test [1], you skip when pcntl or posix are not loaded. I 
am sure that there is no dependency between them and *ps_title*() 
functions, but it has to be precised in your RFC or you need to write a 
simpler test.


[1] https://gist.github.com/keyurdg/4728770#file-php_ps-patch-L737-L740

--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/


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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Christoph Rosse

Am 2013-02-07 08:45, schrieb Alexey Zakhlestin:


On 07.02.2013, at 9:40, Keyur Govande keyurgova...@gmail.com wrote:


Hello,

I've created a new RFC to improve support for setting a CLI process' title
on Linux. It is based off of the PostgreSQL implementation and is more
robust than the proctitle extension.

More details and patch here: https://wiki.php.net/rfc/cli_process_title


This would be useful for some of my tasks!
I don't like names of functions, but I like functionality and API approach

how about:

bool   cli_title_settable(void);
bool   cli_title_set(string);
string cli_title_get();




Greate feature and +1 to Alexeys function names.

But what is the point in checking if I'm able to set a title with 
is_cli_ps_title_available() if set_cli_ps_title() can fail and return 
false anyway?


I'm just asking because I don't see the benefit of the function 
is_cli_ps_title_available for the user.




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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Michael Wallner
On 7 February 2013 09:37, Christoph Rosse cro...@2bepublished.at wrote:
 Am 2013-02-07 08:45, schrieb Alexey Zakhlestin:


 On 07.02.2013, at 9:40, Keyur Govande keyurgova...@gmail.com wrote:

 Hello,

 I've created a new RFC to improve support for setting a CLI process'
 title
 on Linux. It is based off of the PostgreSQL implementation and is more
 robust than the proctitle extension.

 More details and patch here: https://wiki.php.net/rfc/cli_process_title


 This would be useful for some of my tasks!
 I don't like names of functions, but I like functionality and API approach

 how about:

 bool   cli_title_settable(void);

This function name is ambiguous, does it mean set table or is settable, I guess
it means the latter, so it should also be named like that.

 bool   cli_title_set(string);
 string cli_title_get();



 Greate feature and +1 to Alexeys function names.

 But what is the point in checking if I'm able to set a title with
 is_cli_ps_title_available() if set_cli_ps_title() can fail and return false
 anyway?

 I'm just asking because I don't see the benefit of the function
 is_cli_ps_title_available for the user.




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




-- 
Regards,
Mike

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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Leigh
There is a PECL extension that already does something similar. You may want
to take a look at that.

http://pecl.php.net/package/proctitle


On 7 February 2013 05:40, Keyur Govande keyurgova...@gmail.com wrote:

 Hello,

 I've created a new RFC to improve support for setting a CLI process' title
 on Linux. It is based off of the PostgreSQL implementation and is more
 robust than the proctitle extension.

 More details and patch here: https://wiki.php.net/rfc/cli_process_title

 Thanks,
 Keyur.



Re: [PHP-DEV] operator-0.3 extension update

2013-02-07 Thread Harald Lapp

Am 06.02.13 14:14, schrieb Gabriel Wu:

On Wed, Feb 6, 2013 at 7:28 PM, Ferenc Kovacs tyr...@gmail.com wrote:


I think mentioning Sara as a sponsor would weight in more than myself. ;)




Oh, you aren't the one approving the application?

Anyway I was wondering how to go about submitting the update - are
there any howto's on creating the pear package that I should upload on
http://pecl.php.net/release-upload.php?


hi,

great, that someone is updating this extension. will you also offer an 
updated version for php-5.5 later (if it does not already work)? i just 
wanted to give it a try, but there seems to be a problem with the 
uploaded package: it seems to only contain the package.xml?


greetings,
harald

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



Re: [PHP-DEV] operator-0.3 extension update

2013-02-07 Thread Michael Wallner
 great, that someone is updating this extension. will you also offer an
 updated version for php-5.5 later (if it does not already work)? i just
 wanted to give it a try, but there seems to be a problem with the uploaded
 package: it seems to only contain the package.xml?

% tar -i


-- 
Regards,
Mike

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



Re: [PHP-DEV] operator-0.3 extension update

2013-02-07 Thread Harald Lapp

Am 07.02.13 11:40, schrieb Michael Wallner:

great, that someone is updating this extension. will you also offer an
updated version for php-5.5 later (if it does not already work)? i just
wanted to give it a try, but there seems to be a problem with the uploaded
package: it seems to only contain the package.xml?


% tar -i



i feel really stupid, but i am unable to extract this archive on my 
system (mac). neither with bsdtar nor with gnutar. i've not had such 
issue with any other archive ever downloaded from php.net before.




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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Alexey Zakhlestin

On 07.02.2013, at 13:54, Leigh lei...@gmail.com wrote:

 There is a PECL extension that already does something similar. You may want
 to take a look at that.
 
 http://pecl.php.net/package/proctitle

Did you read RFC?
Keyur mentions it and its limitations there


-- 
Alexey Zakhlestin
https://github.com/indeyets






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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Leigh
On 7 February 2013 12:22, Alexey Zakhlestin indey...@gmail.com wrote:


 On 07.02.2013, at 13:54, Leigh lei...@gmail.com wrote:

  There is a PECL extension that already does something similar. You may
 want
  to take a look at that.
 
  http://pecl.php.net/package/proctitle

 Did you read RFC?
 Keyur mentions it and its limitations there


I only skimmed it very quickly if I'm honest.

Why does this need to be in core? This could just be done as a set of
improvements to the existing PECL extension instead. I'd guess that the
number of people who require (and would use) this functionality is very
very small indeed.


Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Michael Wallner
On 7 February 2013 13:33, Leigh lei...@gmail.com wrote:
 On 7 February 2013 12:22, Alexey Zakhlestin indey...@gmail.com wrote:


 On 07.02.2013, at 13:54, Leigh lei...@gmail.com wrote:

  There is a PECL extension that already does something similar. You may
 want
  to take a look at that.
 
  http://pecl.php.net/package/proctitle

 Did you read RFC?
 Keyur mentions it and its limitations there


 I only skimmed it very quickly if I'm honest.

 Why does this need to be in core? This could just be done as a set of
 improvements to the existing PECL extension instead. I'd guess that the
 number of people who require (and would use) this functionality is very
 very small indeed.

Then read it again, not so quick.

-- 
Regards,
Mike

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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Alexey Zakhlestin

On 07.02.2013, at 16:33, Leigh lei...@gmail.com wrote:

 Why does this need to be in core? This could just be done as a set of 
 improvements to the existing PECL extension instead. I'd guess that the 
 number of people who require (and would use) this functionality is very very 
 small indeed.

well, 2 reasons:

1. it needs to be injected into main() of php_cli.c
2. it can become a good start for official CLI extension. CLI SAPI has 
functionality, which is specific to it and exposing it to userland could be 
useful


-- 
Alexey Zakhlestin
https://github.com/indeyets






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



Re: [PHP-DEV] operator-0.3 extension update

2013-02-07 Thread Gabriel Wu
On Thu, Feb 7, 2013 at 7:03 PM, Harald Lapp harald.l...@gmail.com wrote:
 Am 07.02.13 11:40, schrieb Michael Wallner:

 great, that someone is updating this extension. will you also offer an
 updated version for php-5.5 later (if it does not already work)? i just
 wanted to give it a try, but there seems to be a problem with the
 uploaded
 package: it seems to only contain the package.xml?


 % tar -i


 i feel really stupid, but i am unable to extract this archive on my system
 (mac). neither with bsdtar nor with gnutar. i've not had such issue with any
 other archive ever downloaded from php.net before.




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


Hi Micheal,

I have uploaded a new tarball which hopefully contains the src files.
I had problems previously with a bug on the pecl package system, which
I thought I sorted out, but apparently not. I will test it on php-5.5
on my own sometime, but please let me know of the outcome of your
tests!

Best regards,
Gabriel

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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Christoph Rosse

Am 2013-02-07 13:33, schrieb Leigh:

On 7 February 2013 12:22, Alexey Zakhlestin indey...@gmail.com wrote:



On 07.02.2013, at 13:54, Leigh lei...@gmail.com wrote:


There is a PECL extension that already does something similar. You may

want

to take a look at that.

http://pecl.php.net/package/proctitle


Did you read RFC?
Keyur mentions it and its limitations there



I only skimmed it very quickly if I'm honest.

Why does this need to be in core? This could just be done as a set of
improvements to the existing PECL extension instead. I'd guess that the
number of people who require (and would use) this functionality is very
very small indeed.

why wouldn't this go into core? setting the name of the current 
php-process is definitely something everyone that develops php-cli 
scripts could use.


We should not base the decision of putting something into the core on 
assumptions on how many people are going to use the feature.


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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Christoph Rosse

Am 2013-02-07 14:00, schrieb Alexey Zakhlestin:


On 07.02.2013, at 16:33, Leigh lei...@gmail.com wrote:


Why does this need to be in core? This could just be done as a set of 
improvements to the existing PECL extension instead. I'd guess that the number 
of people who require (and would use) this functionality is very very small 
indeed.


well, 2 reasons:

1. it needs to be injected into main() of php_cli.c
2. it can become a good start for official CLI extension. CLI SAPI has 
functionality, which is specific to it and exposing it to userland could be useful




1. I'm not an expert on the php source code, so I can't say if this is a 
problem or not, if it really is could you explain to me why?


2. Creating an official CLI extension sounds really awesome to me but 
unless there is somebody willing to develop/maintain it I would rather 
want to have this function going into core instead of patching an old 
pecl-extension.


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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Arvids Godjuks
Hello internals.

I'm actually using proctitle extension and it's very handy because we run
like 10+ daemons written in PHP that we manage. Without it we would be lost
:) But the actual awareness of the proctitle PECL extension is very low.
Also it does not work on windows.
I'm all over the idea to add it to the core and that will be better than
current proctitle extension. Also I don't see a major effort required to
keep this thing up to date. OS'es don't just change how process titles are
set overnight, I would imagine that being huge thing to do without a very
early notice.

The RFC is superior to proctitle in every way, so i'd say go for it.
Although small on the outside, it's actually a huge thing and will allow to
actually start building some serious stuff without using some half-baked
non-maintained extensions.

My 0.02$.

Arvids.


Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Christoph Rosse

Am 2013-02-07 14:57, schrieb Christoph Rosse:

Am 2013-02-07 14:00, schrieb Alexey Zakhlestin:


On 07.02.2013, at 16:33, Leigh lei...@gmail.com wrote:


Why does this need to be in core? This could just be done as a set of
improvements to the existing PECL extension instead. I'd guess that
the number of people who require (and would use) this functionality
is very very small indeed.


well, 2 reasons:

1. it needs to be injected into main() of php_cli.c
2. it can become a good start for official CLI extension. CLI SAPI
has functionality, which is specific to it and exposing it to userland
could be useful




1. I'm not an expert on the php source code, so I can't say if this is a
problem or not, if it really is could you explain to me why?

2. Creating an official CLI extension sounds really awesome to me but
unless there is somebody willing to develop/maintain it I would rather
want to have this function going into core instead of patching an old
pecl-extension.


Forget my email above got a bit mixed up with the thread.


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



Re: [PHP-DEV] PHP 5.4.11 tests: floating point diff

2013-02-07 Thread Levi Morrison
I have a confirmed bug with Intel Engineering. For clarification
purposes here, it only happens on 64-bit bit versions of icc and
possibly only on Linux. If you link against the math library using
`-lm` then this goes away at the cost of performance (though a
negligible cost I would guess).

Thanks for all the responses!

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



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Nikita Popov
On Thu, Feb 7, 2013 at 2:39 PM, Christoph Rosse cro...@2bepublished.atwrote:

 why wouldn't this go into core? setting the name of the current
 php-process is definitely something everyone that develops php-cli scripts
 could use.

I use a lot of php-cli scripts and I've never seen the need. Without having
hard data to back this up, I am pretty sure that this applies to nearly all
php-cli scripts.


 We should not base the decision of putting something into the core on
 assumptions on how many people are going to use the feature.

Obviously we should. Whether people will use it is pretty much the most
important aspect for deciding whether or not something should be added.
Even a trivial addition is a loose for the project if nobody is going to
use it. And this is no trivial addition. This seems to be quite a bit
system dependent and uses some odd methods like overwriting argv memory.
And on that note, it also has to copy the argv data if I got that right,
which is something it has to do always and not just when people are
actually using the feature ;)

I'm not saying I'm against this feature. I'd just really appreciate it if
we could drop the good old it doesn't matter if people are going to use
it non-arguments and instead provide a bit more info for people like me,
who are not in the process-title-hacking business. I.e. what this is needed
for an why this is needed in core. E.g. what Arvid mentioned, that this is
useful when you are running many PHP-based daemons and want to distinguish
them. That's the kind of stuff I'd like to see in the RFC.

Regarding core/non-core. People mentioned that this is not implementable as
an extension. That can be either solved by putting it into core or by
adding the necessary API hook ;) [I'm not arguing which variant is better,
just saying that not being implementable with current core does not mean
that we can't make it implementable :)]

Thanks,
Nikita


Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Keyur Govande
Addressing a bunch of comments at once:
1) I've removed is_available and renamed the set/get methods to:
cli_process_title_set/get. I've also removed the test dependencies on pcntl
and posix. The patch is updated: https://gist.github.com/keyurdg/4728770
2) Updated the RFC's introduction section with more concrete details about
why this is necessary

In terms of doing this as an extension: the RFC addresses why this isn't
possible.

For folks who will not be using this feature, at worst they'll loose a few
KB of memory: the amount needed to store the original argv and the original
environ.

On Thu, Feb 7, 2013 at 1:25 PM, Nikita Popov nikita@gmail.com wrote:

 On Thu, Feb 7, 2013 at 2:39 PM, Christoph Rosse cro...@2bepublished.at
 wrote:

  why wouldn't this go into core? setting the name of the current
  php-process is definitely something everyone that develops php-cli
 scripts
  could use.
 
 I use a lot of php-cli scripts and I've never seen the need. Without having
 hard data to back this up, I am pretty sure that this applies to nearly all
 php-cli scripts.


  We should not base the decision of putting something into the core on
  assumptions on how many people are going to use the feature.
 
 Obviously we should. Whether people will use it is pretty much the most
 important aspect for deciding whether or not something should be added.
 Even a trivial addition is a loose for the project if nobody is going to
 use it. And this is no trivial addition. This seems to be quite a bit
 system dependent and uses some odd methods like overwriting argv memory.
 And on that note, it also has to copy the argv data if I got that right,
 which is something it has to do always and not just when people are
 actually using the feature ;)

 I'm not saying I'm against this feature. I'd just really appreciate it if
 we could drop the good old it doesn't matter if people are going to use
 it non-arguments and instead provide a bit more info for people like me,
 who are not in the process-title-hacking business. I.e. what this is needed
 for an why this is needed in core. E.g. what Arvid mentioned, that this is
 useful when you are running many PHP-based daemons and want to distinguish
 them. That's the kind of stuff I'd like to see in the RFC.

 Regarding core/non-core. People mentioned that this is not implementable as
 an extension. That can be either solved by putting it into core or by
 adding the necessary API hook ;) [I'm not arguing which variant is better,
 just saying that not being implementable with current core does not mean
 that we can't make it implementable :)]

 Thanks,
 Nikita



Re: [PHP-DEV] [RFC] Improved Linux process title support in the CLI SAPI

2013-02-07 Thread Rasmus Lerdorf
On 02/07/2013 10:25 AM, Nikita Popov wrote:
 On Thu, Feb 7, 2013 at 2:39 PM, Christoph Rosse cro...@2bepublished.atwrote:
 
 why wouldn't this go into core? setting the name of the current
 php-process is definitely something everyone that develops php-cli scripts
 could use.

 I use a lot of php-cli scripts and I've never seen the need. Without having
 hard data to back this up, I am pretty sure that this applies to nearly all
 php-cli scripts.

I think you may have glossed over the part where Keyur explained that
when running tons of Gearman workers under GearmanManager it makes
things a lot easier if we had a working way to set the proctitle. As he
explained, the pecl/proctitle way of doing it isn't sufficient because
it is likely to corrupt memory if you try to set the process title to
anything longer than 3 characters. The only way to fix that memory
corruption is to hook in earlier and that isn't something we can do from
an extension.

Note that other SAPIs have the same need. The FPM SAPI does something
similar and for similar reasons. Whenever you are running any sort of
process manager, it is super useful to be able to tell what each
individual process is doing at a particular time.

-Rasmus

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