1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-06 06:38:27 +02:00

Check which .mbtiles files are readable

In my setup some .mbtiles are links to an external hard drive - don't fail when the external drive is not connected. (Also this would allow to manage "publishing a map" via unix permission.)
This commit is contained in:
Fil
2014-06-20 12:24:09 +02:00
parent 8dec7469f1
commit 5d2662a6a3

View File

@@ -71,13 +71,13 @@ class Server {
$mjs = glob('*/metadata.json');
$mbts = glob('*.mbtiles');
if ($mjs) {
foreach ($mjs as $mj) {
foreach (array_filter($mjs, 'is_readable') as $mj) {
$layer = $this->metadataFromMetadataJson($mj);
array_push($this->fileLayer, $layer);
}
}
if ($mbts) {
foreach ($mbts as $mbt) {
foreach (array_filter($mbts, 'is_readable') as $mbt) {
$this->dbLayer[] = $this->metadataFromMbtiles($mbt);
}
}