Skip to content

Instantly share code, notes, and snippets.

@dergel
Last active January 22, 2018 12:19
Show Gist options
  • Save dergel/7eb2da9c0474fb2f3ee4 to your computer and use it in GitHub Desktop.
Save dergel/7eb2da9c0474fb2f3ee4 to your computer and use it in GitHub Desktop.
REDAXO Installer Datei
<?php
// info echo "REDAXO wurde bereits installiert"; exit;
error_reporting(E_ALL);
ini_set("display_errors",1);
$current_version_path = file_get_contents("http://www.redaxo.org/de/_system/_version/5/");
$install_path = './';
$install_file = $install_path.'redaxo.zip';
$loader_file = $install_path.'load_redaxo.php';
echo '<pre>Folgende aktuelle Datei wurde gefunden: '.$current_version_path.'</pre>';
$redaxo_core = file_get_contents($current_version_path);
file_put_contents($install_file, $redaxo_core);
echo '<pre>redaxo.zip wurde erstellt und wird nun entpackt</pre>';
$zip = new ZipArchive;
$res = $zip->open($install_file);
if ($res === TRUE) {
$zip->extractTo($install_path);
$zip->close();
echo '<pre>REDAXO wurde erfolgreich entpackt</pre>';
$loader = file_get_contents($loader_file);
$loader = str_replace("\n".'// info','',$loader);
file_put_contents($loader_file, $loader);
unlink($install_file);
} else {
echo 'Beim Entpacken ist ein Fehler aufgetreten';
}
@tbaddade
Copy link

tbaddade commented Sep 29, 2016

Wäre gut, wenn auf cURL umgebaut wird. Wenn allow_url_fopen=0 funktioniert es nicht mehr.

@skerbis
Copy link

skerbis commented Jan 26, 2017

Gibt es eine URL hinter der sich immer die aktuelle Version verbirgt?

@skerbis
Copy link

skerbis commented Jan 26, 2017

CURL-Variante bei sonst (fast) gleichem Code

<?php 

error_reporting(E_ALL);
ini_set("display_errors",1);

// check if folder redaxo exists
$folder = "./redaxo";
if(is_dir($folder))
  {
echo '<pre>Es existiert schon ein Ordner /redaxo 
Bitte pr&uuml;fen.
<pre>';
	exit();
  }


function curl_file_get_contents($url) {
    $curly = curl_init();

    curl_setopt($curly, CURLOPT_HEADER, 0);
    curl_setopt($curly, CURLOPT_RETURNTRANSFER, 1); //Return Data
    curl_setopt($curly, CURLOPT_URL, $url);

    $content = curl_exec($curly);
    curl_close($curly);

    return $content;
}
$current_version_path = curl_file_get_contents("http://www.redaxo.org/de/_system/_version/5/");
$install_path = './';
$install_file = $install_path.'redaxo.zip';
$loader_file = $install_path.'load_redaxo.php';

echo '<pre>Folgende aktuelle Datei wurde gefunden: '.$current_version_path.'</pre>';

$redaxo_core = curl_file_get_contents($current_version_path);
file_put_contents($install_file, $redaxo_core);

echo '<pre>redaxo.zip wurde erstellt und wird nun entpackt</pre>';

$zip = new ZipArchive;
$res = $zip->open($install_file);
if ($res === TRUE) {
  $zip->extractTo($install_path);
  $zip->close();

  echo '<pre>REDAXO wurde erfolgreich entpackt</pre>';
  $loader = file_get_contents($loader_file);
  $loader = str_replace("\n".'// info','',$loader);
  file_put_contents($loader_file, $loader);
  unlink($install_file);
  
} else {
  echo 'Beim Entpacken ist ein Fehler aufgetreten';

}





@skerbis
Copy link

skerbis commented Jan 22, 2018

Die neuste Version liegt hier vor: https://github.com/FriendsOfREDAXO/tricks/blob/master/install_redaxo_loader.md
Es holt sich das aktuelle Release aus GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment