一个redis INFO:-ERR'info'命令的参数个数错误(A redis INFO: -ERR wrong number of arguments for 'info' command)

所以我刚刚运行了INFO命令,如http://redis.io/commands/info所述

但它只给我默认部分 - 如cpu信息和其他

当我尝试添加[section]参数 - 它出错了:

telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

INFO keyspace
-ERR wrong number of arguments for 'info' command

INFO all
-ERR wrong number of arguments for 'info' command

那么如何获得INFO命令的键空间部分?


so i just ran INFO command as described here http://redis.io/commands/info

but it gives me only default sections - like cpu info and other

and when i try to add [section] parameter - it goes wrong:

telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

INFO keyspace
-ERR wrong number of arguments for 'info' command

INFO all
-ERR wrong number of arguments for 'info' command

so how do i get keyspace section of INFO command?


原文:https://stackoverflow.com/questions/21632845
2023-09-26 15:09

满意答案

为了解释, $totalDays在小部件中不可用,因为整个函数仅在呈现小部件时运行,不再声明$totalDays 。 正如@arogachev上面暗示的那样,您需要在模型中制作$totalDays ,然后才能访问它。 在你的模型中试试这个;

public function getTotalDays(){
//Your logic here to generate totalDays
return $totalDays;
}

然后你可以在你的视图中使用它;

[
    'attribute' =>  'class_id',
    'format' => 'raw',
    'label' => "Class Date",
    'value' => function ($model) {
        array_push($model->totalDays, totalDays,$model->class->date);
        return $model->class->date;
    },
    'footer'=> '<span>Total Days</span>',
],

To explain, $totalDays is not available in the widget because the whole function only gets run when the widget is rendered, $totalDays is no longer declared. As @arogachev hinted above, you will need to make $totalDays in your model, then you can access it. Try this in your model;

public function getTotalDays(){
//Your logic here to generate totalDays
return $totalDays;
}

Then you can use it in your view like this;

[
    'attribute' =>  'class_id',
    'format' => 'raw',
    'label' => "Class Date",
    'value' => function ($model) {
        array_push($model->totalDays, totalDays,$model->class->date);
        return $model->class->date;
    },
    'footer'=> '<span>Total Days</span>',
],

相关问答

更多

在gridview yii2中设置宽度图像(Set width image in gridview yii2)

例如,您可以为单元定义类 [ 'attribute' => 'title', 'format' => 'image', 'value' => function($data) { return 'you_image.jpeg'; }, 'contentOptions' => ['class' => 'come-class'] ], 然后使用CSS设置图像宽度。 如果图像宽度可以不同,请使用html格式 [ 'attribute' => 'title', ...

Yii2 - gridview中的搜索链接无效(Yii2 - Search link in the gridview not working)

将URL路由更改为 ['/device/index', 'DeviceSearch[batch]' => $data->batch] Change URL route to ['/device/index', 'DeviceSearch[batch]' => $data->batch]

yii2 gridview中的URL(URL in yii2 gridview)

使用'format' => 'raw'而不是'format' => 'url' 。 Use 'format' => 'raw' instead of 'format' => 'url'.

未定义的变量:karik gridview中的gridColumns:yii2(Undefined variable: gridColumns in karik gridview:yii2)

如果手动分配列,则不需要var iwth列规范,因此请将其删除 <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, //'columns' => $gridColumns, 'showPageSummary' => true, 'columns' => [ ['class' ...

如何使Yii2 GridView响应?(How to make a Yii2 GridView responsive?)

正如它在Bootstrap文档中所述 : 通过在.table-responsive包装任何.table来创建响应表 所以只需将你的小部件包装进去 <div class="table-responsive"> // GridView here </div> As it states in Bootstrap documentation: Create responsive tables by wrapping any .table in .table-responsive So just wrap...

在Yii2 gridview中禁用分页(Disable pagination in Yii2 gridview)

尝试将分页(在您的控制器中)设置为false,如下所示: $dataProvider = new ActiveDataProvider([ 'query' => SomeModelClass::find(), 'pagination' => false, ]); Try setting pagination (in your controller) to false, like this: $dataProvider = new ActiveDataProvider([...

在Gridview函数yii2中访问变量(Access variable in Gridview function yii2)

为了解释, $totalDays在小部件中不可用,因为整个函数仅在呈现小部件时运行,不再声明$totalDays 。 正如@arogachev上面暗示的那样,您需要在模型中制作$totalDays ,然后才能访问它。 在你的模型中试试这个; public function getTotalDays(){ //Your logic here to generate totalDays return $totalDays; } 然后你可以在你的视图中使用它; [ 'attribute' =>...

如何知道yii2 Gridview上的列名[重复](How to know the column name on yii2 Gridview [duplicate])

正如你所说, $item超出了范围,并且如php doc中所述, 关于匿名函数 (不是特定于yii): 闭包还可以从父作用域继承变量。 必须将任何此类变量传递给use语言构造。 你应该简单地添加use ($item) : 'value' => function($model) use ($item) { return $model->{$item->name}; }, PS:这个问题应该关闭,因为它是重复的 As you said, $item is out of scope, and...

在gridview yii2中使用implode(Using implode in gridview yii2)

尝试这个: [ 'value' => function($data){ $sum = array(); foreach ($data->orderInfo as $request){ $sum[] = $request->order_items_offer_name; } return implode(',',$sum); }]...

Yii2 GridView中的HTML(HTML in Yii2 GridView)

数据库输出可能编码两次,而不是 Testing &lt;span class=&#039;test&#039;&gt;HTML&lt;/span&gt; 它的 Testing &amp;lt;span class=&amp;#039;test&amp;#039;&amp;gt;HTML&amp;lt;/span&amp;‌​gt; 尝试解码它两次,如: 'value' => function ($model) { return Html::decode(Html::decode($mo...

相关文章

更多

redis 集群环境搭建-redis集群管理

集群架构 (1)所有的redis节点彼此互联(PING-PONG机制),内部使用二进制协议优化传输速度 ...

jobtracker.info could only be replicated to 0 nodes, instead of 1 错误解决

最近在搭建 Hadoop环境,用的是cygwin伪分布方式,但是一切都配置好后,执行命令start ...

Redis Cookbook

Two years since its initial release, Redis already ...

Hive新旧jar包冲突引起的错误java.lang.NoSuchFieldError: info

Hive新旧jar包冲突引起的错误java.lang.NoSuchFieldError: info ...

redis sentinel.conf详解-redis集群管理

sentinel.conf详解 官方完整示例

redis主从从架构搭建-redis集群管理

主从从架构 [root@master redis-master-slave]# vim 6382/re ...

redis sentinel(哨兵) 配置详解-redis集群管理

1. redis sentinel(哨兵) redis sentinel(哨兵)是对Redis系统的 ...

redis主从复制(读写分离)-redis集群管理

主从复制的好处: 1、 避免redis单点故障 2、 构建读写分离架构,满足读多写少的应用场景 主 ...

Redis概述

什么是Redis Redis是Remote Dictionary Server的缩写, Redis是一 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本