Skip to content

Instantly share code, notes, and snippets.

@hirbod
Created July 10, 2012 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hirbod/af5cbe349ef6aee81dd6 to your computer and use it in GitHub Desktop.
Save hirbod/af5cbe349ef6aee81dd6 to your computer and use it in GitHub Desktop.
Prüft Funktionen auf dem Server, die für den Medienpool wichtig sind und gibt Lösungsvorschläge
<?php
// Kleiner Check, ob gewisse PHP-Funktionen zur Verfügung stehen, ansonsten kann es mit dem Medienpool und dem Uploader zu Fehlern kommen.
// Schlagen beiden Checks fehl (ROTE MELDUNG), muss der Serveradmin ran. Ist mindestens eine der Funktionen korrekt, sollte der Medienpool funktionieren.
// Sollte es trotzdem Probleme mit Video-Uploads geben, muss folgendes ans ENDE DER HTACCESS DATEI:
/*
AddType video/ogg .ogm
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/webm .webm
AddType audio/webm .weba
AddType video/mp4 .mp4
AddType video/x-m4v .m4v
Dadurch wird das Problem definitiv behoben.
*/
$errors_on_check = 0;
$out = "<h1>Redaxo Mediapool Mime-Check</h1>";
if(function_exists('mime_content_type')){
$out .= 'mime_content_type() existiert<br />';
} else {
$out .= 'mime_content_type() fehlt<br />';
$errors_on_check++;
}
if(function_exists('finfo_open')){
$out .= 'finfo_open() existiert<br />';
} else {
$out .= 'finfo_open() fehlt<br />';
$errors_on_check++;
}
if($errors_on_check > 1){
$out .= '<br /><br />';
$out .= '<strong style="color: red;">Die Medienpool-Funktionen von Redaxo funktionieren auf diesem Server nicht einwandfrei.<br />
Bitte kontaktieren Sie Ihren Serveradmin, damit einer der oben genannten Funktionen installiert wird. finfo_open() existiert erst ab PHP 5.3.0</strong>';
} else {
$out .= '<br /><br /><strong style="color: green;">Mindestens eine der oben genannten Funktionen existiert. Der Medienpool sollte Ordnungsgemäß funktionieren.</strong>';
}
?>
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>REDAXO MEDIENPOOL CHECK</title>
<style type="text/css">
body {
width: 500px;
font-family: Arial;
font-size: 14px;
margin: 0 auto;
position: relative;
}
</style>
</head>
<body>
<?php echo $out; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment