hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Missing function cli_set_process_title

Open karpa13a opened this issue 10 years ago • 9 comments

example from http://php.net/manual/en/function.cli-set-process-title.php

<?php
$title = "My Amazing PHP Script";
$pid = getmypid(); // you can use this to see your process title in ps

if (!cli_set_process_title($title)) {
    echo "Unable to set process title for PID $pid...\n";
    exit(1);
} else {
    echo "The process title '$title' for PID $pid has been set for your process!\n";
    sleep(10);
}
?>

produces:

karp@karp:/tmp$ php 1.php
Fatal error: Call to undefined function cli_set_process_title() in /tmp/1.php on line 5
karp@karp:/tmp$ php -v
HipHop VM 3.5.0-dev~nightly.2014.12.11 (rel)
Compiler: heads/master-0-g2b3474c463cdd0f00d790f5f78626317ae4e49e5
Repo schema: 3b1511f5d6a4d8bb9ef91b84f40041b34430a09c
Extension API: 20140829

karpa13a avatar Dec 18 '14 11:12 karpa13a

Behaviour diff is probably not the best description. It simply isn't implemented.

SiebelsTim avatar Dec 18 '14 15:12 SiebelsTim

+1 for this feature

zhil avatar Jul 14 '15 17:07 zhil

For whoever decides to implement this, PHP appears to implement it based on a bit extracted from PostgreSQL here.

Orvid avatar Jul 14 '15 22:07 Orvid

Bump

steelbrain avatar Jul 24 '15 05:07 steelbrain

It would be really nice to have this feature, because when hhvm crashes and we restart HHVM, it kills all the pidof hhvm processes. Which also include the CLI daemons. If this is implemented, we will be able to rename those processes and save them from being killed.

steelbrain avatar Nov 11 '15 08:11 steelbrain

+1 . We have 5 hhvm instances (services); We want to see how is going each instance. Like. "hhvm-service-user-on-16654"

Vahanerevan avatar Apr 17 '16 23:04 Vahanerevan

Looks like PHP has several implementations of this but it shouldn't be a hard function to add to hhvm.

https://github.com/php/php-src/blob/ddfbe07e2836be11020b5a2d044fa1a560787f3a/sapi/cli/ps_title.c#L334

paulbiss avatar Sep 28 '16 22:09 paulbiss

Bump

XtreamCodes avatar Aug 21 '18 15:08 XtreamCodes

this should only run using cli "terminal" as the function name imply so you can't test if from browser php file_name.php and execute the content of files

torbedosquadron avatar Jul 24 '21 15:07 torbedosquadron