Service/GearmanExecute.php
private function addServers(\GearmanWorker $gmworker, array $servers)
    {
        $successes = array();

        if (!empty($servers)) {

            foreach ($servers as $server) {
                if (@$gmworker->addServer($server['host'], $server['port'])) {
                    $successes[] = $server;
                }
            }
        } else {
            if (@$gmworker->addServer()) {
                $successes[] = array('127.0.0.1', 4730);
            }
        }

        return $successes;
    }
private function addServers(\GearmanWorker $gmworker, array $servers)
    {
        $successes = array();

        if (!empty($servers)) {

            foreach ($servers as $server) {
                if (@$gmworker->addServer($server['host'], $server['port'])) {
                    $successes[] = $server;
                }
            }
        } else {
            if (@$gmworker->addServer()) {
                $successes[] = array('127.0.0.1', 4730);
            }
        }

        return $successes;
    }
private function addServers ( \ GearmanWorker $ gmworker , array $ servers ) { $ successes = array ( ) ; if ( ! empty ( $ servers ) ) { foreach ( $ servers as $ server ) { if ( @ $ gmworker -> addServer ( $ server [ 'host' ] , $ server [ 'port' ] ) ) { $ successes [ ] = $ server ; } } } else { if ( @ $ gmworker -> addServer ( ) ) { $ successes [ ] = array ( '127.0.0.1' , 4730 ) ; } } return $ successes ; }
Adds into worker all defined Servers.
If any is defined, performs default method

@param \GearmanWorker $gmworker Worker to perform configuration
@param array          $servers  Servers array

@throws ServerConnectionException if a connection to a server was not possible.

@return array         Successfully added servers
Adds into worker all defined Servers . If any is defined performs default method