Beispiel #1
0
 public function getSlaves()
 {
     $this->write(PACKET_LIST);
     $raw = socket_read($this->sock, 1024 * 10, PHP_NORMAL_READ) or die("Could not read from socket\n");
     $slaveStrings = explode(";", $raw);
     $slaves = array();
     foreach ($slaveStrings as $string) {
         if (strlen($string) <= 1) {
             continue;
         }
         $s = new Slave();
         $s->makearray($string);
         array_push($slaves, $s);
     }
     return $slaves;
 }
Beispiel #2
0
 public static function none()
 {
     $slave = new Slave();
     $s = "Nothing found";
     $slave->makearray($s . ":" . $s . ":" . $s . ":" . $s . ":" . $s . ":" . $s . ":" . $s);
     return $slave;
 }