mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-08 07:36:28 +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:
@@ -71,13 +71,13 @@ class Server {
|
|||||||
$mjs = glob('*/metadata.json');
|
$mjs = glob('*/metadata.json');
|
||||||
$mbts = glob('*.mbtiles');
|
$mbts = glob('*.mbtiles');
|
||||||
if ($mjs) {
|
if ($mjs) {
|
||||||
foreach ($mjs as $mj) {
|
foreach (array_filter($mjs, 'is_readable') as $mj) {
|
||||||
$layer = $this->metadataFromMetadataJson($mj);
|
$layer = $this->metadataFromMetadataJson($mj);
|
||||||
array_push($this->fileLayer, $layer);
|
array_push($this->fileLayer, $layer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($mbts) {
|
if ($mbts) {
|
||||||
foreach ($mbts as $mbt) {
|
foreach (array_filter($mbts, 'is_readable') as $mbt) {
|
||||||
$this->dbLayer[] = $this->metadataFromMbtiles($mbt);
|
$this->dbLayer[] = $this->metadataFromMbtiles($mbt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user