Closed TWithers closed 4 months ago
@TWithers thanks for using the library. There's a reason why the $rules
property is private it is because from the POV of the library it is an implementation detail. The way the package parse and subsequently works with the Mozilla PSL is really internal. The algorithm can be changed or modified without impacted the public API. As such, the list stays the same but the way it is consumed and store can differ a lot.
What I can advise you to do is to look into https://github.com/usrflo/registered-domain-libs/tree/master which is the original library which has inspired the current one. There the "ancestor" of what is $rules
represents is available as an independent include php script. Maybe that will resolve your issue.
Hope the suggestion helps you resolve your issue.
I would like to be able to use the
Rules::$rules
object to do additional inspections on known domains. Right now, I am unable to access the$rules
property because it is private.What I am trying to accomplish is outside the scope of this project, but essentially it is doing some rough typo checking against domain suffixes.
For example:
yahoo.cou.uk
uk
is the resolved as the suffix, withcou
as the second level domain, andyahoo
as the subdomain. I would like to leverage the$rules
property to do additional checks for the known*.uk
suffixes and see if I can make a match (uk
has 10+ suffixes,cou.uk
is very similar toco.uk
, the domain should beyahoo.co.uk
)Right now, the Rules class is
final
,$rules
is private, andparse()
is private, so I am stuck copying/duplicating the code myself or hacking something together using the reflection api... both of which I don't really like.