public function setTitle($title)
    {
        if (getmypid() != $this->getPid()) {
            throw new ResqueRuntimeException(
                sprintf(
                    'Can not set title when process pid has changed. Expected "%s", got "%s"',
                    $this->getPid(),
                    getmypid()
                )
            );
        }

        // @todo, it is the workers domain to set this, move this logic back to the worker.
        $processTitle = 'resque-' . Resque::VERSION . ': ' . $title;

        if (function_exists('cli_set_process_title')) {
            // @todo remove @, it is throwing errors on my mac.
            @cli_set_process_title($processTitle);

            return;
        }

        if (function_exists('setproctitle')) {
            setproctitle($processTitle);
        }
    }
public function setTitle($title)
    {
        if (getmypid() != $this->getPid()) {
            throw new ResqueRuntimeException(
                sprintf(
                    'Can not set title when process pid has changed. Expected "%s", got "%s"',
                    $this->getPid(),
                    getmypid()
                )
            );
        }

        // @todo, it is the workers domain to set this, move this logic back to the worker.
        $processTitle = 'resque-' . Resque::VERSION . ': ' . $title;

        if (function_exists('cli_set_process_title')) {
            // @todo remove @, it is throwing errors on my mac.
            @cli_set_process_title($processTitle);

            return;
        }

        if (function_exists('setproctitle')) {
            setproctitle($processTitle);
        }
    }
public function setTitle ( $ title ) { if ( getmypid ( ) != $ this -> getPid ( ) ) { throw new ResqueRuntimeException ( sprintf ( 'Can not set title when process pid has changed. Expected "%s", got "%s"' , $ this -> getPid ( ) , getmypid ( ) ) ) ; } // @todo, it is the workers domain to set this, move this logic back to the worker. $ processTitle = 'resque-' . Resque :: VERSION . ': ' . $ title ; if ( function_exists ( 'cli_set_process_title' ) ) { // @todo remove @, it is throwing errors on my mac. @ cli_set_process_title ( $ processTitle ) ; return ; } if ( function_exists ( 'setproctitle' ) ) { setproctitle ( $ processTitle ) ; } }
Set process title

If possible, sets the title of the currently running process.

It is used to indicate the current state of the worker.

Only supported systems with the PECL proctitle module installed, or CLI SAPI > 5.5.

@see http://pecl.php.net/package/proctitle
@see http://php.net/manual/en/function.cli-set-process-title.php

@param string $title The new process title.
Set process title