代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/phpredisadmin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
require_once 'includes/common.inc.php';
// This mess could need some cleanup!
if (isset($_POST['commands'])) {
// Append some spaces at the end to make sure we always have enough arguments for the last function.
$commands = str_getcsv(str_replace(array("\r", "\n"), array('', ' '), $_POST['commands']).' ', ' ');
foreach ($commands as &$command) {
$command = stripslashes($command);
}
unset($command);
for ($i = 0; $i < count($commands); ++$i) {
if (empty($commands[$i])) {
continue;
}
$commands[$i] = strtoupper($commands[$i]);
switch ($commands[$i]) {
case 'SET': {
$redis->set($commands[$i+1], $commands[$i+2]);
$i += 2;
break;
}
case 'HSET': {
$redis->hSet($commands[$i+1], $commands[$i+2], $commands[$i+3]);
$i += 3;
break;
}
case 'LPUSH': {
$redis->lPush($commands[$i+1], $commands[$i+2]);
$i += 2;
break;
}
case 'RPUSH': {
$redis->rPush($commands[$i+1], $commands[$i+2]);
$i += 2;
break;
}
case 'LSET': {
$redis->lSet($commands[$i+1], $commands[$i+2], $commands[$i+3]);
$i += 3;
break;
}
case 'SADD': {
$redis->sAdd($commands[$i+1], $commands[$i+2]);
$i += 2;
break;
}
case 'ZADD': {
$redis->zAdd($commands[$i+1], $commands[$i+2], $commands[$i+3]);
$i += 3;
break;
}
}
}
// Refresh the top so the key tree is updated.
require 'includes/header.inc.php';
?>
<script>
top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>';
</script>
<?php
require 'includes/footer.inc.php';
die;
}
$page['css'][] = 'frame';
$page['js'][] = 'frame';
require 'includes/header.inc.php';
?>
<h2>Import</h2>
<form action="<?php echo format_html(getRelativePath('import.php'))?>" method="post">
<p>
<label for="commands">Commands:<br>
<br>
<span class="info">
Valid are:<br>
SET<br>
HSET<br>
LPUSH<br>
RPUSH<br>
LSET<br>
SADD<br>
ZADD
</span>
</label>
<textarea name="commands" id="commands" cols="80" rows="20"></textarea>
</p>
<p>
<input type="submit" class="button" value="Import">
</p>
</form>
<?php
require 'includes/footer.inc.php';
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。