Example #1
0
 /**
  * Get informations about the shared worker.
  *
  * @return  array
  */
 public function getInformations()
 {
     $this->_client->connect();
     $this->_client->writeAll(Backend\Shared::pack(Backend\Shared::TYPE_INFORMATIONS, ""));
     $this->_client->read(2);
     // skip type.
     $length = unpack('Nl', $this->_client->read(4));
     $message = $this->_client->read($length['l']);
     $this->_client->read(1);
     // skip eom.
     $this->_client->disconnect();
     return unserialize($message);
 }
Example #2
0
 /**
  * Stop the shared worker.
  *
  * @return  bool
  */
 public function stop()
 {
     $client = new Socket\Client($this->_socket);
     $client->connect();
     $client->writeAll(static::pack(static::TYPE_STOP, $this->_password));
     $client->disconnect();
     return true;
 }