/**
* Returns the URL of the Google chart image that has been downloaded and stored locally. If it has not been downloaded yet, it will be download.
* @param string $chartUrl
* @return string
*/
protected function _getLocalImageUrl($chartUrl)
{
$savePath = realpath(APPLICATION_PATH . '/../public/Resources/google-charts/');
$hashedChartUrl = md5($chartUrl);
$localPath = "$savePath/$hashedChartUrl";
if (!file_exists($localPath)) {
exec("wget -O \"$localPath\" \"$chartUrl\"");
}
return "/Resources/google-charts/$hashedChartUrl";
}