Please check your GitHub repository and branch settings. Make sure the repository exists and is accessible.');
return;
}
if( ! file_put_contents(RSS_LOCAL_PATH, $rssContent))
{
print_failure('Unable to save update information to: ' . RSS_LOCAL_PATH . '
Please check file permissions.');
return;
}
}
else
{
print_failure('Module directory is not writable: ' . MODULE_PATH);
return;
}
if( file_exists(RSS_LOCAL_PATH) )
{
try {
$rssContent = file_get_contents(RSS_LOCAL_PATH);
if ($rssContent === false || empty($rssContent)) {
print_failure('Unable to read update information from: ' . RSS_LOCAL_PATH);
return;
}
$feedXml = new SimpleXMLElement($rssContent, LIBXML_NOCDATA);
if (!isset($feedXml->entry[0]->link['href'])) {
print_failure('Invalid repository feed format. Please check your GitHub repository and branch settings.');
return;
}
$seed = basename((string) $feedXml->entry[0]->link['href']);
unlink(RSS_LOCAL_PATH);
} catch (Exception $e) {
print_failure('Unable to parse update information: ' . $e->getMessage() . '
Please check your GitHub repository and branch settings.');
return;
}
}
else
{
print_failure('Unable to read : ' . RSS_LOCAL_PATH);
return;
}
if(isset($seed))
{
/// Checking for changes in the main update files:
$main_update_files = array(
'includes/functions.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/includes/functions.php',
'includes/helpers.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/includes/helpers.php',
'modules/update/update.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/update.php',
'modules/update/updating.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/updating.php',
'modules/update/unzip.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/unzip.php'
);
$refresh = False;
foreach($main_update_files as $local_path => $remote_url)
{
$result = check_file($local_path, $remote_url);
if ($result === 'nochange')
{
continue;
}
elseif($result)
{
$refresh = True;
}
else
{
return;
}
}
if($refresh)
{
header("Refresh:0");
return;
}
echo "