protected function getDefaultMediaVersion()
{
// Initialise
$version = '0.0.0';
$date = '0000-00-00';
$secret = '';
// Get the version and date of the component from the manifest cache
try {
$db = $this->db;
$query = $db->getQuery(true)->select(array($db->qn('manifest_cache')))->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('name') . ' = ' . $db->q($this->componentName));
$db->setQuery($query);
$json = $db->loadResult();
$params = new \JRegistry($json);
$version = $params->get('version', $version);
$date = $params->get('creationDate', $date);
} catch (\Exception $e) {
}
// Get the site's secret
try {
$app = \JFactory::getApplication();
if (method_exists($app, 'get')) {
$secret = $app->get('secret');
}
} catch (\Exception $e) {
}
// Generate the version string
return md5($version . $date . $secret);
}