Example #1
0
 /**
  * Use exec to ping a host.
  *
  * Ping command is specific to Windows host.
  *
  * @param	string	$host	Host name or IP address to ping
  * @return	bool			True if ping succeeds, false if not
  */
 protected static function execSend($host)
 {
     $command = escapeshellcmd('ping -n 1 -w 1 ' . $host);
     exec($command, $result, $returnCode);
     return arr::search($result, 'received = 1') ? true : false;
 }