コード例 #1
0
ファイル: edit.php プロジェクト: nowphp/phpRedisAdmin
                    } else {
                        die('ERROR: Out of bounds index');
                    }
                }
            } else {
                if ($_POST['type'] == 'set') {
                    if ($_POST['value'] != $_POST['oldvalue']) {
                        // The only way to edit a Set value is to add it and remove the old value.
                        $redis->sRem(input_convert($_POST['key']), input_convert($_POST['oldvalue']));
                        $redis->sAdd(input_convert($_POST['key']), input_convert($_POST['value']));
                    }
                } else {
                    if ($_POST['type'] == 'zset' && isset($_POST['score'])) {
                        // The only way to edit a ZSet value is to add it and remove the old value.
                        $redis->zRem(input_convert($_POST['key']), input_convert($_POST['oldvalue']));
                        $redis->zAdd(input_convert($_POST['key']), input_convert($_POST['score']), input_convert($_POST['value']));
                    }
                }
            }
        }
    }
    // Refresh the top so the key tree is updated.
    require 'includes/header.inc.php';
    ?>
  <script>
  top.location.href = top.location.pathname+'?view&s=<?php 
    echo $server['id'];
    ?>
&d=<?php 
    echo $server['db'];
    ?>
コード例 #2
0
ファイル: edit.php プロジェクト: pksurecom/phpRedisAdmin
                    } else {
                        die('ERROR: Out of bounds index');
                    }
                }
            } else {
                if ($_POST['type'] == 'set') {
                    if ($_POST['value'] != $_POST['oldvalue']) {
                        // The only way to edit a Set value is to add it and remove the old value.
                        $redis->sRem($key, encodeOrDecode('save', $key, input_convert($_POST['oldvalue'])));
                        $redis->sAdd($key, $value);
                    }
                } else {
                    if ($_POST['type'] == 'zset' && isset($_POST['score'])) {
                        // The only way to edit a ZSet value is to add it and remove the old value.
                        $redis->zRem($key, encodeOrDecode('save', $key, input_convert($_POST['oldvalue'])));
                        $redis->zAdd($key, input_convert($_POST['score']), $value);
                    }
                }
            }
        }
    }
    // Refresh the top so the key tree is updated.
    require 'includes/header.inc.php';
    ?>
  <script>
  top.location.href = top.location.pathname+'?view&s=<?php 
    echo $server['id'];
    ?>
&d=<?php 
    echo $server['db'];
    ?>