protected function get_local_info($repo, $file)
{
$response = null;
if (isset($_POST['ghu_refresh_cache'])) {
return $response;
}
if (is_dir($repo->local_path)) {
if (file_exists($repo->local_path . $file)) {
$response = file_get_contents($repo->local_path . $file);
}
} elseif (is_dir($repo->local_path_extended)) {
if (file_exists($repo->local_path_extended . $file)) {
$response = file_get_contents($repo->local_path_extended . $file);
}
}
switch ($repo->type) {
case 'github_plugin':
case 'github_theme':
$response = base64_encode($response);
break;
case 'bitbucket_plugin':
case 'bitbucket_theme':
break;
case 'gitlab_plugin':
case 'gitlab_theme':
$response = base64_encode($response);
break;
}
return $response;
}