Rev 14 | Rev 16 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 14 | Rev 15 | ||
---|---|---|---|
Line 604... | Line 604... | ||
604 | if (isset($elements['iri'])) { |
604 | if (isset($elements['iri'])) { |
605 | if (!is_array($elements['iri'])) { |
605 | if (!is_array($elements['iri'])) { |
606 | $elements['iri'] = array($elements['iri']); |
606 | $elements['iri'] = array($elements['iri']); |
607 | } |
607 | } |
608 | foreach ($elements['iri'] as &$iri) { |
608 | foreach ($elements['iri'] as &$iri) { |
609 | // Numeric-only nicht erlauben. Das wäre ja nur in einem IRI-Pfad gültig, aber nicht als einzelner Identifier |
609 | // Do not allow Numeric-only. It would only be valid in an IRI path, but not in a single identifier |
610 | if (!iri_arc_valid($iri, false)) $iri = null; |
610 | if (!iri_arc_valid($iri, false)) $iri = null; |
611 | } |
611 | } |
612 | } |
612 | } |
613 | 613 | ||
614 | if (isset($elements['first-registrant']['phone'])) |
614 | if (isset($elements['first-registrant']['phone'])) |
Line 986... | Line 986... | ||
986 | class OIDSimplePingProvider implements IOIDSimplePingProvider { |
986 | class OIDSimplePingProvider implements IOIDSimplePingProvider { |
987 | protected $addr = ''; |
987 | protected $addr = ''; |
988 | protected $connected = false; |
988 | protected $connected = false; |
989 | protected $socket = null; |
989 | protected $socket = null; |
990 | 990 | ||
991 | const SPP_MAX_CONNECTION_ATTEMPTS = 3; // TODO: Auslagern in OIDInfoAPI Klasse...? |
991 | const SPP_MAX_CONNECTION_ATTEMPTS = 3; // TODO: Put into an OIDInfoAPI class...? |
992 | 992 | ||
993 | const DEFAULT_PORT = 49500; |
993 | const DEFAULT_PORT = 49500; |
994 | 994 | ||
995 | protected function spp_reader_init() { |
995 | protected function spp_reader_init() { |
996 | $this->spp_reader_uninit(); |
996 | $this->spp_reader_uninit(); |
Line 998... | Line 998... | ||
998 | $ary = explode(':', $this->addr); |
998 | $ary = explode(':', $this->addr); |
999 | $host = $ary[0]; |
999 | $host = $ary[0]; |
1000 | $service_port = isset($ary[1]) ? $ary[1] : self::DEFAULT_PORT; |
1000 | $service_port = isset($ary[1]) ? $ary[1] : self::DEFAULT_PORT; |
1001 | $address = @gethostbyname($host); |
1001 | $address = @gethostbyname($host); |
1002 | if ($address === false) { |
1002 | if ($address === false) { |
1003 | echo "gethostbyname() failed.\n"; // TODO: exceptions? (Auch alle "echos" darunter) |
1003 | echo "gethostbyname() failed.\n"; // TODO: exceptions? (also all "echos" below) |
1004 | return false; |
1004 | return false; |
1005 | } |
1005 | } |
1006 | $this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); |
1006 | $this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); |
1007 | if ($this->socket === false) { |
1007 | if ($this->socket === false) { |
1008 | echo "socket_create() failed: " . socket_strerror(socket_last_error()) . "\n"; |
1008 | echo "socket_create() failed: " . socket_strerror(socket_last_error()) . "\n"; |