One PHP file, no dependency, compatible back to PHP 5.6 so it runs on the old installations your buyers still have. Four methods are all you need.
| new Licence($cle, $dossierCache) | Build it with the buyer’s key and a writable directory for the cache. |
| $licence->valide() | True when the product may run on this domain. |
| $licence->essai() | True on a development key or a staging domain. Show a discreet notice — never ship a build that hides it. |
| $licence->message() | A sentence to show the buyer, already translated, naming the domains and dating the event. |
| $licence->banniere() | A small fixed notice to echo on an unlicensed copy. Empty string when the licence is valid, and also on a network failure. |
Never let a network problem take down your buyer’s shop. The library already handles this and you should not work around it: a fresh verdict is reused for 24 hours; when our server does not answer, the last known verdict is kept for 30 days and the product keeps working; only a signed refusal stops it, immediately. If our server had a bad night, nobody’s shop goes dark. If a key is transferred, the old site stops within 24 hours.
A licence binds to the registrable domain. One key on example.com covers www.example.com, shop.example.com and any other subdomain — your buyer will not write to you because of a missing redirect. Test and staging addresses never use up a licence: localhost, .local, .test, and the usual dev., staging., preprod. prefixes all work without consuming anything.
Write to us from your author area. A question that needed asking usually means this page is missing a paragraph.