Skip to content

Commit

Permalink
Merge pull request #7902 from kaltura/Naos-14.10.0-AN-156
Browse files Browse the repository at this point in the history
AN-156: add geo location reports
  • Loading branch information
NadavHarnik committed Dec 17, 2018
2 parents f6a3792 + 21b6868 commit 9a7dac5
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 88 deletions.
23 changes: 23 additions & 0 deletions alpha/apps/kaltura/lib/reports/kKavaBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,27 @@ public static function isPartnerAllowed($partnerId, $serviceType) {
}
return false;
}

public static function getCoordinatesKey($items)
{
$key = implode('_', $items);
return 'coord_' . preg_replace('/[^a-z0-9_]/', '_', strtolower($key));
}

protected static function parseCoordinates($coords)
{
return array_map('floatval', explode('/', $coords));
}

public static function getCoordinatesForKeys($keys)
{
$cache = kCacheManager::getSingleLayerCache(kCacheManager::CACHE_TYPE_GEO_COORDINATES);
if (!$cache)
{
return array();
}

return $cache->multiGet($keys);
}

}
Loading

0 comments on commit 9a7dac5

Please sign in to comment.