本文整理匯總了PHP中pts_client::is_process_running方法的典型用法代碼示例。如果您正苦於以下問題:PHP pts_client::is_process_running方法的具體用法?PHP pts_client::is_process_running怎麽用?PHP pts_client::is_process_running使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pts_client
的用法示例。
在下文中一共展示了pts_client::is_process_running方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sw_display_server
public static function sw_display_server()
{
$display_servers = array();
if (phodevi::is_windows()) {
// TODO: determine what to do for Windows support
} else {
if (pts_client::is_process_running('weston')) {
$info = 'Wayland Weston';
$vinfo = trim(shell_exec('weston --version 2>&1'));
if (pts_strings::last_in_string($vinfo) && pts_strings::is_version(pts_strings::last_in_string($vinfo))) {
$info .= ' ' . pts_strings::last_in_string($vinfo);
}
array_push($display_servers, $info);
}
if (pts_client::is_process_running('unity-system-compositor')) {
$unity_system_comp = trim(str_replace('unity-system-compositor', null, shell_exec('unity-system-compositor --version 2>&1')));
if (pts_strings::is_version($unity_system_comp)) {
array_push($display_servers, 'Unity-System-Compositor ' . $unity_system_comp);
}
}
if (($x_bin = is_executable('/usr/libexec/Xorg.bin') ? '/usr/libexec/Xorg.bin' : false) || ($x_bin = pts_client::executable_in_path('Xorg')) || ($x_bin = pts_client::executable_in_path('X'))) {
// Find graphics subsystem version
$info = shell_exec($x_bin . ' ' . (phodevi::is_solaris() ? ':0' : '') . ' -version 2>&1');
$pos = ($p = strrpos($info, 'Release Date')) !== false ? $p : strrpos($info, 'Build Date');
$info = trim(substr($info, 0, $pos));
if ($pos === false || getenv('DISPLAY') == false) {
$info = null;
} else {
if (($pos = strrpos($info, '(')) === false) {
$info = trim(substr($info, strrpos($info, ' ')));
} else {
$info = trim(substr($info, strrpos($info, 'Server') + 6));
}
}
if ($info != null) {
array_push($display_servers, 'X Server ' . $info);
}
}
if (pts_client::is_process_running('surfaceflinger')) {
array_push($display_servers, 'SurfaceFlinger');
}
if (pts_client::is_process_running('gnome-shell-wayland')) {
array_push($display_servers, 'GNOME Shell Wayland');
}
}
return implode(' + ', $display_servers);
}
示例2: process_running_string
public static function process_running_string($process_arr)
{
// Format a nice string that shows processes running
$p = array();
$p_string = null;
$process_arr = pts_arrays::to_array($process_arr);
foreach ($process_arr as $p_name => $p_processes) {
foreach ($p_processes as $process) {
if (pts_client::is_process_running($process)) {
$p[] = $p_name;
}
}
}
$p = array_keys(array_flip($p));
if (($p_count = count($p)) > 0) {
for ($i = 0; $i < $p_count; $i++) {
$p_string .= $p[$i];
if ($i != $p_count - 1 && $p_count > 2) {
$p_string .= ',';
}
$p_string .= ' ';
if ($i == $p_count - 2) {
$p_string .= 'and ';
}
}
$p_string .= $p_count == 1 ? 'was' : 'were';
$p_string .= ' running on this system';
}
return $p_string;
}