lib/base/BaseDeploy.class.php
protected function restartGearmanWorkers($remote_host, $remote_dir, $target_dir)
	{
		$this->log("restartGearmanWorkers($remote_host, $remote_dir, $target_dir)", LOG_DEBUG);

		if (!isset($this->gearman['workers']) || empty($this->gearman['workers']))
            return;

        $cmd = "cd $remote_dir/{$target_dir}; ";

        foreach ($this->gearman['servers'] as $server) {
            foreach ($this->gearman['workers'] as $worker) {
                $worker = sprintf($worker, $this->target);

                $cmd .= "php {$this->gearman_restarter} --ip={$server['ip']} --port={$server['port']} --function=$worker; ";
            }
        }

        $output = array();
        $return = null;

        $this->sshExec($remote_host, $cmd, $output, $return);
	}
protected function restartGearmanWorkers($remote_host, $remote_dir, $target_dir)
	{
		$this->log("restartGearmanWorkers($remote_host, $remote_dir, $target_dir)", LOG_DEBUG);

		if (!isset($this->gearman['workers']) || empty($this->gearman['workers']))
            return;

        $cmd = "cd $remote_dir/{$target_dir}; ";

        foreach ($this->gearman['servers'] as $server) {
            foreach ($this->gearman['workers'] as $worker) {
                $worker = sprintf($worker, $this->target);

                $cmd .= "php {$this->gearman_restarter} --ip={$server['ip']} --port={$server['port']} --function=$worker; ";
            }
        }

        $output = array();
        $return = null;

        $this->sshExec($remote_host, $cmd, $output, $return);
	}
protected function restartGearmanWorkers ( $ remote_host , $ remote_dir , $ target_dir ) { $ this -> log ( "restartGearmanWorkers($remote_host, $remote_dir, $target_dir)" , LOG_DEBUG ) ; if ( ! isset ( $ this -> gearman [ 'workers' ] ) || empty ( $ this -> gearman [ 'workers' ] ) ) return ; $ cmd = "cd $remote_dir/{$target_dir}; " ; foreach ( $ this -> gearman [ 'servers' ] as $ server ) { foreach ( $ this -> gearman [ 'workers' ] as $ worker ) { $ worker = sprintf ( $ worker , $ this -> target ) ; $ cmd .= "php {$this->gearman_restarter} --ip={$server['ip']} --port={$server['port']} --function=$worker; " ; } } $ output = array ( ) ; $ return = null ; $ this -> sshExec ( $ remote_host , $ cmd , $ output , $ return ) ; }
Gearman workers herstarten

@param string $remote_host
@param string $remote_dir
@param string $target_dir
Gearman workers herstarten