Struggeling with relocating
Dieser Commit ist enthalten in:
Commit
89ea01c429
301 geänderte Dateien mit 59926 neuen und 0 gelöschten Zeilen
17
inc/sqlbrowser/general/footer.php
Normale Datei
17
inc/sqlbrowser/general/footer.php
Normale Datei
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @version SVN: $rev: 1205 $
|
||||
* @author $Author$
|
||||
* @lastmodified $Date$
|
||||
*/
|
||||
if (!defined('MSD_VERSION')) die('No direct access.');
|
||||
|
||||
$tplSqlbrowserGeneralFooter = new MSDTemplate();
|
||||
$tplSqlbrowserGeneralFooter->set_filenames(
|
||||
array(
|
||||
'tplSqlbrowserGeneralFooter' => 'tpl/sqlbrowser/general/footer.tpl')
|
||||
);
|
||||
65
inc/sqlbrowser/general/mysql_variables.php
Normale Datei
65
inc/sqlbrowser/general/mysql_variables.php
Normale Datei
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @version SVN: $rev: 1207 $
|
||||
* @author $Author$
|
||||
* @lastmodified $Date$
|
||||
*/
|
||||
|
||||
if (!defined('MSD_VERSION')) die('No direct access.');
|
||||
$selectedFilter = -1;
|
||||
if (isset($_POST['filter_selected'])) {
|
||||
$selectedFilter = $_POST['filter_selected'];
|
||||
}
|
||||
$vars = array();
|
||||
$res = $dbo->query('SHOW VARIABLES', MsdDbFactory::ARRAY_ASSOC);
|
||||
$numrows = @sizeof($res);
|
||||
foreach ($res as $row) {
|
||||
$vars[$row['Variable_name']] = $row['Value'];
|
||||
}
|
||||
|
||||
$filter = getPrefixArray($vars);
|
||||
$tplSqlbrowserGeneralMysqlVariables = new MSDTemplate();
|
||||
$tplSqlbrowserGeneralMysqlVariables->set_filenames(
|
||||
array(
|
||||
'tplSqlbrowserGeneralMysqlVariables' =>
|
||||
'tpl/sqlbrowser/general/mysqlVariables.tpl'
|
||||
)
|
||||
);
|
||||
$tplSqlbrowserGeneralMysqlVariables->assign_vars(
|
||||
array('SEL_FILTER' => Html::getOptionlist($filter, $selectedFilter))
|
||||
);
|
||||
|
||||
if (count($vars) == 0) {
|
||||
$tpl->assign_block_vars('NO_VALUES', array());
|
||||
} else {
|
||||
$i = 0;
|
||||
foreach ($vars as $name => $val) {
|
||||
if ($selectedFilter != '-1'
|
||||
&& substr($name, 0, strlen($selectedFilter)) != $selectedFilter) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_numeric($val)) {
|
||||
if (strpos($name, 'time') === false) {
|
||||
$val = String::formatNumber($val);
|
||||
} else {
|
||||
$val = getTimeFormat($val);
|
||||
}
|
||||
}
|
||||
|
||||
$tplSqlbrowserGeneralMysqlVariables->assign_block_vars(
|
||||
'ROW',
|
||||
array(
|
||||
'ROWCLASS' => $i % 2 ? 'dbrow' : 'dbrow1',
|
||||
'NR' => $i + 1,
|
||||
'VAR_NAME' => $name,
|
||||
'VAR_VALUE' => htmlspecialchars($val, ENT_COMPAT, 'UTF-8')
|
||||
)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
96
inc/sqlbrowser/general/process.php
Normale Datei
96
inc/sqlbrowser/general/process.php
Normale Datei
|
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @version SVN: $rev: 1207 $
|
||||
* @author $Author$
|
||||
* @lastmodified $Date$
|
||||
*/
|
||||
|
||||
if (!defined('MSD_VERSION')) die('No direct access.');
|
||||
$tplSqlbrowserGeneralProcess = new MSDTemplate();
|
||||
$tplSqlbrowserGeneralProcess->set_filenames(
|
||||
array('tplSqlbrowserGeneralProcess' => 'tpl/sqlbrowser/general/process.tpl')
|
||||
);
|
||||
|
||||
$killid = 0;
|
||||
if (isset($_GET['killid']) && $_GET['killid'] > 0) {
|
||||
$killid = (int) $_GET['killid'];
|
||||
if (isset($_POST['killid'])) intval($killid = $_POST['killid']);
|
||||
$wait = (isset($_POST['wait'])) ? $_POST['wait'] : 0;
|
||||
if ($wait == 0) {
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars(
|
||||
'KILL_STARTED', array('KILL_ID' => $killid)
|
||||
);
|
||||
$wait = $config['refresh_processlist'];
|
||||
try
|
||||
{
|
||||
$ret = $dbo->query('KILL ' . $_GET['killid'], MsdDbFactory::SIMPLE);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars(
|
||||
'KILL_ERROR',
|
||||
array('MESSAGE' => '('.$e->getCode().') '.$e->getMessage())
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars(
|
||||
'KILL_WAIT',
|
||||
array(
|
||||
'KILL_ID' => $killid,
|
||||
'WAIT_TIME' => $wait
|
||||
)
|
||||
);
|
||||
$wait += $config['refresh_processlist'];
|
||||
}
|
||||
}
|
||||
|
||||
$res = $dbo->query('SHOW FULL PROCESSLIST', MsdDbFactory::ARRAY_NUMERIC);
|
||||
$numrows = (int) @sizeof($res);
|
||||
if ($numrows == 0) {
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars('NO_PROCESS', array());
|
||||
} else {
|
||||
$processFound = false;
|
||||
foreach ($res as $row) {
|
||||
if ($row[0] == $killid) {
|
||||
$processFound = true;
|
||||
if ($row[4] == "Killed") $killid = 0;
|
||||
}
|
||||
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars(
|
||||
'ROW',
|
||||
array(
|
||||
'ROWCLASS' => $i % 2 ? 'dbrow' : 'dbrow1',
|
||||
'NR' => $i + 1,
|
||||
'ID' => $row[0],
|
||||
'USER' => $row[1],
|
||||
'HOST' => $row[2],
|
||||
'DB' => $row[3],
|
||||
'QUERY' => $row[4],
|
||||
'TIME' => $row[5],
|
||||
'STATE' => $row[6],
|
||||
'INFO' => $row[7]
|
||||
)
|
||||
);
|
||||
if ($killid == 0) {
|
||||
$tplSqlbrowserGeneralProcess->assign_block_vars(
|
||||
'ROW.KILL', array()
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!$processFound) {
|
||||
$killid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$tplSqlbrowserGeneralProcess->assign_vars(
|
||||
array(
|
||||
'REFRESHTIME' => $config['refresh_processlist'],
|
||||
'REFRESHTIME_MS' => $config['refresh_processlist'] * 1000,
|
||||
'ICON_DELETE' => $icon['kill_process'],
|
||||
'KILL_ID' => $killid
|
||||
)
|
||||
);
|
||||
122
inc/sqlbrowser/general/sqlbox.php
Normale Datei
122
inc/sqlbrowser/general/sqlbox.php
Normale Datei
|
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @version SVN: $rev: 1207 $
|
||||
* @author $Author$
|
||||
* @lastmodified $Date$
|
||||
*/
|
||||
|
||||
if (!defined('MSD_VERSION')) die('No direct access.');
|
||||
|
||||
include ('./inc/functions/functions_restore.php');
|
||||
$sql['sql_statements'] = '';
|
||||
$queries = array();
|
||||
|
||||
$db = (!isset($_GET['db'])) ? $config['db_actual'] : base64_decode($_GET['db']);
|
||||
if (isset($_GET['db'])) $config['db_actual'] = $db;
|
||||
$tablename = '';
|
||||
if (isset($_GET['tablename'])) {
|
||||
$tablename = base64_decode($_GET['tablename']);
|
||||
}
|
||||
if (isset($_POST['tablename'])) $tablename = base64_decode($_POST['tablename']);
|
||||
if (isset($_POST['sqltextarea'])) {
|
||||
$sql['sql_statements'] = $_POST['sqltextarea'];
|
||||
} else {
|
||||
if (isset($_SESSION['sql']['statements'])) {
|
||||
$sql['sql_statements'] = $_SESSION['sql']['statements'];
|
||||
}
|
||||
}
|
||||
$tdcompact = $config['interface_table_compact'];
|
||||
if (isset($_GET['tdc'])) {
|
||||
$tdcompact = $_GET['tdc'];
|
||||
}
|
||||
if (isset($_POST['tableselect']) && $_POST['tableselect'] != '1') {
|
||||
$tablename = $_POST['tableselect'];
|
||||
}
|
||||
$dbo->selectDb($db);
|
||||
|
||||
//Start SQL-Box
|
||||
$tplSqlbrowserSqlbox = new MSDTemplate();
|
||||
$tplSqlbrowserSqlbox->set_filenames(
|
||||
array('tplSqlbrowserSqlbox' => 'tpl/sqlbrowser/sqlbox/sqlbox.tpl')
|
||||
);
|
||||
|
||||
if (isset($_GET['readfile']) && $_GET['readfile'] == 1) {
|
||||
$tplSqlbrowserSqlbox->assign_block_vars(
|
||||
'SQLUPLOAD',
|
||||
array(
|
||||
'POSTTARGET' => $params,
|
||||
'LANG_OPENSQLFILE' => $lang['L_SQL_OPENFILE'],
|
||||
'LANG_OPENSQLFILE_BUTTON' => $lang['L_SQL_OPENFILE_BUTTON'],
|
||||
'LANG_SQL_MAXSIZE' => $lang['L_MAX_UPLOAD_SIZE'],
|
||||
'MAX_FILESIZE' => $config['upload_max_filesize']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($_POST['submit_openfile'])) {
|
||||
//open file
|
||||
if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) {
|
||||
$aus .= '<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span>';
|
||||
} else {
|
||||
$fn = $_FILES['upfile']['tmp_name'];
|
||||
if (strtolower(substr($_FILES['upfile']['name'], -3)) == ".gz") {
|
||||
$readUserSqlfile = gzfile($fn);
|
||||
} else {
|
||||
$readUserSqlfile = file($fn);
|
||||
}
|
||||
$sqlLoaded = implode("", $readUserSqlfile);
|
||||
}
|
||||
}
|
||||
|
||||
// Do we have SQL-Queries in User-SQLLib?
|
||||
$sqlcombo = getSqlLibraryComboBox();
|
||||
if ($sqlcombo > '') {
|
||||
$tplSqlbrowserSqlbox->assign_block_vars(
|
||||
'SQLCOMBO', array('SQL_COMBOBOX' => $sqlcombo)
|
||||
);
|
||||
}
|
||||
// create Table select box
|
||||
$tables = $dbo->getTables($db);
|
||||
$tableSelectBox = Html::getOptionlist($tables, false, $lang['L_TABLE'] . ' `%s`');
|
||||
|
||||
$tplSqlbrowserSqlbox->assign_vars(
|
||||
array(
|
||||
'LANG_SQL_WARNING' => $lang['L_SQL_WARNING'],
|
||||
'ICONPATH' => $config['files']['iconpath'],
|
||||
'ICON_PLUS' => $icon['plus'],
|
||||
'ICON_MINUS' => $icon['minus'],
|
||||
'MYSQL_REF' => 'http://dev.mysql.com/doc/',
|
||||
'BOXSIZE' => $config['interface_sqlboxsize'],
|
||||
'BOXCONTENT' => $sql['sql_statements'],
|
||||
'LANG_SQL_BEFEHLE' => $lang['L_SQL_COMMANDS'],
|
||||
'TABLE_COMBOBOX' => $tableSelectBox,
|
||||
'LANG_SQL_EXEC' => $lang['L_SQL_EXEC'],
|
||||
'LANG_RESET' => $lang['L_RESET'],
|
||||
'DB' => $db,
|
||||
'DB_ENCODED' => base64_encode($db),
|
||||
'ICON_SEARCH' => $icon['search'],
|
||||
'ICON_UPLOAD' => $icon['upload'],
|
||||
'ICON_ARROW_LEFT' => $icon['arrow_left'],
|
||||
'ICON_MYSQL_HELP' => $icon['mysql_help'],
|
||||
'ICON_CLOSE' => $icon['close'],
|
||||
'MYSQL_HELP' => $lang['L_TITLE_MYSQL_HELP'],
|
||||
'LANG_TOOLBOX' => $lang['L_TOOLS_TOOLBOX'],
|
||||
'LANG_TOOLS' => $lang['L_TOOLS'],
|
||||
'LANG_DB' => $lang['L_DB'],
|
||||
'LANG_TABLE' => $lang['L_TABLE'],
|
||||
'LANG_SQL_TABLEVIEW' => $lang['L_SQL_TABLEVIEW'],
|
||||
'LANG_BACK_TO_DB_OVERVIEW' => $lang['L_SQL_BACKDBOVERVIEW']
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($_POST['execsql']) || $action == 'general_sqlbox_show_results'
|
||||
|| $sql['sql_statements'] > '') {
|
||||
include ('./inc/sqlbrowser/sqlbox/show_results.php');
|
||||
}
|
||||
$_SESSION['db'] = $db;
|
||||
$_SESSION['tablename'] = $tablename;
|
||||
$_SESSION['sql']['statements'] = $sql['sql_statements'];
|
||||
72
inc/sqlbrowser/general/status.php
Normale Datei
72
inc/sqlbrowser/general/status.php
Normale Datei
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @version SVN: $rev: 1207 $
|
||||
* @author $Author$
|
||||
* @lastmodified $Date$
|
||||
*/
|
||||
|
||||
if (!defined('MSD_VERSION')) die('No direct access.');
|
||||
$selectedFilter = -1;
|
||||
if (isset($_POST['filter_selected'])) {
|
||||
$selectedFilter = $_POST['filter_selected'];
|
||||
}
|
||||
$res = $dbo->query('SHOW GLOBAL STATUS', MsdDbFactory::ARRAY_ASSOC);
|
||||
foreach ($res as $row) {
|
||||
$status[$row['Variable_name']] = $row['Value'];
|
||||
}
|
||||
|
||||
$filter = getPrefixArray($status);
|
||||
// values that will be formatted as times
|
||||
$timeValues = array('Uptime', 'Uptime_since_flush_status');
|
||||
|
||||
$tplSqlbrowserGeneralStatus = new MSDTemplate();
|
||||
$tplSqlbrowserGeneralStatus->set_filenames(
|
||||
array(
|
||||
'tplSqlbrowserGeneralStatus' => 'tpl/sqlbrowser/general/status.tpl'
|
||||
)
|
||||
);
|
||||
|
||||
if ($selectedFilter != '-1') {
|
||||
$query = 'SHOW GLOBAL STATUS LIKE \'' . $selectedFilter . '_%\'';
|
||||
$res = $dbo->query($query, MsdDbFactory::ARRAY_ASSOC);
|
||||
}
|
||||
if (@sizeof($res) == 0) {
|
||||
$tpl->assign_block_vars('NO_STATUS', array());
|
||||
} else {
|
||||
if (count($filter) > 0) {
|
||||
$tplSqlbrowserGeneralStatus->assign_block_vars(
|
||||
'FILTER',
|
||||
array(
|
||||
'SEL_FILTER' => Html::getOptionlist($filter, $selectedFilter)
|
||||
)
|
||||
);
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($status as $key => $val) {
|
||||
if ($selectedFilter != '-1'
|
||||
&& substr($key, 0, strlen($selectedFilter)) != $selectedFilter) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($key, $timeValues)) {
|
||||
$val = getTimeFormat($val);
|
||||
} else {
|
||||
$val = String::formatNumber($val);
|
||||
}
|
||||
|
||||
$tplSqlbrowserGeneralStatus->assign_block_vars(
|
||||
'ROW',
|
||||
array(
|
||||
'ROWCLASS' => $i % 2 ? 'dbrow' : 'dbrow1',
|
||||
'NR' => $i + 1,
|
||||
'VAR_NAME' => $key,
|
||||
'VAR_VALUE' => $val
|
||||
)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
Laden …
Tabelle hinzufügen
Einen Link hinzufügen
In neuem Issue referenzieren