Neue GitHub URL - manulle Korrektur erforderlich!

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!');
			}
		}
	}
?>

Scheint zu funktionieren. Nachdem ich die Änderungen gemacht habe hab ich ein Update für den ModulManager angezeigt bekommen und konnte es auch installieren.

Hallo mws
Mit welcher Variante von oben warst du erfolgreich?

Gesendet von meinem iPhone mit Tapatalk

Ich hab Variante 3 genommen wobei das Skript ja wirklich nur die Einträge in der .ini Datei ändert, also sollte Variante 2 auf jeden Fall auch funktionieren :slight_smile:

Moin,

also ich habe alle drei Varianten erfolglos probiert. Die ModuleManagerGui zeigt bei „verfügbare Version“ immer noch „-“ an:

Bildschirmfoto 2014-04-29 um 13.04.13.png

Ist es denn richtig, das man beim Aufruf der URL

https://raw.githubusercontent.com/brownson/IPSLibrary/Development/

über den Browser nur den Text „400: Invalid request“ bekommt?

Bei mir auch. Wird im Moment wohl wieder was umgebaut:confused:

Na das ist ja mal wirklich professionell!

Wo ist das Problem?
Die Dateien werden doch sauber ausgeliefert.
https://raw.githubusercontent.com/brownson/IPSLibrary/Development/IPSLibrary/config/KnownRepositories.ini

Lösung 3 mit dem Skript hat super funktioniert.
Perfekt.

Gruss
Björn

Das ist so vollkommen ok; das passt! Vorher waren die „-“ rot … nun blau.
Bei mir hat es auch auf Anhieb geklappt! IPSModuleManager bekam ein Update. Das ist für mich der Indikator, dass nun alles wieder rund läuft.
1000 Dank!!

Hallo, kurz zur Info:

Das Nachziehen / ide manuelle Korrektur hat bei mir erst / nur bei mit Möglichkeit 3 (Skriptausführung) funktioniert.

Dann hast Du vorher wat falsch gemacht, Weg 1 geht definitiv :eek: