|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
Description: ------------ On Gentoo, when you install pecl-geoip, it pulls in the geoip library as a dependency. However, the geoip library doesn't install any databases for you -- you're supposed to run a script (like in a cron job) to download the latest databases. This presents a problem when you're installing pecl-geoip, because the databases won't be there immediately. Thus the first test tests/001.phpt can fail. To make the tests pass predictably, we can disable that test entirely. But a better solution would be to skip that test if the database file doesn't exist. This can be accomplished with the following change to 001.phpt: -<?php if (!extension_loaded("geoip")) print "skip"; ?> +<?php +if (!extension_loaded("geoip")) print "skip"; +if (!file_exists(geoip_db_filename(GEOIP_COUNTRY_EDITION))) print "skip"; +?>