Credis_Cluster::all PHP Method

all() public method

Execute a command on all clients
public all ( ) : array
return array
    public function all()
    {
        $args = func_get_args();
        $name = array_shift($args);
        $results = array();
        foreach ($this->clients as $client) {
            $results[] = call_user_func_array([$client, $name], $args);
        }
        return $results;
    }

Usage Example

Ejemplo n.º 1
0
 public function testKeyHashing()
 {
     $this->tearDown();
     $this->cluster = new Credis_Cluster(array_slice($this->config, 0, 3), 2, $this->useStandalone);
     $keys = array();
     $lines = explode("\n", file_get_contents("keys.test"));
     foreach ($lines as $line) {
         $pair = explode(':', trim($line));
         if (count($pair) >= 2) {
             $keys[$pair[0]] = $pair[1];
         }
     }
     foreach ($keys as $key => $value) {
         $this->assertTrue($this->cluster->set($key, $value));
     }
     $this->cluster = new Credis_Cluster(array_slice($this->config, 0, 4), 2, true, $this->useStandalone);
     $hits = 0;
     foreach ($keys as $key => $value) {
         if ($this->cluster->all('get', $key)) {
             $hits++;
         }
     }
     $this->assertEquals(count($keys), $hits);
 }
All Usage Examples Of Credis_Cluster::all