选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
{$term}", $string); } /** * Sends a signal to a process */ function doSignal() { global $data, $lang; $status = $data->sendSignal($_REQUEST['procpid'], $_REQUEST['signal']); if ($status == 0) doProcesses($lang['strsignalsent']); else doProcesses($lang['strsignalsentbad']); } /** * Searches for a named database object */ function doFind($confirm = true, $msg = '') { global $PHP_SELF, $data, $data, $misc; global $lang, $conf; if (!isset($_GET['term'])) $_GET['term'] = ''; if (!isset($_GET['filter'])) $_GET['filter'] = ''; $misc->printTrail('database'); $misc->printTabs('database','find'); $misc->printMsg($msg); echo "
\n"; echo "

_maxNameLen}\" />\n"; // Output list of filters. This is complex due to all the 'has' and 'conf' feature possibilities echo "\n"; echo "\n"; echo $misc->form; echo "\n"; echo "

\n"; // Default focus $misc->setFocus('forms[0].term'); // If a search term has been specified, then perform the search // and display the results, grouped by object type if ($_GET['term'] != '') { $rs = $data->findObject($_GET['term'], $_GET['filter']); if ($rs->recordCount() > 0) { $curr = ''; while (!$rs->EOF) { // Output a new header if the current type has changed, but not if it's just changed the rule type if ($rs->f['type'] != $curr) { // Short-circuit in the case of changing from table rules to view rules; table cols to view cols; // table constraints to domain constraints if ($rs->f['type'] == 'RULEVIEW' && $curr == 'RULETABLE') { $curr = $rs->f['type']; } elseif ($rs->f['type'] == 'COLUMNVIEW' && $curr == 'COLUMNTABLE') { $curr = $rs->f['type']; } elseif ($rs->f['type'] == 'CONSTRAINTTABLE' && $curr == 'CONSTRAINTDOMAIN') { $curr = $rs->f['type']; } else { if ($curr != '') echo "\n"; $curr = $rs->f['type']; echo "

"; switch ($curr) { case 'SCHEMA': echo $lang['strschemas']; break; case 'TABLE': echo $lang['strtables']; break; case 'VIEW': echo $lang['strviews']; break; case 'SEQUENCE': echo $lang['strsequences']; break; case 'COLUMNTABLE': case 'COLUMNVIEW': echo $lang['strcolumns']; break; case 'INDEX': echo $lang['strindexes']; break; case 'CONSTRAINTTABLE': case 'CONSTRAINTDOMAIN': echo $lang['strconstraints']; break; case 'TRIGGER': echo $lang['strtriggers']; break; case 'RULETABLE': case 'RULEVIEW': echo $lang['strrules']; break; case 'FUNCTION': echo $lang['strfunctions']; break; case 'TYPE': echo $lang['strtypes']; break; case 'DOMAIN': echo $lang['strdomains']; break; case 'OPERATOR': echo $lang['stroperators']; break; case 'CONVERSION': echo $lang['strconversions']; break; case 'LANGUAGE': echo $lang['strlanguages']; break; case 'AGGREGATE': echo $lang['straggregates']; break; case 'OPCLASS': echo $lang['stropclasses']; break; } echo "

"; echo "\n"; echo "

", $rs->recordCount(), " ", $lang['strobjects'], "

\n"; } else echo "

{$lang['strnoobjects']}

\n"; } } /** * Displays options for database download */ function doExport($msg = '') { global $data, $misc; global $PHP_SELF, $lang; $misc->printTrail('database'); $misc->printTabs('database','export'); $misc->printMsg($msg); echo "
\n"; echo "\n"; echo "\n"; // Data only echo "\n"; echo "\n"; echo "\n\n"; echo "\n\n"; // Structure only echo "\n"; echo "\n\n"; // Structure and data echo "\n"; echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; echo "
{$lang['strformat']}{$lang['stroptions']}
"; echo "{$lang['strformat']}\n
"; echo "{$lang['strformat']}\n
\n"; echo "

{$lang['stroptions']}

\n"; echo "

\n"; echo "
\n"; // MSIE cannot download gzip in SSL mode - it's just broken if (!(strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS']))) { echo "
\n"; } echo "

\n"; echo "

\n"; echo "\n"; echo $misc->form; echo "

\n"; echo "
\n"; } /** * Show the current status of all database variables */ function doVariables() { global $PHP_SELF, $data, $misc; global $lang; // Fetch the variables from the database $variables = $data->getVariables(); $misc->printTrail('database'); $misc->printTabs('database','variables'); $columns = array( 'variable' => array( 'title' => $lang['strname'], 'field' => 'name', ), 'value' => array( 'title' => $lang['strsetting'], 'field' => 'setting', ), ); $actions = array(); $misc->printTable($variables, $columns, $actions, $lang['strnodata']); } /** * Show all current database connections and any queries they * are running. */ function doProcesses($msg = '') { global $PHP_SELF, $data, $misc; global $lang; $misc->printTrail('database'); $misc->printTabs('database','processes'); $misc->printMsg($msg); // Display prepared transactions if($data->hasPreparedXacts()) { echo "

{$lang['strpreparedxacts']}

\n"; $prep_xacts = $data->getPreparedXacts($_REQUEST['database']); $columns = array( 'transaction' => array( 'title' => $lang['strxactid'], 'field' => 'transaction', ), 'gid' => array( 'title' => $lang['strgid'], 'field' => 'gid', ), 'prepared' => array( 'title' => $lang['strstarttime'], 'field' => 'prepared', ), 'owner' => array( 'title' => $lang['strowner'], 'field' => 'owner', ), ); $actions = array(); $misc->printTable($prep_xacts, $columns, $actions, $lang['strnodata']); } // Fetch the processes from the database echo "

{$lang['strprocesses']}

\n"; $processes = $data->getProcesses($_REQUEST['database']); $columns = array( 'user' => array( 'title' => $lang['strusername'], 'field' => 'usename', ), 'process' => array( 'title' => $lang['strprocess'], 'field' => 'procpid', ), 'query' => array( 'title' => $lang['strsql'], 'field' => 'current_query', ), 'start_time' => array( 'title' => $lang['strstarttime'], 'field' => 'query_start', ), ); if ($data->hasSignals()) { $columns['actions'] = array('title' => $lang['stractions']); $actions = array( 'cancel' => array( 'title' => $lang['strcancel'], 'url' => "{$PHP_SELF}?action=signal&signal=CANCEL&{$misc->href}&", 'vars' => array('procpid' => 'procpid') ) ); } else $actions = array(); // Remove query start time for <7.4 if (!isset($processes->f['query_start'])) unset($columns['start_time']); $misc->printTable($processes, $columns, $actions, $lang['strnodata']); } /** * Show the existing table locks in the current database */ function doLocks() { global $PHP_SELF, $data, $misc; global $lang; // Get the info from the pg_locks view $variables = $data->getLocks(); $misc->printTrail('database'); $misc->printTabs('database','locks'); $columns = array( 'namespace' => array( 'title' => $lang['strschema'], 'field' => 'nspname', ), 'tablename' => array( 'title' => $lang['strtablename'], 'field' => 'tablename', ), 'transactionid' => array( 'title' => $lang['strtransaction'], 'field' => 'transaction', ), 'processid' => array( 'title' => $lang['strprocessid'], 'field' => 'pid', ), 'mode' => array( 'title' => $lang['strmode'], 'field' => 'mode', ), 'granted' => array( 'title' => $lang['strislockheld'], 'field' => 'granted', 'type' => 'yesno', ), ); $actions = array(); $misc->printTable($variables, $columns, $actions, $lang['strnodata']); } /** * Allow database administration and tuning tasks */ function doAdmin($action = '', $msg = '') { global $PHP_SELF, $data, $misc; global $lang; switch ($action) { case 'vacuum': $status = $data->vacuumDB('', isset($_REQUEST['vacuum_analyze']), isset($_REQUEST['vacuum_full']), isset($_REQUEST['vacuum_freeze']) ); if ($status == 0) doAdmin('', $lang['strvacuumgood']); else doAdmin('', $lang['strvacuumbad']); break; case 'analyze': $status = $data->analyzeDB(); if ($status == 0) doAdmin('', $lang['stranalyzegood']); else doAdmin('', $lang['stranalyzebad']); break; case 'recluster': $status = $data->recluster(); if ($status == 0) doAdmin('', $lang['strclusteredgood']); else doAdmin('', $lang['strclusteredbad']); break; case 'reindex'; $status = $data->reindex('DATABASE', $_REQUEST['database'], isset($_REQUEST['reindex_force'])); if ($status == 0) doAdmin('', $lang['strreindexgood']); else doAdmin('', $lang['strreindexbad']); break; default: $misc->printTrail('database'); $misc->printTabs('database','admin'); $misc->printMsg($msg); echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; if ($data->hasRecluster()){ echo ""; } echo ""; echo ""; // Vacuum echo "\n"; echo "\n"; // Analyze echo "\n"; // Recluster if ($data->hasRecluster()){ echo "\n"; } // Reindex echo "\n"; echo "\n"; echo "
"; $misc->printHelp($lang['strvacuum'],'pg.admin.vacuum').""; $misc->printHelp($lang['stranalyze'],'pg.admin.analyze'); echo ""; $misc->printHelp($lang['strclusterindex'],'pg.index.cluster'); echo ""; $misc->printHelp($lang['strreindex'],'pg.index.reindex'); echo "
\n"; echo "
\n"; echo "
\n"; if ($data->hasFullVacuum()) { echo "
\n"; echo "
\n"; } echo "\n"; echo "\n"; echo $misc->form; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo $misc->form; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo $misc->form; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo $misc->form; echo "
\n"; echo "
\n"; echo "
"; echo "
"; if($data->hasAutovacuum()) { $enabled = $data->getVariable('autovacuum'); echo "

{$lang['strautovacuum']} ". (($enabled->f['autovacuum'] == 'on') ? $lang['strturnedon'] : $lang['strturnedoff'] ) ."

"; // Autovacuum // Fetch the processes from the database $autovac = $data->getAutovacuum(); $columns = array( 'namespace' => array( 'title' => $lang['strschema'], 'field' => 'nspname', ), 'relname' => array( 'title' => $lang['strtable'], 'field' => 'relname', ), 'enabled' => array( 'title' => $lang['strenabled'], 'field' => 'enabled', ), 'vac_base_thresh' => array( 'title' => $lang['strvacuumbasethreshold'], 'field' => 'vac_base_thresh', ), 'vac_scale_factor' => array( 'title' => $lang['strvacuumscalefactor'], 'field' => 'vac_scale_factor', ), 'anl_base_thresh' => array( 'title' => $lang['stranalybasethreshold'], 'field' => 'anl_base_thresh', ), 'anl_scale_factor' => array( 'title' => $lang['stranalyzescalefactor'], 'field' => 'anl_scale_factor', ), 'vac_cost_delay' => array( 'title' => $lang['strvacuumcostdelay'], 'field' => 'vac_cost_delay', ), 'vac_cost_limit' => array( 'title' => $lang['strvacuumcostlimit'], 'field' => 'vac_cost_limit', ), ); // Maybe we need to check permissions here? $columns['actions'] = array('title' => $lang['stractions']); $actions = array( 'edit' => array( 'title' => $lang['stredit'], 'url' => "{$PHP_SELF}?action=editautovac&schema=pg_catalog&{$misc->href}&", 'vars' => array('key[vacrelid]' => 'vacrelid') ), 'delete' => array( 'title' => $lang['strdelete'], 'url' => "{$PHP_SELF}?action=delautovac&{$misc->href}&", 'vars' => array('key[vacrelid]' => 'vacrelid') ) ); $misc->printTable($autovac, $columns, $actions, $lang['strnodata']); } break; } } /** * Show confirmation of edit and perform actual update of autovacuum entry */ function doEditAutovacuum($confirm, $msg = '') { global $data, $misc, $conf; global $lang; global $PHP_SELF; $key = $_REQUEST['key']; if ($confirm) { $misc->printTrail('database'); $misc->printTabs('database','admin'); $misc->printMsg($msg); $attrs = $data->getTableAttributes('pg_autovacuum'); $rs = $data->browseRow('pg_autovacuum', $key); echo "
\n"; $elements = 0; $error = true; if ($rs->recordCount() == 1 && $attrs->recordCount() > 0) { echo "\n"; // Output table header echo ""; echo "\n"; echo ""; $i = 0; $nCC = 0; while (!$attrs->EOF) { $szValueName = "values[{$attrs->f['attname']}]"; $szEvents = ""; $szDivPH = ""; $attrs->f['attnotnull'] = $data->phpBool($attrs->f['attnotnull']); $id = (($i % 2) == 0 ? '1' : '2'); // Initialise variables if (!isset($_REQUEST['format'][$attrs->f['attname']])) $_REQUEST['format'][$attrs->f['attname']] = 'VALUE'; echo "\n"; echo ""; echo ""; $elements++; echo "\n"; $elements++; echo ""; $elements++; echo "\n"; $i++; $attrs->moveNext(); } echo "
{$lang['strcolumn']}{$lang['strtype']}{$lang['strformat']}{$lang['strvalue']}
", $misc->printVal($attrs->f['attname']), "\n"; echo $misc->printVal($data->formatType($attrs->f['type'], $attrs->f['atttypmod'])); echo "f['attname']), "]\" value=\"", htmlspecialchars($attrs->f['type']), "\" />\n"; echo "\n"; echo $data->printField($szValueName, $rs->f[$attrs->f['attname']], $attrs->f['type'],array(),$szEvents) . $szDivPH; echo "
\n"; $error = false; } elseif ($rs->recordCount() != 1) { echo "

{$lang['strrownotunique']}

\n"; } else { echo "

{$lang['strinvalidparam']}

\n"; } echo "\n"; echo $misc->form; echo "\n"; echo "\n"; echo "

"; if (!$error) echo "\n"; echo "\n"; echo "

\n"; echo "
\n"; } else { if (!isset($_POST['values'])) $_POST['values'] = array(); if (!isset($_POST['nulls'])) $_POST['nulls'] = array(); $status = $data->editRow($_POST['table'], $_POST['values'], $_POST['nulls'], $_POST['format'], $_POST['types'], unserialize($_POST['key'])); if ($status == 0) doAdmin($lang['strrowupdated']); elseif ($status == -2) doEditAutovacuum(true, $lang['strrownotunique']); else doEditAutovacuum(true, $lang['strrowupdatedbad']); } } /** * Delete rows from the autovacuum table */ function doDelAutovacuum($confirm) { global $PHP_SELF, $data, $misc; global $lang; if ($confirm) { $misc->printTrail('database'); $misc->printTabs('database','admin'); $misc->printTitle($lang['strdeleterow']); echo "

{$lang['strconfdeleterow']}

\n"; echo "
\n"; echo "\n"; echo $misc->form; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; } else { $status = $data->deleteRow($_POST['table'], unserialize($_POST['key'])); if ($status == 0) doAdmin('',$lang['strrowdeleted']); elseif ($status == -2) doAdmin('',$lang['strrownotunique']); else doAdmin('',$lang['strrowdeletedbad']); } } /** * Allow execution of arbitrary SQL statements on a database */ function doSQL() { global $PHP_SELF, $data, $misc; global $lang; if (!isset($_REQUEST['query'])) $_REQUEST['query'] = ''; $misc->printTrail('database'); $misc->printTabs('database','sql'); echo "

{$lang['strentersql']}

\n"; echo "
\n"; echo "

{$lang['strsql']}
\n"; echo "\n"; // Check that file uploads are enabled if (ini_get('file_uploads')) { // Don't show upload option if max size of uploads is zero $max_size = $misc->inisizeToBytes(ini_get('upload_max_filesize')); if (is_double($max_size) && $max_size > 0) { echo "

\n"; echo " {$lang['struploadscript']}

\n"; } } else echo "

\n"; echo "\n"; echo "
\n"; echo "

\n"; if ($data->hasFullExplain()) { echo "\n"; echo "\n"; } echo "

\n"; echo $misc->form; echo "
\n"; // Default focus $misc->setFocus('forms[0].query'); } function doTree() { global $misc, $data, $lang, $PHP_SELF, $slony; $reqvars = $misc->getRequestVars('database'); $tabs = $misc->getNavTabs('database'); if (!$data->hasSchemas()) { $tabs = array_merge($misc->getNavTabs('schema'), $tabs); } $items = $misc->adjustTabsForTree($tabs); $attrs = array( 'text' => noEscape(field('title')), 'icon' => field('icon'), 'action' => url(field('url'), $reqvars, field('urlvars', array()) ), 'branch' => url(field('url'), $reqvars, field('urlvars'), array('action' => 'tree') ), ); $misc->printTreeXML($items, $attrs); exit; } if ($action == 'tree') doTree(); $misc->printHeader($lang['strschemas']); $misc->printBody(); switch ($action) { case 'find': if (isset($_GET['term'])) doFind(false); else doFind(true); break; case 'recluster': case 'reindex': case 'analyze': case 'vacuum': doAdmin($action); break; case 'admin': doAdmin(); break; case 'sql': doSQL(); break; case 'variables': doVariables(); break; case 'processes': doProcesses(); break; case 'locks': doLocks(); break; case 'export': doExport(); break; case 'signal': doSignal(); break; case 'editautovac': doEditAutovacuum(true); break; case 'confeditautovac': if (isset($_POST['save'])) doEditAutovacuum(false); else doAdmin(); break; case 'delautovac': doDelAutovacuum(true); break; case 'confdelautovac': if (isset($_POST['yes'])) doDelAutovacuum(false); else doAdmin(); break; default: doSQL(); break; } $misc->printFooter(); ?>