How hazaveh/verify-domain works
Project type and purpose
• This is a standalone PHP library/package (“hazaveh/verify-domain”) that exposes a simple API to verify domain ownership via three strategies: DNS TXT records, file‐based verification, and meta‐tag verification.
• It has almost zero runtime dependencies and is intended to be used in any PHP >5 application or injected via a DI container.
File structure
• src/Contracts/HandlerInterface.php – defines the contract for all verification handlers.
• src/Handler/LookupHandler.php – the real network‐capable implementation that performs HTTP or DNS lookups.
• src/Handler/MockLookupHandler.php – a stub for testing or offline use.
• src/VerifyDomain.php – the façade class that users instantiate or inject; it orchestrates the verification flows.
• tests/ – Pest/phpunit tests and HTML stub demonstrating sample data.
• CI and coding-style files (.github, .php-cs-fixer.php, phpunit.xml, composer.json).
README for additional insights
• Three public methods on VerifyDomain:
a. verifyByDNS(domain, expectedValue)
b. verifyByFile(domain, filename, expectedContent)
c. verifyByMeta(domain, metaName, expectedContent)
• Under the hood, all methods delegate to a HandlerInterface implementation (default LookupHandler).