servers.php 766 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. function getServers() {
  3. return array(
  4. "irc.knacki.info" => array(
  5. "ports" => array(
  6. "6667" => false,
  7. "6697" => true
  8. )
  9. ),
  10. "mirror.knacki.info" => array(
  11. "ports" => array(
  12. "6667" => false,
  13. "6697" => true
  14. )
  15. )
  16. );
  17. }
  18. function getServersState() {
  19. require_once("./.htconfig.php");
  20. $state = @file_get_contents(PING_FILE);
  21. if (!$state) {
  22. error_log("Cannot read state file /tmp/irc_ping_state");
  23. return null;
  24. }
  25. return json_decode($state);
  26. }
  27. function writeServersState($states) {
  28. require_once("./.htconfig.php");
  29. file_put_contents(PING_FILE, json_encode($states));
  30. }
  31. ?>