本文整理汇总了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;
}