Hallo IPSLibrary User,
GitHub hat die URL für den Zugriff auf die RAW Files geändert. Das erfordert leider einen manuellen Eingriff, da durch die neue URL die Änderungen nicht mehr automatisch ausgerollt werden können.
Folgende Möglichkeiten stehen zur Verfügung:
[ol]
[li]Manuelles Update der URLs im File KnownRepositories.ini (zu finden unter /scripts/IPSLibrary/config/)
[/li]
Repository[]=https://raw.githubusercontent.com/brownson/IPSLibrary/Development/
Repository[]=https://raw.githubusercontent.com/mcs-51/IPSLibrary/Development/
Repository[]=https://raw.githubusercontent.com/1007/IPS1007Library/master/
[li]Ausführen des kompletten BaseLoader Scriptes
[/li][li]Ausführen des des folgenden Scriptes
[/li][/ol]
<?
$remoteRepository = 'https://raw.githubusercontent.com/brownson/IPSLibrary/Development/';
if (isset($repository)) {
$remoteRepository = $repository;
}
$localRepository = IPS_GetKernelDir().'scripts\\';
$fileList = array(
'IPSLibrary\\config\\KnownRepositories.ini',
);
// Download Files
foreach ($fileList as $file) {
LoadFile($remoteRepository.$file, $localRepository.$file);
}
// -------------------------------------------------------------------------------
function LoadFile($sourceFile, $destinationFile) {
if (strpos($sourceFile, 'https')===0) {
$sourceFile = str_replace('\\','/',$sourceFile);
echo 'Load File '.$sourceFile."
";
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,$sourceFile);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,10);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl_handle, CURLOPT_FAILONERROR, true);
$fileContent = curl_exec($curl_handle);
if ($fileContent===false) {
throw new Exception('Download of File '.$sourceFile.' failed !!!');
}
//echo 'Loaded '.str_replace(chr(13),'',str_replace(chr(10),'',substr($fileContent,1,200))).'...'.PHP_EOL;
curl_close($curl_handle);
//$fileContent = html_entity_decode($fileContent, ENT_COMPAT, 'UTF-8');
} else {
$fileContent = file_get_contents($sourceFile);
}
$destinationFile = str_replace('/','\\',$destinationFile);
$destinationFilePath = pathinfo($destinationFile, PATHINFO_DIRNAME);
if (!file_exists($destinationFilePath)) {
if (!mkdir($destinationFilePath, 0, true)) {
throw new Exception('Create Directory '.$destinationFilePath.' failed!');
}
}
$destinationFile = str_replace('\\InitializationFiles\\Default\\','\\InitializationFiles\\',$destinationFile);
if (!file_put_contents($destinationFile, $fileContent)) {
sleep(1);
echo 'Create File '.$destinationFile.' failed --> Retry ...';
if (!file_put_contents($destinationFile, $fileContent)) {
throw new Exception('Create File '.$destinationFile.' failed!');
}
}
}
?>