Closed leem32 closed 4 years ago
@leem32 thanks for using the library.
Where can I find the updated pdp cache file and how do I know it's being used by php-domain-parser?
The default location is in your vendor
directory inside the package data
directory. This is where the cache is set by default. and this is where it is updated unless you changed your configuration and which case it depends how you've setup it up.
Also does the 1 DAY in $manager = new Manager(new Cache(), new CurlHttpClient(), '1 DAY'); ensure the PSL is only cached for 1 day?
Indeed it is not documented in the README (you can submit a PR for that) but it is documented in the CHANGELOG . This parameter was added in version 5.4.0 to improve PSR-16 compatibility. And yes this is a TTL on the data cache before it is refreshed unless you do it yourself before the end of the TTL.
Thanks :)
I think the easiest way to keep the PSL
updated is with a cronjob.
27 5 * * * cd /var/www/html && ./update-psl > /dev/null 2>&1
a cronjob and another cache system not related to your production server filesystem using the PSR-16 compatible contract
When I run
./update-psl
from webroot it returns:(I changed line 21 from
require dirname(__DIR__).'/vendor/autoload.php'; to require '/var/www/html/src/vendor/autoload.php';)
because I was gettingNo such file or directory
errors.But I can't find the cache file. If I run
./update-psl -h
it shows:But the default dir ( /var/www/html/data) does not exist.
Where can I find the updated pdp cache file and how do I know it's being used by php-domain-parser?
Here's how I'm running php-domain-parser:
Also does the
1 DAY
in$manager = new Manager(new Cache(), new CurlHttpClient(), '1 DAY');
ensure the PSL is only cached for 1 day? I couldn't find anything on this in the docs, but found an example in an issue.