当前位置: 首页>>代码示例>>PHP>>正文


PHP cli_set_process_title函数代码示例

本文整理汇总了PHP中cli_set_process_title函数的典型用法代码示例。如果您正苦于以下问题:PHP cli_set_process_title函数的具体用法?PHP cli_set_process_title怎么用?PHP cli_set_process_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cli_set_process_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public static function init()
 {
     pts_core::init();
     if (defined('QUICK_START') && QUICK_START) {
         return true;
     }
     if (function_exists('cli_set_process_title') && PHP_OS == 'Linux') {
         cli_set_process_title('Phoronix Test Suite');
     }
     pts_define('PHP_BIN', pts_client::read_env('PHP_BIN'));
     $dir_init = array(PTS_USER_PATH);
     foreach ($dir_init as $dir) {
         pts_file_io::mkdir($dir);
     }
     if (PTS_IS_CLIENT) {
         pts_network::client_startup();
     }
     self::core_storage_init_process();
     if (!is_file(PTS_TEMP_STORAGE)) {
         self::build_temp_cache();
     }
     pts_define('PTS_TEST_INSTALL_DEFAULT_PATH', pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/EnvironmentDirectory', '~/.phoronix-test-suite/installed-tests/')));
     pts_define('PTS_SAVE_RESULTS_PATH', pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Testing/ResultsDirectory', '~/.phoronix-test-suite/test-results/')));
     self::extended_init_process();
     $openbenchmarking = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking');
     $openbenchmarking_account_settings = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking_account_settings');
     if ($openbenchmarking != null) {
         // OpenBenchmarking.org Account
         pts_openbenchmarking_client::init_account($openbenchmarking, $openbenchmarking_account_settings);
     }
     return true;
 }
开发者ID:Grdflo,项目名称:phoronix-test-suite,代码行数:32,代码来源:pts_client.php

示例2: setProcessName

 public function setProcessName($name)
 {
     if (function_exists('cli_set_process_title')) {
         cli_set_process_title($name);
     }
     return $this;
 }
开发者ID:firehed,项目名称:processmanager,代码行数:7,代码来源:Daemon.php

示例3: setTitle

 public function setTitle($title)
 {
     $this->title = trim($title);
     if (function_exists('cli_set_process_title')) {
         cli_set_process_title($this->title);
     }
 }
开发者ID:koolkode,项目名称:console,代码行数:7,代码来源:Application.php

示例4: setProcessProperties

 /**
  * @param EnvironmentInterface $env
  */
 private function setProcessProperties(EnvironmentInterface $env)
 {
     $props = $env->getEnv('cli');
     if ($props['title'] !== 'php' && function_exists('cli_set_process_title')) {
         cli_set_process_title($props['title']);
     }
 }
开发者ID:khelle,项目名称:surume,代码行数:10,代码来源:EnvironmentProvider.php

示例5: my_set_process_name

 private function my_set_process_name($title)
 {
     if (substr(PHP_VERSION, 0, 3) >= '5.5') {
         cli_set_process_title($title);
     } else {
         swoole_set_process_name($title);
     }
 }
开发者ID:xtjsxtj,项目名称:esp,代码行数:8,代码来源:swoole.php

示例6: init

 protected function init()
 {
     $this->pid = posix_getpid();
     $this->ppid = posix_getppid();
     cli_set_process_title(sprintf('%s(%s)', $this->getName(), $this->getWorker()));
     static::$currentProcess = $this;
     return $this;
 }
开发者ID:heesey,项目名称:epserver,代码行数:8,代码来源:Child.php

示例7: updateProcTitleIfPossible

 private function updateProcTitleIfPossible($workerId, $queues)
 {
     if (!function_exists('cli_set_process_title')) {
         return;
     }
     global $argv;
     cli_set_process_title(sprintf("%s: %s watching %s", join(' ', $argv), $workerId, join(', ', $queues)));
 }
开发者ID:metro-q,项目名称:metro,代码行数:8,代码来源:WorkCommand.php

示例8: changeProcessTitleTo

 private static function changeProcessTitleTo($processTitle)
 {
     if (function_exists('cli_set_process_title')) {
         cli_set_process_title($processTitle);
     } elseif (function_exists('setproctitle')) {
         setproctitle($processTitle);
     }
 }
开发者ID:webmozart,项目名称:console,代码行数:8,代码来源:ProcessTitle.php

示例9: updateProcTitleIfPossible

 private function updateProcTitleIfPossible($jobId)
 {
     if (!function_exists('cli_set_process_title')) {
         return;
     }
     global $argv;
     cli_set_process_title(sprintf("%s: processing %s", join(' ', $argv), $jobId));
 }
开发者ID:metro-q,项目名称:metro,代码行数:8,代码来源:ForkingExecutor.php

示例10: setProcessName

 /**
  * 设置进程名称
  *
  * @param $title
  */
 protected static function setProcessName($title)
 {
     $title = "php_daemon_{$title}";
     if (function_exists('cli_set_process_title')) {
         cli_set_process_title($title);
     } elseif (extension_loaded('proctitle') && function_exists('setproctitle')) {
         setproctitle($title);
     }
 }
开发者ID:phpdn,项目名称:framework,代码行数:14,代码来源:ProcessManage.php

示例11: init

 public static function init()
 {
     set_time_limit(0);
     pts_define_directories();
     // Define directories
     if (function_exists('cli_set_process_title') && !phodevi::is_macosx()) {
         cli_set_process_title('Phoronix Test Suite');
     }
     if (defined('QUICK_START') && QUICK_START) {
         return true;
     }
     pts_define('PHP_BIN', pts_client::read_env('PHP_BIN'));
     pts_define('PTS_INIT_TIME', time());
     if (!defined('PHP_VERSION_ID')) {
         // PHP_VERSION_ID is only available in PHP 5.2.6 and later
         $php_version = explode('.', PHP_VERSION);
         pts_define('PHP_VERSION_ID', $php_version[0] * 10000 + $php_version[1] * 100 + $php_version[2]);
     }
     $dir_init = array(PTS_USER_PATH);
     foreach ($dir_init as $dir) {
         pts_file_io::mkdir($dir);
     }
     if (PTS_IS_CLIENT) {
         pts_network::client_startup();
     }
     self::core_storage_init_process();
     if (!is_file(PTS_TEMP_STORAGE)) {
         self::build_temp_cache();
     }
     //XXX
     pts_define('PTS_ETC_PATH', is_dir('/etc') ? '/etc/phoronix-test-suite/' : false);
     if (is_dir('/usr/local/share/phoronix-test-suite/')) {
         pts_define('PTS_SHARE_PATH', '/usr/local/share/phoronix-test-suite/');
     } else {
         if (is_dir('/usr/share/')) {
             pts_define('PTS_SHARE_PATH', '/usr/share/phoronix-test-suite/');
             if (is_writable('/usr/share') && !is_dir(PTS_SHARE_PATH)) {
                 mkdir(PTS_SHARE_PATH);
             }
         } else {
             pts_define('PTS_SHARE_PATH', false);
         }
     }
     // XXX: technically the config init_files line shouldn't be needed since it should be dynamically called
     // pts_config::init_files();
     pts_define('PTS_TEST_INSTALL_DEFAULT_PATH', pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/EnvironmentDirectory', '~/.phoronix-test-suite/installed-tests/')));
     pts_define('PTS_SAVE_RESULTS_PATH', pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Testing/ResultsDirectory', '~/.phoronix-test-suite/test-results/')));
     self::extended_init_process();
     $openbenchmarking = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking');
     $openbenchmarking_account_settings = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking_account_settings');
     if ($openbenchmarking != null) {
         // OpenBenchmarking.org Account
         pts_openbenchmarking_client::init_account($openbenchmarking, $openbenchmarking_account_settings);
     }
     return true;
 }
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:56,代码来源:pts_client.php

示例12: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $tube = $input->getArgument('tube');
     $resolvedTubeName = \Mosaicoon\QueueManager\QueueManager::resolveChannelName($tube);
     cli_set_process_title('JambonQueueListener-' . $resolvedTubeName);
     $worker = new Worker('127.0.0.1', new JobRunner(), new QMLogger($output));
     $this->printFiglet();
     $output->writeln("<info>In attesa di Job in coda sul canale {$resolvedTubeName}...</info>");
     $worker->execute($tube);
 }
开发者ID:bonaccorsop,项目名称:JambonOrders,代码行数:10,代码来源:QueueListenCommand.php

示例13: fork

 /**
  * Forks something into another process and returns a deferred object.
  * @param $callable
  * @param string $processTitle
  * @return Fork
  */
 public function fork($callable, $processTitle = null)
 {
     if (!is_callable($callable)) {
         throw new UnexpectedTypeException($callable, 'callable');
     }
     // allow the system to cleanup before forking
     $this->dispatcher->dispatch(Events::PRE_FORK);
     if (-1 === ($pid = pcntl_fork())) {
         throw new ProcessControlException('Unable to fork a new process');
     }
     if (0 === $pid) {
         if (function_exists('cli_set_process_title') && $processTitle !== null) {
             cli_set_process_title($processTitle);
         }
         // reset the list of child processes
         $this->forks = array();
         // setup the shared memory
         $shm = $this->factory->createSharedMemory(null, $this->signal);
         $message = new ExitMessage();
         // phone home on shutdown
         register_shutdown_function(function () use($shm, $message) {
             $status = null;
             try {
                 $shm->send($message, false);
             } catch (\Exception $e) {
                 // probably an error serializing the result
                 $message->setResult(null);
                 $message->setError(Error::fromException($e));
                 $shm->send($message, false);
                 exit(2);
             }
         });
         // dispatch an event so the system knows it's in a new process
         $this->dispatcher->dispatch(Events::POST_FORK);
         if (!$this->debug) {
             ob_start();
         }
         try {
             $result = call_user_func($callable, $shm);
             $message->setResult($result);
             $status = is_integer($result) ? $result : 0;
         } catch (\Exception $e) {
             $message->setError(Error::fromException($e));
             $status = 1;
         }
         if (!$this->debug) {
             $message->setOutput(ob_get_clean());
         }
         exit($status);
     }
     // connect to shared memory
     $shm = $this->factory->createSharedMemory($pid);
     return $this->forks[$pid] = $this->factory->createFork($pid, $shm, $this->debug);
 }
开发者ID:edwardstock,项目名称:spork,代码行数:60,代码来源:ProcessManager.php

示例14: runJob

 private static function runJob($job) : bool
 {
     if ($job !== null) {
         $class = new $job['class']();
         $function = $job['function'];
         \cli_set_process_title('php cron.php ' . $job['class'] . '->' . $function);
         $args = $job['args'];
         $class->{$function}($args);
     }
     return true;
 }
开发者ID:cvweiss,项目名称:projectbase,代码行数:11,代码来源:Job.php

示例15: onWorkerStart

 public function onWorkerStart($serv, $worker_id)
 {
     // 判定是否为Task进程
     if ($worker_id >= $serv->setting['worker_num']) {
         //echo "----onTaskStart worker_id: {$worker_id} \n";
         cli_set_process_title("php5  task_id {$worker_id}");
     } else {
         //echo "--onWorkerStart worker_id: {$worker_id} \n";
         cli_set_process_title("php5 worker {$worker_id}");
     }
 }
开发者ID:hytzxd,项目名称:swoole-doc,代码行数:11,代码来源:db_server.php


注:本文中的cli_set_process_title函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。