136 Zeilen
Kein EOL
5,2 KiB
PHP
136 Zeilen
Kein EOL
5,2 KiB
PHP
<?php
|
||
//error_reporting(E_ALL);
|
||
error_reporting(E_ERROR);
|
||
|
||
//Konstanten
|
||
if (!defined('MSD_VERSION')) define('MSD_VERSION', '1.20');
|
||
if (!defined('MSD_VERSION_ADD')) define('MSD_VERSION_ADD', '\'TNG\'');
|
||
|
||
|
||
if (!defined('MSD_OS')) define('MSD_OS', PHP_OS);
|
||
if (!defined('MSD_OS_EXT')) define('MSD_OS_EXT', php_uname());
|
||
if (!defined('MSD_IS_WINDOWS')) {
|
||
if (stristr(PHP_OS, 'win')) {
|
||
define('MSD_IS_WINDOWS', 1);
|
||
} else {
|
||
define('MSD_IS_WINDOWS', 0);
|
||
}
|
||
}
|
||
if (!defined('MSD_USER_OS')) {
|
||
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
|
||
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
|
||
} else if (!isset($HTTP_USER_AGENT)) {
|
||
$HTTP_USER_AGENT = '';
|
||
}
|
||
|
||
// 1. Platform
|
||
if (strstr($HTTP_USER_AGENT, 'Win')) {
|
||
define('MSD_USER_OS', 'Win');
|
||
} else if (strstr($HTTP_USER_AGENT, 'Mac')) {
|
||
define('MSD_USER_OS', 'Mac');
|
||
} else if (strstr($HTTP_USER_AGENT, 'Linux')) {
|
||
define('MSD_USER_OS', 'Linux');
|
||
} else if (strstr($HTTP_USER_AGENT, 'Unix')) {
|
||
define('MSD_USER_OS', 'Unix');
|
||
} else if (strstr($HTTP_USER_AGENT, 'OS/2')) {
|
||
define('MSD_USER_OS', 'OS/2');
|
||
} else {
|
||
define('MSD_USER_OS', 'Other');
|
||
}
|
||
|
||
// 2. browser and version
|
||
// (must check everything else before Mozilla)
|
||
|
||
if (preg_match('@Opera(/| )([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[2]);
|
||
define('MSD_BROWSER_AGENT', 'OPERA');
|
||
$BrowserIcon="images/opera.png";
|
||
} else if (preg_match('@MSIE ([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[1]);
|
||
define('MSD_BROWSER_AGENT', 'IE');
|
||
$BrowserIcon="images/msie.png";
|
||
} else if (preg_match('@OmniWeb/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[1]);
|
||
define('MSD_BROWSER_AGENT', 'OMNIWEB');
|
||
$BrowserIcon="images/omniweb.png";
|
||
} else if (preg_match('@(Konqueror/)(.*)(;)@', $HTTP_USER_AGENT, $log_version)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[2]);
|
||
define('MSD_BROWSER_AGENT', 'KONQUEROR');
|
||
$BrowserIcon="images/konqueror.png";
|
||
} else if (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)
|
||
&& preg_match('@Safari/([0-9]*)@', $HTTP_USER_AGENT, $log_version2)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[1] . '.' . $log_version2[1]);
|
||
define('MSD_BROWSER_AGENT', 'SAFARI');
|
||
$BrowserIcon="images/safari.png";
|
||
} else if (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) {
|
||
define('MSD_BROWSER_VERSION', $log_version[1]);
|
||
define('MSD_BROWSER_AGENT', 'MOZILLA');
|
||
$BrowserIcon="images/mozilla.png";
|
||
} else {
|
||
define('MSD_BROWSER_VERSION', 0);
|
||
define('MSD_BROWSER_AGENT', 'OTHER');
|
||
$BrowserIcon="images/blanc.gif";
|
||
}
|
||
}
|
||
|
||
//feste Variabeln
|
||
$config["lock_tables"]=0;
|
||
|
||
//Pfade und Files
|
||
$config["paths"]["root"]=Realpfad("./");
|
||
$config["paths"]["work"]="work/";
|
||
$config["paths"]["backup"]=$config["paths"]["work"]."backup/";
|
||
$config["paths"]["structure"]=$config["paths"]["work"]."structure/";
|
||
$config["paths"]["log"]=$config["paths"]["work"]."log/";
|
||
$config["paths"]["config"]=$config["paths"]["work"]."config/";
|
||
$config["paths"]["perlexec"]="msd_cron/";
|
||
$config["cron_configurationfile"]="mysqldumper.conf";
|
||
$config["files"]["log"]=$config["paths"]["log"]."mysqldump.log";
|
||
$config["files"]["perllog"]=$config["paths"]["log"]."mysqldump_perl.log";
|
||
$config["files"]["perllogcomplete"]=$config["paths"]["log"]."mysqldump_perl.complete.log";
|
||
$config["files"]["parameter"]=$config["paths"]["config"]."parameter.php";
|
||
|
||
//Ini-Parameter
|
||
$config["max_execution_time"]=ini_get("max_execution_time");
|
||
$config["safe_mode"]=ini_get('safe_mode');
|
||
$config["magic_quotes_gpc"]=ini_get('magic_quotes_gpc');
|
||
$config["disabled"]=ini_get("disable_functions");
|
||
$config["phpextensions"]=implode(" ",get_loaded_extensions());
|
||
$m=str_replace("M","",get_cfg_var("memory_limit"));
|
||
$config["ram"]=(empty($m)) ? 0 : $m;
|
||
|
||
//Ist zlib m<>glich?
|
||
$p1=explode(" ",$config["phpextensions"]);
|
||
$p2=explode(",",str_replace(" ","",$config["disabled"]));
|
||
//Buggy PHP-Version ?
|
||
$p3=explode(".",PHP_VERSION);
|
||
$buggy=($p3[0]==4 && $p3[1]==3 && $p3[2]<3);
|
||
$config["zlib"]=(!$buggy) && (in_array("zlib",$p1) && (!in_array("gzopen",$p2) || !in_array("gzwrite",$p2) || !in_array("gzgets",$p2) || !in_array("gzseek",$p2) || !in_array("gztell",$p2)));
|
||
//echo '<pre>'.print_r($p3,true).'</pre>';
|
||
//Tuning-Ecke
|
||
$config["tuning_add"]=1.1;
|
||
$config["tuning_sub"]=0.9;
|
||
$config["time_buffer"]=0.75; //max_zeit=$config["max_execution_time"]*$config["time_buffer"]
|
||
$config["perlspeed"]=10000; //Anzahl der Datens<6E>tze, die in einem Rutsch gelesen werden
|
||
|
||
|
||
//Bausteine
|
||
$meta=br().br().'<meta http-equiv="expires" content="3600"> '.br().'<META HTTP-EQUIV="Pragma" CONTENT="no-cache">'.br(2);
|
||
$preload_restore='<script language="JavaScript">Preload(2)</script>';
|
||
$preload_dump='<script language="JavaScript">Preload(1)</script>';
|
||
$config["homepage"]="http://www.mysqldumper.de/board/";
|
||
$languagepacks_ref="http://www.mysqldumper.de/board/viewforum.php?f=24";
|
||
$stylepacks_ref="http://www.mysqldumper.de/board/viewforum.php?f=25";
|
||
|
||
|
||
|
||
$nl="\n";
|
||
$mysql_commentstring="--";
|
||
|
||
//Initialisierungen
|
||
|
||
|
||
|
||
|
||
|
||
?>
|