mirror of
https://github.com/pgmr3/synologySsoClientExamplePage.git
synced 2025-12-12 21:15:48 +01:00
first commit
This commit is contained in:
75
RDAP/Beispieldaten/Registrar_NameCom_Abfrage_KlecksNet.json
Normal file
75
RDAP/Beispieldaten/Registrar_NameCom_Abfrage_KlecksNet.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"rdapConformance":["rdap_level_0"],
|
||||
"ldhName":"PGMR2.com",
|
||||
"objectClassName":"domain",
|
||||
"secureDNS":{"delegationSigned":"false"},
|
||||
"handle":"1521651076_DOMAIN_COM-VRSN",
|
||||
"entities":[
|
||||
{"objectClassName":"entity",
|
||||
"handle":"",
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",[],"text","4.0"],
|
||||
["org",{"type":"work"},"text","Domain Protection Services, Inc."],
|
||||
["adr",[],"text",["","PO Box 1769","","Denver","CO","80201","US"]],
|
||||
["tel",{"type":["voice"]},"uri","tel:+1.7208009072"],
|
||||
["email",[],"text","https:\/\/www.name.com\/contact-domain-whois\/pgmr2.com"]
|
||||
]
|
||||
],
|
||||
"roles":["administrative"]
|
||||
},
|
||||
{"objectClassName":"entity",
|
||||
"handle":"",
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",[],"text","4.0"],
|
||||
["org",{"type":"work"},"text","Domain Protection Services, Inc."],
|
||||
["adr",[],"text",["","PO Box 1769","","Denver","CO","80201","US"]],
|
||||
["tel",{"type":["voice"]},"uri","tel:+1.7208009072"],
|
||||
["email",[],"text","https:\/\/www.name.com\/contact-domain-whois\/pgmr2.com"]
|
||||
]
|
||||
],
|
||||
"roles":["registrant"]},
|
||||
{"objectClassName":"entity",
|
||||
"handle":"",
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",[],"text","4.0"],
|
||||
["org",{"type":"work"},"text","Domain Protection Services, Inc."],
|
||||
["adr",[],"text",["","PO Box 1769","","Denver","CO","80201","US"]],
|
||||
["tel",{"type":["voice"]},"uri","tel:+1.7208009072"],
|
||||
["email",[],"text","https:\/\/www.name.com\/contact-domain-whois\/pgmr2.com"]
|
||||
]
|
||||
],
|
||||
"roles":["billing"]
|
||||
},
|
||||
{"objectClassName":"entity",
|
||||
"handle":"",
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",[],"text","4.0"],
|
||||
["org",{"type":"work"},"text","Domain Protection Services, Inc."],
|
||||
["adr",[],"text",["","PO Box 1769","","Denver","CO","80201","US"]],
|
||||
["tel",{"type":["voice"]},"uri","tel:+1.7208009072"],
|
||||
["email",[],"text","https:\/\/www.name.com\/contact-domain-whois\/pgmr2.com"]
|
||||
]
|
||||
],
|
||||
"roles":["technical"]
|
||||
}
|
||||
],
|
||||
"events":[
|
||||
{"eventAction":"expiration","eventDate":"2024-09-27 09:02:10"},
|
||||
{"eventAction":"registration","eventDate":"2008-09-27 09:02:10"},
|
||||
{"eventAction":"last changed","eventDate":"2023-09-05 16:34:03"}
|
||||
],
|
||||
"nameservers":[
|
||||
{"objectClassName":"nameserver","ldhName":"ns1.he.net","unicodeName":"ns1.he.net","status":["associated"]},
|
||||
{"objectClassName":"nameserver","ldhName":"ns2.he.net","unicodeName":"ns2.he.net","status":["associated"]},
|
||||
{"objectClassName":"nameserver","ldhName":"ns3.he.net","unicodeName":"ns3.he.net","status":["associated"]},
|
||||
{"objectClassName":"nameserver","ldhName":"ns4.he.net","unicodeName":"ns4.he.net","status":["associated"]},
|
||||
{"objectClassName":"nameserver","ldhName":"ns5.he.net","unicodeName":"ns5.he.net","status":["associated"]}
|
||||
],
|
||||
"status":["transfer prohibited"],
|
||||
"publicIds":[{"type":"IANA Registrar ID","identifier":625}],
|
||||
"port43":"whois.name.com"
|
||||
}
|
||||
64
RDAP/Beispieldaten/Registry_versign_abfrage_klecksNet.json
Normal file
64
RDAP/Beispieldaten/Registry_versign_abfrage_klecksNet.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"objectClassName":"domain",
|
||||
"handle":"1521651076_DOMAIN_COM-VRSN",
|
||||
"ldhName":"PGMR2.COM",
|
||||
"links":[
|
||||
{"value":"https:\/\/rdap.verisign.com\/com\/v1\/domain\/PGMR2.COM","rel":"self","href":"https:\/\/rdap.verisign.com\/com\/v1\/domain\/PGMR2.COM","type":"application\/rdap+json"},
|
||||
{"value":"https:\/\/namerdap.systems\/domain\/PGMR2.COM","rel":"related","href":"https:\/\/namerdap.systems\/domain\/PGMR2.COM","type":"application\/rdap+json"}
|
||||
],
|
||||
"status":["client transfer prohibited"],
|
||||
"entities":[{
|
||||
"objectClassName":"entity",
|
||||
"handle":"1040",
|
||||
"roles":["registrar"],
|
||||
"publicIds":[{"type":"IANA Registrar ID","identifier":"1040"}],
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",{},"text","4.0"],["fn",{},"text","Name106, Inc."]
|
||||
]
|
||||
],
|
||||
"entities":[{
|
||||
"objectClassName":"entity",
|
||||
"roles":["abuse"],
|
||||
"vcardArray":[
|
||||
"vcard",[
|
||||
["version",{},"text","4.0"],
|
||||
["fn",{},"text",""],
|
||||
["tel",{"type":"voice"},"uri","tel:+1.7203101849"],
|
||||
["email",{},"text","abuse@name.com"]
|
||||
]
|
||||
]
|
||||
}]
|
||||
}],
|
||||
"events":[
|
||||
{"eventAction":"registration","eventDate":"2008-09-27T09:02:10Z"},
|
||||
{"eventAction":"expiration","eventDate":"2024-09-27T09:02:10Z"},
|
||||
{"eventAction":"last changed","eventDate":"2023-09-05T16:34:03Z"},
|
||||
{"eventAction":"last update of RDAP database","eventDate":"2023-11-15T13:53:19Z"}
|
||||
],
|
||||
"secureDNS":{"delegationSigned":false},
|
||||
"nameservers":[
|
||||
{"objectClassName":"nameserver","ldhName":"NS1.HE.NET"},
|
||||
{"objectClassName":"nameserver","ldhName":"NS2.HE.NET"},
|
||||
{"objectClassName":"nameserver","ldhName":"NS3.HE.NET"},
|
||||
{"objectClassName":"nameserver","ldhName":"NS4.HE.NET"},
|
||||
{"objectClassName":"nameserver","ldhName":"NS5.HE.NET"}
|
||||
],
|
||||
"rdapConformance":[
|
||||
"rdap_level_0","icann_rdap_technical_implementation_guide_0",
|
||||
"icann_rdap_response_profile_0"],
|
||||
"notices":[
|
||||
{
|
||||
"title":"Terms of Use","description":["Service subject to Terms of Use."],
|
||||
"links":[{"href":"https:\/\/www.verisign.com\/domain-names\/registration-data-access-protocol\/terms-service\/index.xhtml","type":"text\/html"}]
|
||||
},
|
||||
{
|
||||
"title":"Status Codes","description":["For more information on domain status codes, please visit https:\/\/icann.org\/epp"],
|
||||
"links":[{"href":"https:\/\/icann.org\/epp","type":"text\/html"}]
|
||||
},
|
||||
{
|
||||
"title":"RDDS Inaccuracy Complaint Form","description":["URL of the ICANN RDDS Inaccuracy Complaint Form: https:\/\/icann.org\/wicf"],
|
||||
"links":[{"href":"https:\/\/icann.org\/wicf","type":"text\/html"}]
|
||||
}
|
||||
]
|
||||
}
|
||||
339
RDAP/LICENSE
Normal file
339
RDAP/LICENSE
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
25
RDAP/README.md
Normal file
25
RDAP/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# rdap-client
|
||||
A php client to query rdap (formerly whois) services
|
||||
|
||||
No additional libraries needed - just plain object-oriented PHP.
|
||||
|
||||
This client implements the following Internet Standards:
|
||||
|
||||
http://tools.ietf.org/html/rfc7480 HTTP Usage in the Registration Data Access Protocol (RDAP)
|
||||
http://tools.ietf.org/html/rfc7481 Security Services for the Registration Data Access Protocol (RDAP)
|
||||
http://tools.ietf.org/html/rfc7482 Registration Data Access Protocol (RDAP) Query Format
|
||||
http://tools.ietf.org/html/rfc7483 JSON Responses for the Registration Data Access Protocol (RDAP)
|
||||
http://tools.ietf.org/html/rfc7484 Finding the Authoritative Registration Data (RDAP) Service
|
||||
http://tools.ietf.org/html/rfc7485 Inventory and Analysis of WHOIS Registration Objects
|
||||
|
||||
Bootstrap files from the IANA website:
|
||||
https://data.iana.org/rdap/dns.json for the domain name space
|
||||
https://data.iana.org/rdap/asn.json for the AS numbers space
|
||||
https://data.iana.org/rdap/ipv4.json for the IPv4 address space
|
||||
https://data.iana.org/rdap/ipv6.json for the IPv6 address space
|
||||
|
||||
RDAP json values:
|
||||
http://www.iana.org/assignments/rdap-json-values/rdap-json-values-1.csv
|
||||
|
||||
RDAP extensions library:
|
||||
https://www.iana.org/assignments/rdap-extensions/rdap-extensions.xhtml
|
||||
28
RDAP/composer.json
Normal file
28
RDAP/composer.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "metaregistrar/rdap-client",
|
||||
"description": "A php client to query rdap (formerly whois) services",
|
||||
"minimum-stability": "stable",
|
||||
"license": "proprietary",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ewout de Graaf",
|
||||
"email": "ewout@metaregistrar.com"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Metaregistrar\\RDAP\\": "src"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8",
|
||||
"psr/simple-cache": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/simple-cache": "For using the metadata cache."
|
||||
}
|
||||
}
|
||||
1586
RDAP/composer.lock
generated
Normal file
1586
RDAP/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
159
RDAP/index.php
Normal file
159
RDAP/index.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php declare(strict_types=1);
|
||||
// ------------------------------------------------------------------------------
|
||||
//
|
||||
// <20> Copyright (?) 2023 License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
// Author: https://github.com/pgmr3
|
||||
// ------------------------------------------------------------------------------
|
||||
// additional code for authorization check/automatic logout
|
||||
include_once('../check_accesstoken.php');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<body>
|
||||
<div id="session-lifetime" >loading...</div>
|
||||
<br/>
|
||||
</body>
|
||||
<script src="../js/myLoginScript.js" type="text/javascript"></script>
|
||||
<script>
|
||||
// Document fully loaded
|
||||
function dokumentLoadDone(event) {
|
||||
<?php
|
||||
//Restart session lifetime
|
||||
if(session_status() !== PHP_SESSION_ACTIVE) $name_vorher = session_name (SESSION_NAME); //"ServerTools");
|
||||
session_start();//repeated start session without new parameters
|
||||
$_SESSION['endTime'] = time()+ SESSION_COOKIE_LIFETIME;
|
||||
?>
|
||||
//Query the user login status? and query remaining login time.
|
||||
fetchAccess(true); //with issue remaining term
|
||||
//fetchAccess(false); //without issue remaining term
|
||||
}
|
||||
//document.addEventListener('DOMContentLoaded', dokumentLoadDone , false); //first event loaded
|
||||
window.addEventListener('load', dokumentLoadDone);// secondly, fully loaded
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<?php // declare(strict_types=1);
|
||||
|
||||
include './src/Rdap.php'; //fie
|
||||
include './src/RdapException.php';//fie
|
||||
|
||||
use Metaregistrar\RDAP\Rdap; //fie
|
||||
use Metaregistrar\RDAP\RdapException;
|
||||
|
||||
|
||||
$search = 59980;
|
||||
$protocol = Metaregistrar\RDAP\rdap::ASN;
|
||||
|
||||
|
||||
//$search = '6939';
|
||||
//$protocol = Metaregistrar\RDAP\rdap::ASN;
|
||||
|
||||
//$search = '81.4.97.200';
|
||||
//$search = '82.135.96.210';
|
||||
//$search = '8.8.4.4';
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::IPV4;
|
||||
|
||||
//$search = '2001:470::'; //Nicht OK
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::IPV6;
|
||||
|
||||
//domain info des eigenen html-servers
|
||||
$search = $_SERVER['SERVER_NAME'];//Host
|
||||
$ServerArray = explode('.', $search);//Host splitten
|
||||
$search = $ServerArray[count($ServerArray)-2] . '.' . $ServerArray[count($ServerArray)-1]; //Domain aus den beiden h<>chen Array Elementen Zusammen bauen
|
||||
$protocol = Metaregistrar\RDAP\Rdap::DOMAIN;
|
||||
|
||||
//$search = 'RIPE-NCC-END-MNT';//Fehler <20>ng<6E>ltiger Parameter
|
||||
//$search = 'farb.klecks.net'; //nicht gefunden
|
||||
//$search = 'klecks.net';
|
||||
//$search = 'pgmr2.eu'; //nicht gefunden
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::DOMAIN;
|
||||
|
||||
|
||||
try {
|
||||
$rdap = new Metaregistrar\RDAP\Rdap($protocol);
|
||||
$test = $rdap->search($search);
|
||||
|
||||
if ($test && $test->getErrorCode() === null) {
|
||||
//var_dump ($test);
|
||||
echo nl2br('class name: ' . $test->getClassname() . PHP_EOL);
|
||||
echo nl2br('handle: ' . $test->getHandle() . PHP_EOL);
|
||||
echo nl2br('LDH (letters, digits, hyphens) name: ' . $test->getLDHName() . PHP_EOL);
|
||||
|
||||
if($test->getClassname() === 'ip network') { //fie
|
||||
echo nl2br("name: ".$test->getName().PHP_EOL);
|
||||
echo nl2br("type: ".$test->getType().PHP_EOL);
|
||||
echo nl2br("port 43 service: ".$test->getPort43().PHP_EOL);
|
||||
}
|
||||
|
||||
if (is_array($test->getNameservers())) {
|
||||
echo nl2br("\nNameservers:\n");
|
||||
foreach ($test->getNameservers() as $nameserver) {
|
||||
$nameserver->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getSecureDNS())) {
|
||||
echo nl2br("DNSSEC:\n");
|
||||
foreach ($test->getSecureDNS() as $dnssec) {
|
||||
$dnssec->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
echo nl2br("rdap conformance: \n");
|
||||
foreach ($test->getConformance() as $conformance) {
|
||||
$conformance->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
if (is_array($test->getEntities())) {
|
||||
echo nl2br("Entities found:\n");
|
||||
foreach ($test->getEntities() as $entity) {
|
||||
$entity->dumpContents();
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
}
|
||||
if (is_array($test->getLinks())) {
|
||||
echo nl2br("Links:\n");
|
||||
foreach ($test->getLinks() as $link) {
|
||||
$link->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getNotices())) {
|
||||
echo nl2br("Notices:\n");
|
||||
foreach ($test->getNotices() as $notice) {
|
||||
$notice->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getRemarks())) {
|
||||
echo nl2br("Remarks:\n");
|
||||
foreach ($test->getRemarks() as $remark) {
|
||||
$remark->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getStatus())) {
|
||||
echo nl2br("Statuses:\n");
|
||||
foreach ($test->getStatus() as $status) {
|
||||
$status->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
|
||||
if (is_array($test->getEvents())) {
|
||||
echo nl2br("Events:\n");
|
||||
foreach ($test->getEvents() as $event) {
|
||||
$event->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
} else {
|
||||
$title = '';
|
||||
if ($test) {
|
||||
$title = $test->getTitle();
|
||||
}
|
||||
echo nl2br("$search was not found on any RDAP service. $title\n");
|
||||
}
|
||||
} catch (RdapException $e) {
|
||||
echo nl2br('ERROR: ' . $e->getMessage() . PHP_EOL);
|
||||
}
|
||||
7
RDAP/php_do_timer.txt
Normal file
7
RDAP/php_do_timer.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
$x = 1;
|
||||
|
||||
do {
|
||||
echo "The number is: $x <br>";
|
||||
$x++;
|
||||
sleep(1);
|
||||
} while ($x <= 10);
|
||||
21
RDAP/src/Data/RdapConformance.php
Normal file
21
RDAP/src/Data/RdapConformance.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapConformance extends RdapObject {
|
||||
protected $rdapConformance;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- ' . $this->getRdapConformance() . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRdapConformance(): ?string {
|
||||
return $this->rdapConformance;
|
||||
}
|
||||
}
|
||||
38
RDAP/src/Data/RdapDescription.php
Normal file
38
RDAP/src/Data/RdapDescription.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapDescription extends RdapObject {
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* RdapDescription constructor.
|
||||
* @param string $key
|
||||
* @param mixed $content
|
||||
*/
|
||||
public function __construct(string $key, $content) {
|
||||
parent::__construct($key, null);
|
||||
if (is_array($content)) {
|
||||
$this->description = $content[0];
|
||||
} else {
|
||||
$this->description = $content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br(' - Description: ' . $this->getDescription() . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription(): string {
|
||||
return $this->description??'';
|
||||
}
|
||||
}
|
||||
193
RDAP/src/Data/RdapEntity.php
Normal file
193
RDAP/src/Data/RdapEntity.php
Normal file
@@ -0,0 +1,193 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapEntity extends RdapObject {
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
protected $type;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $lang;
|
||||
/*
|
||||
* @var string
|
||||
*/
|
||||
protected $handle;
|
||||
/**
|
||||
* @var null|RdapStatus[]
|
||||
*/
|
||||
protected $status;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $port43;
|
||||
/**
|
||||
* @var RdapVcard[]|null
|
||||
*/
|
||||
protected $vcards ;
|
||||
|
||||
protected $vcardArray ;
|
||||
|
||||
protected $objectClassName;
|
||||
|
||||
protected $remarks;
|
||||
/**
|
||||
* @var RdapRole[]|null
|
||||
*/
|
||||
protected $roles;
|
||||
/**
|
||||
* @var null|RdapPublicId[]
|
||||
*/
|
||||
protected $publicIds;
|
||||
|
||||
protected $entities ;
|
||||
|
||||
protected $events;
|
||||
|
||||
protected $links;
|
||||
|
||||
protected $legalRepresentative;
|
||||
|
||||
protected $nicbrDomainCount;
|
||||
|
||||
protected $nicbrInetCount;
|
||||
|
||||
protected $nicbrAutnumCount;
|
||||
|
||||
public function __construct(string $key, $content) {
|
||||
parent::__construct($key, $content);
|
||||
if ($this->vcardArray && count($this->vcardArray) > 0) {
|
||||
foreach ($this->vcardArray as $id => $vcard) {
|
||||
if (is_array($vcard)) {
|
||||
foreach ($vcard as $v) {
|
||||
if (is_array($v)) {
|
||||
foreach ($v as $card) {
|
||||
$this->vcards[] = new RdapVcard($card[0], $card[1], $card[2], $card[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->type = $vcard;
|
||||
}
|
||||
}
|
||||
unset($this->vcardArray);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage(): string {
|
||||
return $this->lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRoles(): string {
|
||||
$return = '';
|
||||
if (is_array($this->roles)) {
|
||||
foreach ($this->roles as $role) {
|
||||
if ($return !== '') {
|
||||
$return .= ', ';
|
||||
}
|
||||
$return .= $role->getRole();
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- Handle: ' . $this->getHandle() . PHP_EOL);
|
||||
if (isset($this->roles)) {
|
||||
foreach ($this->roles as $role) {
|
||||
echo nl2br('- Role: ' . $role->getRole() . PHP_EOL);
|
||||
}
|
||||
}
|
||||
//if (isset($this->port43)) {
|
||||
// echo '- Port 43 whois: ' . $this->getPort43() . PHP_EOL;
|
||||
//}
|
||||
if (isset($this->publicIds) && is_array($this->publicIds)) {
|
||||
foreach ($this->publicIds as $publicid) {
|
||||
$publicid->dumpContents();
|
||||
}
|
||||
}
|
||||
if (is_array($this->vcards) && (count($this->vcards) > 0)) {
|
||||
foreach ($this->vcards as $vcard) {
|
||||
$vcard->dumpContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHandle() {
|
||||
if (is_array($this->handle)){
|
||||
return $this->handle[0];
|
||||
}
|
||||
else {
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getPort43() {
|
||||
return $this->port43;
|
||||
}
|
||||
|
||||
public function getEntities() {
|
||||
return $this->entities;
|
||||
}
|
||||
|
||||
public function getPublicIds() {
|
||||
return $this->publicIds;
|
||||
}
|
||||
|
||||
public function getVcards() {
|
||||
return $this->vcards;
|
||||
}
|
||||
|
||||
public function getEvents(){
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
public function getLinks(){
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
public function getLegalRepresentative(){
|
||||
return $this->legalRepresentative;
|
||||
}
|
||||
|
||||
public function getRemarks(){
|
||||
return $this->remarks;
|
||||
}
|
||||
|
||||
|
||||
public function getStatus(){
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
public function getNicbrDomainCount(){
|
||||
return $this->nicbrDomainCount;
|
||||
}
|
||||
|
||||
public function getNicbrInetCount(){
|
||||
return $this->nicbrInetCount;
|
||||
}
|
||||
|
||||
public function getNicbrAutnumCount(){
|
||||
return $this->nicbrAutnumCount;
|
||||
}
|
||||
}
|
||||
36
RDAP/src/Data/RdapEvent.php
Normal file
36
RDAP/src/Data/RdapEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapEvent extends RdapObject {
|
||||
protected $events;
|
||||
|
||||
public function __construct(string $key, $content) {
|
||||
parent::__construct($key, null);
|
||||
if (isset($content[0])) {
|
||||
foreach ($content as $c) {
|
||||
$this->events[$c['eventAction']] = $c['eventDate'];
|
||||
}
|
||||
} else {
|
||||
$this->events[$content['eventAction']] = $content['eventDate'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getEvents(): ?array {
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
if (is_array($this->events)) {
|
||||
foreach ($this->events as $action => $date) {
|
||||
echo nl2br(" - $action: $date\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
74
RDAP/src/Data/RdapLink.php
Normal file
74
RDAP/src/Data/RdapLink.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapLink extends RdapObject {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $rel;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $href;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
public function __construct(string $key, $content) {
|
||||
parent::__construct($key, null);
|
||||
if (is_array($content)) {
|
||||
//print_r($content);
|
||||
if (isset($content[0])) {
|
||||
if (isset($content[0]['rel'])){
|
||||
$this->rel = $content[0]['rel'];
|
||||
}
|
||||
$this->href = $content[0]['href'];
|
||||
$this->type = $content[0]['type'];
|
||||
if (isset($content[0]['value'])){//fie
|
||||
$this->value = $content[0]['value'];
|
||||
}//fie
|
||||
} else {
|
||||
if (isset($content['rel'])){
|
||||
$this->rel = $content['rel'];
|
||||
}
|
||||
$this->href = $content['href'];
|
||||
$this->type = $content['type'];
|
||||
if (isset($content['value'])){//fie
|
||||
$this->value = $content['value'];
|
||||
}//fie
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function dumpContents(): void {
|
||||
//fie org echo ' - Link: ' . $this->rel . ': ', $this->href . ' (' . $this->title . ")\n";
|
||||
echo nl2br(' - Link: ' . $this->href . "\n");//fie
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRel(): string {
|
||||
return $this->rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHref(): string {
|
||||
return $this->href;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string {
|
||||
return $this->type;
|
||||
}
|
||||
}
|
||||
59
RDAP/src/Data/RdapNameserver.php
Normal file
59
RDAP/src/Data/RdapNameserver.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapNameserver extends RdapObject {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $ldhName;
|
||||
/**
|
||||
* @var null|RdapStatus
|
||||
*/
|
||||
protected $status;
|
||||
/**
|
||||
* @var RdapLink[]|null
|
||||
*/
|
||||
protected $links;
|
||||
/** @var RdapEvent[] */
|
||||
protected $events ;
|
||||
protected $ipAddresses;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus(): string {
|
||||
$return = '';
|
||||
if (is_array($this->status)) {
|
||||
foreach ($this->status as $status) {
|
||||
if ($return !== '') {
|
||||
$return .= ', ';
|
||||
}
|
||||
$return .= $status;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- Object Classname: ' . $this->getObjectClassname() . PHP_EOL);
|
||||
echo nl2br('- LDH Name: ' . $this->ldhName . PHP_EOL);
|
||||
if (isset($this->status)) {
|
||||
//echo "- Status: ".$this->status->getStatus().PHP_EOL;
|
||||
}
|
||||
if (isset($this->links)) {
|
||||
foreach ($this->links as $link) {
|
||||
$link->dumpContents();
|
||||
}
|
||||
}
|
||||
if (isset($this->events)) {
|
||||
foreach ($this->events as $event) {
|
||||
$event->dumpContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
68
RDAP/src/Data/RdapNotice.php
Normal file
68
RDAP/src/Data/RdapNotice.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapNotice extends RdapObject {
|
||||
protected $title;
|
||||
protected $type ;
|
||||
/**
|
||||
* @var RdapDescription[]|null
|
||||
*/
|
||||
protected $description;
|
||||
/**
|
||||
* @var RdapLink[]|null
|
||||
*/
|
||||
protected $links;
|
||||
|
||||
public function __construct(string $key, $content) {
|
||||
$this->objectClassName = 'Notice';
|
||||
parent::__construct($key, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- ' . $this->getTitle() . ": " . $this->getType() . PHP_EOL);
|
||||
if (is_array($this->description)) {
|
||||
foreach ($this->description as $descr) {
|
||||
$descr->dumpContents();
|
||||
}
|
||||
}
|
||||
if (is_array($this->links)) {
|
||||
foreach ($this->links as $link) {
|
||||
$link->dumpContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTitle(): ?string {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getDescription(): array {
|
||||
$return = '';
|
||||
if (is_array($this->description)) {
|
||||
foreach ($this->description as $descr) {
|
||||
$return .= $descr . PHP_EOL;
|
||||
}
|
||||
} else {
|
||||
$return = $this->description;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
138
RDAP/src/Data/RdapObject.php
Normal file
138
RDAP/src/Data/RdapObject.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
use Metaregistrar\RDAP\RdapException;
|
||||
|
||||
/**
|
||||
* This is the parent class for all RdapXXXXX objects. This class will interpret the json that was received and convert it into objects that give back the data required
|
||||
* Class RdapObject
|
||||
*
|
||||
* @package Metaregistrar\RDAP
|
||||
*/
|
||||
class RdapObject {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $objectClassName;
|
||||
|
||||
/**
|
||||
* RdapObject constructor.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $content
|
||||
*
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function __construct(string $key, $content) {
|
||||
if ($content) {
|
||||
if (is_array($content)) {
|
||||
foreach ($content as $contentKey => $contentValue) {
|
||||
if (is_array($contentValue)) {
|
||||
if (is_numeric($contentKey)) {
|
||||
foreach ($contentValue as $k => $v) {
|
||||
$this->{$k}[] = self::createObject($k, $v);
|
||||
}
|
||||
} else {
|
||||
$this->{$contentKey}[] = self::createObject($contentKey, $contentValue);
|
||||
}
|
||||
} else {
|
||||
$this->{$contentKey} = $contentValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$var = lcfirst(str_replace('Metaregistrar\RDAP\Data\\', '', $key));
|
||||
$this->{$var} = $content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $key
|
||||
* @param $value
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
private static function createObject($key, $value) {
|
||||
if (is_numeric($key)) {
|
||||
if (is_array($value)) {
|
||||
throw new RdapException("'$key' can not be an array.");
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
return self::KeyToObject($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function KeyToObject(string $name, $content) {
|
||||
$name = self::KeyToObjectName($name);
|
||||
if (class_exists($name)) {
|
||||
return new $name($name, $content);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function KeyToObjectName(string $name): string {
|
||||
switch ($name) {
|
||||
case 'rdapConformance':
|
||||
return RdapConformance::class;
|
||||
case 'entities':
|
||||
return RdapEntity::class;
|
||||
case 'remarks':
|
||||
return RdapRemark::class;
|
||||
case 'links':
|
||||
return RdapLink::class;
|
||||
case 'notices':
|
||||
return RdapNotice::class;
|
||||
case 'events':
|
||||
return RdapEvent::class;
|
||||
case 'roles':
|
||||
return RdapRole::class;
|
||||
case 'description':
|
||||
return RdapDescription::class;
|
||||
case 'port43':
|
||||
return RdapPort43::class;
|
||||
case 'nameservers':
|
||||
return RdapNameserver::class;
|
||||
case 'secureDNS':
|
||||
return RdapSecureDNS::class;
|
||||
case 'status':
|
||||
return RdapStatus::class;
|
||||
case 'publicIds':
|
||||
return RdapPublicId::class;
|
||||
default:
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
final public function getObjectClassname(): string {
|
||||
if (is_string($this->objectClassName)) {
|
||||
return $this->objectClassName;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
6
RDAP/src/Data/RdapPort43.php
Normal file
6
RDAP/src/Data/RdapPort43.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapPort43 extends RdapObject {
|
||||
}
|
||||
27
RDAP/src/Data/RdapPublicId.php
Normal file
27
RDAP/src/Data/RdapPublicId.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapPublicId extends RdapObject {
|
||||
protected $ids;
|
||||
|
||||
public function __construct(string $key, $content) {
|
||||
$this->objectClassName = 'PublicId';
|
||||
parent::__construct($key, null);
|
||||
if (is_array($content)) {
|
||||
foreach ($content as $id) {
|
||||
$this->ids[$id['type']] = $id['identifier'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function dumpContents(): void {
|
||||
foreach ($this->ids as $type => $identifier) {
|
||||
echo nl2br("- $type: $identifier\n");
|
||||
}
|
||||
}
|
||||
|
||||
public function getIds(){
|
||||
return $this->ids;
|
||||
}
|
||||
}
|
||||
23
RDAP/src/Data/RdapRemark.php
Normal file
23
RDAP/src/Data/RdapRemark.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapRemark extends RdapObject {
|
||||
protected $description = [];
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
foreach ($this->getDescription() as $description) {
|
||||
$description->dumpContents();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapDescription[]
|
||||
*/
|
||||
public function getDescription(): array {
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
19
RDAP/src/Data/RdapRole.php
Normal file
19
RDAP/src/Data/RdapRole.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapRole extends RdapObject {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- Role: ' . $this->getRole() . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRole() {
|
||||
return $this->{0};
|
||||
}
|
||||
}
|
||||
148
RDAP/src/Data/RdapSecureDNS.php
Normal file
148
RDAP/src/Data/RdapSecureDNS.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapSecureDNS extends RdapObject {
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $rdapSecureDNS;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $delegationSigned;
|
||||
/**
|
||||
* @var null|int
|
||||
*/
|
||||
protected $maxSigLife;
|
||||
/**
|
||||
* @var null|array
|
||||
*/
|
||||
protected $dsData;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $keyTag;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $digestType;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $digest;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $algorithm;
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isRdapSecureDNS(): bool {
|
||||
return $this->rdapSecureDNS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
if ($this->delegationSigned) {
|
||||
echo nl2br("- Domain name is signed\n");
|
||||
} else {
|
||||
echo nl2br("- Domain name is not signed\n");
|
||||
}
|
||||
if ($this->getKeyTag()) {
|
||||
$this->dumpDigest();
|
||||
}
|
||||
if ($this->getDsData()) {
|
||||
$this->dumpDnskey();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getKeyTag(): ?string {
|
||||
if (is_array($this->keyTag)) {
|
||||
return (string)array_shift($this->keyTag);
|
||||
}
|
||||
|
||||
return $this->keyTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpDigest(): void {
|
||||
echo nl2br('- Delegation signed: ' . $this->getDelegationSigned() . PHP_EOL);
|
||||
echo nl2br('- Max sig life: ' . $this->getMaxSigLife() . PHP_EOL);
|
||||
echo nl2br('- Keytag: ' . $this->getKeyTag() . PHP_EOL);
|
||||
echo nl2br('- Algorithm: ' . $this->getAlgorithm() . PHP_EOL);
|
||||
echo nl2br('- Digest Type :' . $this->getDigestType() . PHP_EOL);
|
||||
echo nl2br('- Digest: ' . $this->getDigest() . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getDelegationSigned(): ?string {
|
||||
return $this->delegationSigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getMaxSigLife(): ?int {
|
||||
return $this->maxSigLife;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getAlgorithm(): ?string {
|
||||
if (is_array($this->algorithm)) {
|
||||
return (string)array_shift($this->algorithm);
|
||||
}
|
||||
|
||||
return $this->algorithm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getDigestType(): ?string {
|
||||
if (is_array($this->digestType)) {
|
||||
return (string)array_shift($this->digestType);
|
||||
}
|
||||
|
||||
return $this->digestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getDigest(): ?string {
|
||||
if (is_array($this->digest)) {
|
||||
return (string)array_shift($this->digest);
|
||||
}
|
||||
|
||||
return $this->digest;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getDsData(): ?array {
|
||||
return $this->dsData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpDnskey(): void {
|
||||
echo nl2br('- Delegation signed: ' . $this->getDelegationSigned() . PHP_EOL);
|
||||
echo nl2br('- Max sig life: ' . $this->getMaxSigLife() . PHP_EOL);
|
||||
echo nl2br('- DNS Key: ' . implode(', ', $this->getDsData()) . PHP_EOL);
|
||||
}
|
||||
}
|
||||
25
RDAP/src/Data/RdapStatus.php
Normal file
25
RDAP/src/Data/RdapStatus.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapStatus extends RdapObject {
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $rdapStatus;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function dumpContents(): void {
|
||||
echo nl2br('- Status: ' . $this->getStatus() . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getStatus(): ?string{
|
||||
return $this->rdapStatus ?? $this->{0} ?? null;
|
||||
}
|
||||
}
|
||||
117
RDAP/src/Data/RdapVcard.php
Normal file
117
RDAP/src/Data/RdapVcard.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Data;
|
||||
|
||||
final class RdapVcard {
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $name;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
protected $fieldtype;
|
||||
protected $content;
|
||||
/**
|
||||
* @var null|int
|
||||
*/
|
||||
protected $preference;
|
||||
/**
|
||||
* @var null|array
|
||||
*/
|
||||
protected $contenttypes;
|
||||
|
||||
public function __construct($name, $extras, $type, $contents) {
|
||||
$this->name = $name;
|
||||
if (is_array($extras)) {
|
||||
if (isset($extras['type'])) {
|
||||
if (is_array($extras['type'])) {
|
||||
foreach ($extras['type'] as $contentType) {
|
||||
$this->contenttypes[] = $contentType;
|
||||
}
|
||||
} else {
|
||||
$this->contenttypes[] = $extras['type'];
|
||||
}
|
||||
}
|
||||
if (isset($extras['pref'])) {
|
||||
$this->preference = $extras['pref'];
|
||||
}
|
||||
}
|
||||
$this->fieldtype = $type;
|
||||
$this->content = $contents;
|
||||
}
|
||||
|
||||
public function getName(): ?string {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getFieldtype(): ?string {
|
||||
return $this->fieldtype;
|
||||
}
|
||||
|
||||
public function getContentTypes(): ?array {
|
||||
return $this->contenttypes;
|
||||
}
|
||||
|
||||
public function dumpContents(): void {
|
||||
echo nl2br(' - ' . $this->getContent() . PHP_EOL);
|
||||
}
|
||||
|
||||
public function getContent(): ?string {
|
||||
if ($this->name === 'version') {
|
||||
return 'Version: ' . $this->content;
|
||||
}
|
||||
if ($this->name === 'tel') {
|
||||
return 'Type: ' . $this->fieldtype . ', Preference: ' . $this->preference . ', Content: ' . $this->content . ' (' . $this->dumpContentTypes() . ')';
|
||||
}
|
||||
if ($this->name === 'email') {
|
||||
return 'Type: ' . $this->name . ', Content: ' . $this->content;
|
||||
}
|
||||
if ($this->name === 'adr') {
|
||||
$return = 'Type: ' . $this->name . ', Content: ';
|
||||
foreach ($this->content as $content) {
|
||||
if (is_array($content)) {
|
||||
foreach ($content as $cont) {
|
||||
$return .= $cont . ' ';
|
||||
}
|
||||
} else if (trim($content) !== '') {
|
||||
$return .= $content . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
if ($this->name === 'fn') {
|
||||
return 'Type: ' . $this->name . ', Content: ' . $this->content;
|
||||
}
|
||||
if ($this->name === 'kind') {
|
||||
return 'Kind: ' . $this->content;
|
||||
}
|
||||
if ($this->name === 'ISO-3166-1-alpha-2') {
|
||||
return 'Language: ' . $this->content . ' (' . $this->name . ')';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getContentSimple(){
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
|
||||
public function dumpContentTypes(): string {
|
||||
$return = '';
|
||||
if (is_array($this->contenttypes)) {
|
||||
foreach ($this->contenttypes as $type) {
|
||||
if ($return !== '') {
|
||||
$return .= ', ';
|
||||
}
|
||||
$return .= $type;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
239
RDAP/src/Rdap.php
Normal file
239
RDAP/src/Rdap.php
Normal file
@@ -0,0 +1,239 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP;
|
||||
|
||||
include './src/Data/RdapObject.php';//fie
|
||||
include './src/Data/RdapConformance.php';//fie
|
||||
include './src/Data/RdapDescription.php';//fie
|
||||
include './src/Data/RdapEntity.php';//fie
|
||||
include './src/Data/RdapEvent.php';//fie
|
||||
include './src/Data/RdapLink.php';//fie
|
||||
include './src/Data/RdapNameserver.php';//fie
|
||||
include './src/Data/RdapNotice.php';//fie
|
||||
include './src/Data/RdapPort43.php';//fie
|
||||
include './src/Data/RdapPublicId.php';//fie
|
||||
include './src/Data/RdapRemark.php';//fie
|
||||
include './src/Data/RdapRole.php';//fie
|
||||
include './src/Data/RdapSecureDNS.php';//fie
|
||||
include './src/Data/RdapStatus.php';//fie
|
||||
include './src/Data/RdapVcard.php';//fie
|
||||
|
||||
include './src/Responses/RdapResponse.php';//fie
|
||||
include './src/Responses/RdapAsnResponse.php';//fie
|
||||
include './src/Responses/RdapIpResponse.php';//fie
|
||||
|
||||
//include './src/RdapException.php';//fie
|
||||
|
||||
use Metaregistrar\RDAP\Responses\RdapResponse;
|
||||
use Metaregistrar\RDAP\Responses\RdapAsnResponse;
|
||||
use Metaregistrar\RDAP\Responses\RdapIpResponse;
|
||||
use Metaregistrar\RDAP\RdapException; //fie
|
||||
|
||||
class Rdap {
|
||||
public const ASN = 'asn';
|
||||
public const IPV4 = 'ipv4';
|
||||
public const IPV6 = 'ipv6';
|
||||
public const NS = 'ns';
|
||||
public const DOMAIN = 'domain';
|
||||
public const SEARCH = 'search';
|
||||
public const HOME = 'home';
|
||||
|
||||
private static $protocols = [
|
||||
'ipv4' => [self::HOME => 'https://data.iana.org/rdap/ipv4.json', self::SEARCH => 'ip/'],
|
||||
'domain' => [self::HOME => 'https://data.iana.org/rdap/dns.json', self::SEARCH => 'domain/'],
|
||||
'ns' => [self::HOME => 'https://data.iana.org/rdap/dns.json', self::SEARCH => 'nameserver/'],
|
||||
'ipv6' => [self::HOME => 'https://data.iana.org/rdap/ipv6.json', self::SEARCH => 'ip/'],
|
||||
'asn' => [self::HOME => 'https://data.iana.org/rdap/asn.json', self::SEARCH => 'autnum/']
|
||||
];
|
||||
|
||||
private $protocol;
|
||||
private $publicationdate = '';
|
||||
private $version = '';
|
||||
private $description = '';
|
||||
|
||||
/**
|
||||
* Rdap constructor.
|
||||
*
|
||||
* @param string $protocol
|
||||
*
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function __construct(string $protocol) {
|
||||
if (($protocol !== self::ASN) && ($protocol !== self::IPV4) && ($protocol !== self::IPV6) && ($protocol !== self::DOMAIN)) {
|
||||
throw new RdapException('Protocol ' . $protocol . ' is not recognized by this rdap client implementation');
|
||||
}
|
||||
|
||||
$this->protocol = $protocol;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPublicationdate(): string {
|
||||
return $this->publicationdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $publicationdate
|
||||
*/
|
||||
public function setPublicationdate(string $publicationdate): void {
|
||||
$this->publicationdate = $publicationdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string {
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $version
|
||||
*/
|
||||
public function setVersion(string $version): void {
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription(): string {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription(string $description): void {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $search
|
||||
*
|
||||
* @return \Metaregistrar\RDAP\Responses\RdapAsnResponse|\Metaregistrar\RDAP\Responses\RdapIpResponse|\Metaregistrar\RDAP\Responses\RdapResponse|null
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function search(string $search): ?RdapResponse {
|
||||
if (!isset($search) || ($search === '')) {
|
||||
throw new RdapException('Search parameter may not be empty');
|
||||
}
|
||||
|
||||
$search = trim($search);
|
||||
if ((!is_string($search)) && in_array($this->getProtocol(), [self::DOMAIN, self::NS, self::IPV4, self::IPV6], true)) {
|
||||
throw new RdapException('Search parameter must be a string for ipv4, ipv6, domain or nameserver searches');
|
||||
}
|
||||
|
||||
if ((!is_numeric($search)) && ($this->getProtocol() === self::ASN)) {
|
||||
throw new RdapException('Search parameter must be a number or a string with numeric info for asn searches');
|
||||
}
|
||||
|
||||
//Domain string ohne . abfangen
|
||||
if ( (is_string($search)) && (count(explode('.', $search, 2))<2) && ($this->getProtocol() === self::DOMAIN)) {
|
||||
throw new RdapException('Search parameter must be a string with xxx.tld info for domain searches');
|
||||
}
|
||||
|
||||
$parameter = $this->prepareSearch($search);
|
||||
$services = $this->readRoot();
|
||||
|
||||
foreach ($services as $service) {
|
||||
foreach ($service[0] as $number) {
|
||||
// ip address range match
|
||||
if (strpos($number, '-') > 0) {
|
||||
[$start, $end] = explode('-', $number);
|
||||
if (($parameter >= $start) && ($parameter <= $end)) {
|
||||
// check for slash as last character in the server name, if not, add it
|
||||
if ($service[1][0][strlen($service[1][0]) - 1] !== '/') {
|
||||
$service[1][0] .= '/';
|
||||
}
|
||||
|
||||
$rdap = file_get_contents($service[1][0] . self::$protocols[$this->protocol][self::SEARCH] . $search);
|
||||
|
||||
return $this->createResponse($this->getProtocol(), $rdap);
|
||||
}
|
||||
} else {
|
||||
// exact match
|
||||
if ($number === $parameter) {
|
||||
// check for slash as last character in the server name, if not, add it
|
||||
if ($service[1][0][strlen($service[1][0]) - 1] !== '/') {
|
||||
$service[1][0] .= '/';
|
||||
}
|
||||
|
||||
$rdap = file_get_contents($service[1][0] . self::$protocols[$this->protocol][self::SEARCH] . $search);
|
||||
|
||||
return $this->createResponse($this->getProtocol(), $rdap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getProtocol(): string {
|
||||
return $this->protocol;
|
||||
}
|
||||
|
||||
private function prepareSearch(string $string): string {
|
||||
switch ($this->getProtocol()) {
|
||||
case self::IPV4:
|
||||
[$start] = explode('.', $string);
|
||||
return $start . '.0.0.0/8';
|
||||
|
||||
case self::IPV6: //fie
|
||||
//[$start] = explode('.', $string);
|
||||
//return $start . '.0.0.0/8';
|
||||
return $string;//fie
|
||||
|
||||
case self::DOMAIN:
|
||||
$extension = explode('.', $string, 2);
|
||||
return $extension[1];
|
||||
|
||||
default:
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function readRoot(): array {
|
||||
$rdap = file_get_contents(self::$protocols[$this->protocol][self::HOME]);
|
||||
$json = json_decode($rdap, false);
|
||||
$this->setDescription($json->description);
|
||||
$this->setPublicationdate($json->publication);
|
||||
$this->setVersion($json->version);
|
||||
|
||||
return $json->services;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $protocol
|
||||
* @param string $json
|
||||
*
|
||||
* @return \Metaregistrar\RDAP\Responses\RdapResponse
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
protected function createResponse(string $protocol, string $json): RdapResponse {
|
||||
switch ($protocol) {
|
||||
case self::IPV4:
|
||||
return new RdapIpResponse($json);
|
||||
case self::IPV6: //fie
|
||||
return new RdapIpResponse($json);//fie
|
||||
case self::ASN:
|
||||
return new RdapAsnResponse($json);
|
||||
default:
|
||||
return new RdapResponse($json);
|
||||
}
|
||||
}
|
||||
|
||||
public function case(): void {
|
||||
}
|
||||
}
|
||||
8
RDAP/src/RdapException.php
Normal file
8
RDAP/src/RdapException.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Metaregistrar\RDAP;
|
||||
|
||||
use Exception;
|
||||
|
||||
class RdapException extends Exception {
|
||||
}
|
||||
6
RDAP/src/Responses/RdapAsnResponse.php
Normal file
6
RDAP/src/Responses/RdapAsnResponse.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Responses;
|
||||
|
||||
class RdapAsnResponse extends RdapResponse {
|
||||
}
|
||||
38
RDAP/src/Responses/RdapIpResponse.php
Normal file
38
RDAP/src/Responses/RdapIpResponse.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Responses;
|
||||
|
||||
final class RdapIpResponse extends RdapResponse {
|
||||
protected $startAddress;
|
||||
protected $endAddress;
|
||||
protected $ipVersion;
|
||||
protected $country;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getStartAddress(): string {
|
||||
return $this->startAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEndAddress(): string {
|
||||
return $this->endAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIpVersion(): string {
|
||||
return $this->ipVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry(): string {
|
||||
return $this->country;
|
||||
}
|
||||
}
|
||||
231
RDAP/src/Responses/RdapResponse.php
Normal file
231
RDAP/src/Responses/RdapResponse.php
Normal file
@@ -0,0 +1,231 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Metaregistrar\RDAP\Responses;
|
||||
|
||||
use Metaregistrar\RDAP\Data\RdapConformance;
|
||||
use Metaregistrar\RDAP\Data\RdapEntity;
|
||||
use Metaregistrar\RDAP\Data\RdapEvent;
|
||||
use Metaregistrar\RDAP\Data\RdapLink;
|
||||
use Metaregistrar\RDAP\Data\RdapNameserver;
|
||||
use Metaregistrar\RDAP\Data\RdapNotice;
|
||||
use Metaregistrar\RDAP\Data\RdapObject;
|
||||
use Metaregistrar\RDAP\Data\RdapRemark;
|
||||
use Metaregistrar\RDAP\Data\RdapSecureDNS;
|
||||
use Metaregistrar\RDAP\Data\RdapStatus;
|
||||
use Metaregistrar\RDAP\RdapException;
|
||||
|
||||
class RdapResponse {
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $objectClassName;
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $ldhName ;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $handle = '';
|
||||
/*
|
||||
* @var string
|
||||
*/
|
||||
private $name = '';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $type = '';
|
||||
/**
|
||||
* @var null|RdapConformance[]
|
||||
*/
|
||||
private $rdapConformance;
|
||||
/**
|
||||
* @var null|RdapEntity[]
|
||||
*/
|
||||
private $entities;
|
||||
/**
|
||||
* @var null|RdapLink[]
|
||||
*/
|
||||
private $links;
|
||||
/**
|
||||
* @var null|RdapRemark[]
|
||||
*/
|
||||
private $remarks;
|
||||
/**
|
||||
* @var null|RdapNotice[]
|
||||
*/
|
||||
private $notices;
|
||||
/**
|
||||
* @var null|RdapEvent[]
|
||||
*/
|
||||
private $events;
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
private $port43;
|
||||
/**
|
||||
* @var null|RdapNameserver[]
|
||||
*/
|
||||
private $nameservers;
|
||||
/**
|
||||
* @var null|RdapStatus[]
|
||||
*/
|
||||
private $status;
|
||||
/**
|
||||
* @var null|RdapSecureDNS[]
|
||||
*/
|
||||
private $secureDNS;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $errorCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* RdapResponse constructor.
|
||||
*
|
||||
* @param string $json
|
||||
*
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function __construct(string $json) {
|
||||
if ($data = json_decode($json, true)) {
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
// $value is an array
|
||||
foreach ($value as $k => $v) {
|
||||
$this->{$key}[] = RdapObject::KeyToObject($key, $v);
|
||||
}
|
||||
} else {
|
||||
// $value is not an array, just create a var with this value (startAddress endAddress ipVersion etc etc)
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RdapException('Response object could not be validated as proper JSON');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
final public function getHandle(): string {
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapConformance[]|null
|
||||
*/
|
||||
final public function getConformance(): ?array {
|
||||
return $this->rdapConformance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
final public function getName(): string {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
final public function getType(): string {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapEntity[]|null
|
||||
*/
|
||||
final public function getEntities(): ?array {
|
||||
return $this->entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapLink[]|null
|
||||
*/
|
||||
final public function getLinks(): ?array {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapRemark[]|null
|
||||
*/
|
||||
final public function getRemarks(): ?array {
|
||||
return $this->remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapNotice[]|null
|
||||
*/
|
||||
final public function getNotices(): ?array {
|
||||
return $this->notices;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
final public function getPort43(): ?string {
|
||||
return $this->port43;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapNameserver[]|null
|
||||
*/
|
||||
final public function getNameservers(): ?array {
|
||||
return $this->nameservers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapStatus[]|null
|
||||
*/
|
||||
final public function getStatus(): ?array {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapEvent[]|null
|
||||
*/
|
||||
final public function getEvents(): ?array {
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
final public function getClassname(): ?string {
|
||||
return $this->objectClassName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
final public function getLDHName(): ?string {
|
||||
return $this->ldhName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RdapSecureDNS[]|null
|
||||
*/
|
||||
final public function getSecureDNS(): ?array {
|
||||
return $this->secureDNS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
final public function getErrorCode(): ?int {
|
||||
return $this->errorCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
final public function getTitle(): ?string {
|
||||
return $this->title;
|
||||
}
|
||||
}
|
||||
129
RDAP/test/RdapTest.php
Normal file
129
RDAP/test/RdapTest.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace Metaregistrar\RDAP;
|
||||
|
||||
use Metaregistrar\RDAP\Data\RdapEntity;
|
||||
use Metaregistrar\RDAP\Data\RdapNameserver;
|
||||
use Metaregistrar\RDAP\Data\RdapNotice;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class RdapTest extends TestCase {
|
||||
/**
|
||||
* just to test
|
||||
*/
|
||||
public function testCase(): void {
|
||||
$this->assertFalse(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testEmptySearch(): void {
|
||||
$rdap = new Rdap(Rdap::IPV4);
|
||||
|
||||
$this->expectException(RdapException::class);
|
||||
$rdap->search('');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testNoConstructorParamter(): void {
|
||||
$this->expectException(RdapException::class);
|
||||
new Rdap('');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testDomainSearch(): void {
|
||||
$rdap = new Rdap(Rdap::DOMAIN);
|
||||
|
||||
$response = $rdap->search('udag.com');
|
||||
|
||||
$this->assertNotNull($response);
|
||||
|
||||
$nameserver = $response->getNameservers();
|
||||
$this->assertIsArray($nameserver);
|
||||
|
||||
$this->assertInstanceOf(RdapNameserver::class, $nameserver[0]);
|
||||
foreach ($response->getEntities() as $entity) {
|
||||
$this->assertInstanceOf(RdapEntity::class, $entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testNonExistantSearch(): void {
|
||||
$rdap = new Rdap(Rdap::DOMAIN);
|
||||
|
||||
$response = $rdap->search('mrfglsadfgasdf.rocks');
|
||||
|
||||
$this->assertNotNull($response);
|
||||
|
||||
$this->assertEquals(404, $response->getErrorCode());
|
||||
$this->assertEquals('Object not found', $response->getTitle());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testSiteSearch(): void {
|
||||
$rdap = new Rdap(Rdap::DOMAIN);
|
||||
|
||||
$response = $rdap->search('adac.site');
|
||||
|
||||
$this->assertNotNull($response);
|
||||
|
||||
$secureDNS = $response->getSecureDNS();
|
||||
$this->assertIsArray($secureDNS);
|
||||
|
||||
$tags = [];
|
||||
foreach ($secureDNS as $dns) {
|
||||
$tags[] = $dns->getKeyTag();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testInvalidDomainSearch(): void {
|
||||
$rdap = new Rdap(Rdap::DOMAIN);
|
||||
|
||||
$invalidDomainName = 'notADomainName';
|
||||
|
||||
$this->expectException(RdapException::class);
|
||||
$this->expectExceptionMessage("Invalid domain name '$invalidDomainName'.");
|
||||
|
||||
$rdap->search($invalidDomainName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Metaregistrar\RDAP\RdapException
|
||||
*/
|
||||
public function testIpv4Search(): void {
|
||||
$rdap = new Rdap(Rdap::IPV4);
|
||||
|
||||
$result = $rdap->search('8.8.4.4');
|
||||
|
||||
$this->assertNotNull($result);
|
||||
|
||||
$notices = $result->getNotices();
|
||||
$this->assertIsArray($notices);
|
||||
|
||||
$this->assertInstanceOf(RdapNotice::class, $notices[0]);
|
||||
foreach ($result->getEntities() as $entity) {
|
||||
$this->assertInstanceOf(RdapEntity::class, $entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
RDAP/test/phpunit.xml
Normal file
18
RDAP/test/phpunit.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<phpunit
|
||||
bootstrap="Bootstrap.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="RdapTest">
|
||||
<directory>./</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="false">
|
||||
<directory suffix=".php">../</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
130
RDAP/testrdap.php
Normal file
130
RDAP/testrdap.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
|
||||
include './src/Rdap.php'; //fie
|
||||
include './src/RdapException.php';//fie
|
||||
|
||||
use Metaregistrar\RDAP\Rdap; //fie
|
||||
use Metaregistrar\RDAP\RdapException;
|
||||
|
||||
|
||||
//$search = 59980;
|
||||
//$protocol = Metaregistrar\RDAP\rdap::ASN;
|
||||
|
||||
|
||||
//$search = '6939';
|
||||
//$protocol = Metaregistrar\RDAP\rdap::ASN;
|
||||
|
||||
//$search = '81.4.97.200';
|
||||
//$search = '82.135.96.210';
|
||||
//$search = '8.8.4.4';
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::IPV4;
|
||||
|
||||
// die IPv6 cidr/Bereiche m<>ssen genau einem Element in https://data.iana.org/rdap/ipv6.json entsprechen!
|
||||
$search = '2001:400::/23';//OK
|
||||
//$search = '2001:470::/48'; //Nicht OK
|
||||
//$search = '2001:470:ffff:ffff:ffff:ffff:ffff:ffff'; //Nicht OK
|
||||
//$search = '2001:470::/23'; //Nicht OK
|
||||
$protocol = Metaregistrar\RDAP\Rdap::IPV6;
|
||||
|
||||
//domain info des eigenen html-servers
|
||||
//$search = $_SERVER['SERVER_NAME'];//Host
|
||||
//$ServerArray = explode('.', $search);//Host splitten
|
||||
//$search = $ServerArray[count($ServerArray)-2] . '.' . $ServerArray[count($ServerArray)-1]; //Domain aus den beiden h<>chen Array Elementen Zusammen bauen
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::DOMAIN;
|
||||
|
||||
//$search = 'RIPE-NCC-END-MNT';//Fehler <20>ng<6E>ltiger Parameter
|
||||
//$search = 'farb.klecks.net'; //nicht gefunden
|
||||
//$search = 'klecks.net';
|
||||
//$search = 'pgmr2.com';
|
||||
//$protocol = Metaregistrar\RDAP\Rdap::DOMAIN;
|
||||
|
||||
|
||||
try {
|
||||
$rdap = new Metaregistrar\RDAP\Rdap($protocol);
|
||||
$test = $rdap->search($search);
|
||||
|
||||
if ($test && $test->getErrorCode() === null) {
|
||||
//var_dump ($test);
|
||||
echo nl2br('class name: ' . $test->getClassname() . PHP_EOL);
|
||||
echo nl2br('handle: ' . $test->getHandle() . PHP_EOL);
|
||||
echo nl2br('LDH (letters, digits, hyphens) name: ' . $test->getLDHName() . PHP_EOL);
|
||||
|
||||
if($test->getClassname() === 'ip network') { //fie
|
||||
echo nl2br("name: ".$test->getName().PHP_EOL);
|
||||
echo nl2br("type: ".$test->getType().PHP_EOL);
|
||||
} //fie
|
||||
echo nl2br("port 43 service: ".$test->getPort43().PHP_EOL);
|
||||
|
||||
if (is_array($test->getNameservers())) {
|
||||
echo nl2br("\nNameservers:\n");
|
||||
foreach ($test->getNameservers() as $nameserver) {
|
||||
$nameserver->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getSecureDNS())) {
|
||||
echo nl2br("DNSSEC:\n");
|
||||
foreach ($test->getSecureDNS() as $dnssec) {
|
||||
$dnssec->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
echo nl2br("rdap conformance: \n");
|
||||
foreach ($test->getConformance() as $conformance) {
|
||||
$conformance->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
if (is_array($test->getEntities())) {
|
||||
echo nl2br("Entities found:\n");
|
||||
foreach ($test->getEntities() as $entity) {
|
||||
$entity->dumpContents();
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
}
|
||||
if (is_array($test->getLinks())) {
|
||||
echo nl2br("Links:\n");
|
||||
foreach ($test->getLinks() as $link) {
|
||||
$link->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getNotices())) {
|
||||
echo nl2br("Notices:\n");
|
||||
foreach ($test->getNotices() as $notice) {
|
||||
$notice->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getRemarks())) {
|
||||
echo nl2br("Remarks:\n");
|
||||
foreach ($test->getRemarks() as $remark) {
|
||||
$remark->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
if (is_array($test->getStatus())) {
|
||||
echo nl2br("Statuses:\n");
|
||||
foreach ($test->getStatus() as $status) {
|
||||
$status->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
|
||||
if (is_array($test->getEvents())) {
|
||||
echo nl2br("Events:\n");
|
||||
foreach ($test->getEvents() as $event) {
|
||||
$event->dumpContents();
|
||||
}
|
||||
echo nl2br(PHP_EOL);
|
||||
}
|
||||
} else {
|
||||
$title = '';
|
||||
if ($test) {
|
||||
$title = $test->getTitle();
|
||||
}
|
||||
echo nl2br("$search was not found on any RDAP service. $title\n");
|
||||
}
|
||||
} catch (RdapException $e) {
|
||||
echo nl2br('ERROR: ' . $e->getMessage() . PHP_EOL);
|
||||
}
|
||||
Reference in New Issue
Block a user